summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorgetzze2018-11-03 23:41:48 +0000
committergetzze2018-11-03 23:41:48 +0000
commit0a98f273576c7ed2bf000882730e2ccac1dcd9cb (patch)
treef50174daa78173beb5a410a565952ff92b760fc6
downloadaur-0a98f273576c7ed2bf000882730e2ccac1dcd9cb.tar.gz
version 0.17
-rw-r--r--.SRCINFO81
-rw-r--r--PKGBUILD121
-rw-r--r--apache-funkwhale.conf136
-rw-r--r--env-template141
4 files changed, 479 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..eb0c702f30b
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,81 @@
+pkgbase = funkwhale
+ pkgdesc = A self-hosted, modern free and open-source music server, heavily inspired by Grooveshark.
+ pkgver = 0.17
+ pkgrel = 1
+ url = https://funkwhale.audio/
+ arch = any
+ license = GPL3
+ makedepends = git
+ depends = ffmpeg
+ depends = libjpeg
+ depends = postgresql
+ depends = python
+ depends = youtube-dl
+ depends = ipython
+ depends = mod_xsendfile
+ depends = python-django>=2
+ depends = python-django-environ
+ depends = python-whitenoise
+ depends = python-pillow
+ depends = python-django-allauth
+ depends = python-psycopg2
+ depends = python-pytz
+ depends = python-redis
+ depends = python-django-redis
+ depends = python-celery
+ depends = python-django-cors-headers
+ depends = python-musicbrainzngs
+ depends = python-django-rest-framework
+ depends = python-django-rest-framework-jwt
+ depends = python-oauth2client
+ depends = python-google-api-python-client
+ depends = python-pendulum
+ depends = python-persisting-theory
+ depends = python-django-versatile-imagefield
+ depends = python-django-filter1.1
+ depends = python-django-rest-auth
+ depends = python-beautifulsoup4
+ depends = python-markdown
+ depends = python-mutagen
+ depends = python-django-taggit
+ depends = python-pymemoize
+ depends = python-django-dynamic-preferences
+ depends = python-pyacoustid
+ depends = python-raven
+ depends = python-magic-git
+ depends = python-ffmpeg
+ depends = python-django-channels
+ depends = python-django-channels-redis
+ depends = python-daphne
+ depends = python-cryptography
+ depends = python-requests-http-signature
+ depends = python-django-cleanup
+ depends = python-ldap
+ depends = python-django-auth-ldap
+ depends = python-service-identity
+ optdepends = apache: to use the Apache web server
+ optdepends = certbot-apache: for the server to be accessible from outside
+ optdepends = nginx: to use nginx web server
+ source = funkwhale-0.17-api.zip::https://code.eliotberriot.com/funkwhale/funkwhale/builds/artifacts/0.17/download?job=build_api
+ source = funkwhale-0.17-front.zip::https://code.eliotberriot.com/funkwhale/funkwhale/builds/artifacts/0.17/download?job=build_front
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/funkwhale_proxy.conf
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/nginx.template
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/funkwhale.target
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/funkwhale-beat.service
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/funkwhale-worker.service
+ source = https://code.eliotberriot.com/funkwhale/funkwhale/raw/0.17/deploy/funkwhale-server.service
+ source = apache-funkwhale.conf
+ source = env-template
+ sha256sums = 8211b9ff86cde6557ff8b3904ffeb7380e18e47b7b4b76c91f30986d284911a3
+ sha256sums = 3578e1c60da578681c4e60a94dde1e18511f2455814c980b24748c87ffb8b4a2
+ sha256sums = 2906a075b41dcd2375c601482cb5a00e42cb87c613012b176c570d77918afbf2
+ sha256sums = 0d022981f24c9ed8306751d905e85a2fa086c124d7284cc765a3a83814e6efd8
+ sha256sums = 9a84d9e1f105cd92448e6e4696e11412584b616b248d578e2fe756972a20f74e
+ sha256sums = b30fd8f119a53a424c9372a3fdcaad3175f33f242b498b0348c697942573588d
+ sha256sums = 976ddd2f409efa367e8f53d96092007d0886a473507294a3092a96e885b5e59a
+ sha256sums = b2ff1a2911883416b3a8c35a3e579d493c0bcf4039604020a206c6e8b5fc0ba7
+ sha256sums = 26f91e1b22d7c46a6e26c25889babb8d5e77f7a4aec06bd61833cf953fd48f4a
+ sha256sums = 90c9a2b1ef1ac58589eda10c09a9af8141813aa6b661251eb571a1f757bea8c5
+
+pkgname = funkwhale
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..66744ee0a7d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,121 @@
+# Maintainer: getzze <getzze at gmail dot com>
+
+pkgname=funkwhale
+pkgver=0.17
+pkgrel=1
+pkgdesc="A self-hosted, modern free and open-source music server, heavily inspired by Grooveshark."
+arch=(any)
+url="https://funkwhale.audio/"
+license=(GPL3)
+optdepends=('apache: to use the Apache web server'
+ 'certbot-apache: for the server to be accessible from outside'
+ 'nginx: to use nginx web server')
+depends=('ffmpeg' 'libjpeg' 'postgresql' 'python' 'youtube-dl'
+ 'ipython'
+ 'mod_xsendfile'
+ 'python-django>=2'
+ 'python-django-environ'
+ 'python-whitenoise'
+ 'python-pillow'
+ 'python-django-allauth'
+ 'python-psycopg2'
+ 'python-pytz'
+ 'python-redis'
+ 'python-django-redis'
+ 'python-celery'
+ 'python-django-cors-headers'
+ 'python-musicbrainzngs'
+ 'python-django-rest-framework'
+ 'python-django-rest-framework-jwt'
+ 'python-oauth2client'
+ 'python-google-api-python-client'
+ 'python-pendulum'
+ 'python-persisting-theory'
+ 'python-django-versatile-imagefield'
+ 'python-django-filter1.1'
+ 'python-django-rest-auth'
+ 'python-beautifulsoup4'
+ 'python-markdown'
+ 'python-mutagen'
+ 'python-django-taggit'
+ 'python-pymemoize'
+ 'python-django-dynamic-preferences'
+ 'python-pyacoustid'
+ 'python-raven'
+ 'python-magic-git'
+ 'python-ffmpeg'
+ 'python-django-channels'
+ 'python-django-channels-redis'
+ 'python-daphne'
+ 'python-cryptography'
+ 'python-requests-http-signature'
+ 'python-django-cleanup'
+ 'python-ldap'
+ 'python-django-auth-ldap'
+ 'python-service-identity'
+)
+makedepends=(git)
+_source_api="https://code.eliotberriot.com/funkwhale/funkwhale/builds/artifacts/${pkgver}/download?job="
+_source_env="https://code.eliotberriot.com/funkwhale/funkwhale/raw/${pkgver}/deploy/"
+source=("${pkgname}-${pkgver}-api.zip::${_source_api}build_api"
+ "${pkgname}-${pkgver}-front.zip::${_source_api}build_front"
+ "${_source_env}funkwhale_proxy.conf"
+ "${_source_env}nginx.template"
+ "${_source_env}funkwhale.target"
+ "${_source_env}funkwhale-beat.service"
+ "${_source_env}funkwhale-worker.service"
+ "${_source_env}funkwhale-server.service"
+ "apache-funkwhale.conf"
+ "env-template"
+)
+sha256sums=('8211b9ff86cde6557ff8b3904ffeb7380e18e47b7b4b76c91f30986d284911a3'
+ '3578e1c60da578681c4e60a94dde1e18511f2455814c980b24748c87ffb8b4a2'
+ '2906a075b41dcd2375c601482cb5a00e42cb87c613012b176c570d77918afbf2'
+ '0d022981f24c9ed8306751d905e85a2fa086c124d7284cc765a3a83814e6efd8'
+ '9a84d9e1f105cd92448e6e4696e11412584b616b248d578e2fe756972a20f74e'
+ 'b30fd8f119a53a424c9372a3fdcaad3175f33f242b498b0348c697942573588d'
+ '976ddd2f409efa367e8f53d96092007d0886a473507294a3092a96e885b5e59a'
+ 'b2ff1a2911883416b3a8c35a3e579d493c0bcf4039604020a206c6e8b5fc0ba7'
+ '26f91e1b22d7c46a6e26c25889babb8d5e77f7a4aec06bd61833cf953fd48f4a'
+ '90c9a2b1ef1ac58589eda10c09a9af8141813aa6b661251eb571a1f757bea8c5')
+
+prepare() {
+ cd "$srcdir"
+
+ sed -i 's#WorkingDirectory=/srv/funkwhale/api#WorkingDirectory=/usr/share/webapps/funkwhale/api#' *.service
+ sed -i 's#EnvironmentFile=/srv/funkwhale/config/.env#EnvironmentFile=/etc/webapps/funkwhale/config/.env#' *.service
+ sed -i 's#ExecStart=/srv/funkwhale/virtualenv/bin/#ExecStart=/usr/bin/#' *.service
+
+
+}
+
+build() {
+ cd "$srcdir"
+ ## TODO: build front-end from source
+}
+
+package() {
+ cd "$srcdir"
+
+ # install project
+ install -d "$pkgdir"/usr/share/webapps/${pkgname}
+ cp -R api "$pkgdir"/usr/share/webapps/${pkgname}/.
+ cp -R front "$pkgdir"/usr/share/webapps/${pkgname}/.
+ chown -R funkwhale:funkwhale "$pkgdir"/usr/share/webapps/${pkgname}
+
+ install -d "$pkgdir"/etc/webapps/${pkgname}/config
+ install -Dm644 funkwhale_proxy.conf "$pkgdir"/etc/webapps/${pkgname}/.
+ install -Dm644 nginx.template "$pkgdir"/etc/webapps/${pkgname}/.
+ install -Dm644 apache-funkwhale.conf "$pkgdir"/etc/webapps/${pkgname}/.
+ install -Dm644 env-template "$pkgdir"/etc/webapps/${pkgname}/env.template
+
+ install -Dm644 funkwhale.target "$pkgdir/usr/lib/systemd/system/funkwhale.target"
+ install -Dm644 funkwhale-beat.service "$pkgdir/usr/lib/systemd/system/funkwhale-beat.service"
+ install -Dm644 funkwhale-worker.service "$pkgdir/usr/lib/systemd/system/funkwhale-worker.service"
+ install -Dm644 funkwhale-server.service "$pkgdir/usr/lib/systemd/system/funkwhale-server.service"
+
+ echo 'u funkwhale - "Funkwhale music server" /srv/funkwhale' |
+ install -Dm644 /dev/stdin "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
+ echo 'd /srv/funkwhale 0775 funkwhale funkwhale' |
+ install -Dm644 /dev/stdin "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
+}
diff --git a/apache-funkwhale.conf b/apache-funkwhale.conf
new file mode 100644
index 00000000000..18a1cdf831f
--- /dev/null
+++ b/apache-funkwhale.conf
@@ -0,0 +1,136 @@
+# Following variables MUST be modified according to your setup
+Define funkwhale-sn funkwhale.local
+
+# Following variables should be modified according to your setup and if you
+# use different configuration than what is described in our installation guide.
+Define funkwhale-api http://localhost:5000
+Define funkwhale-api-ws ws://localhost:5000
+Define FRONTEND_PATH /usr/share/webapps/funkwhale/front/dist
+Define MUSIC_DIRECTORY_PATH /srv/funkwhale/data/music
+
+# HTTP requests redirected to HTTPS
+<VirtualHost 127.0.0.2:80>
+ ServerName ${funkwhale-sn}
+
+ # Default is to force https
+ RewriteEngine on
+ RewriteCond %{SERVER_NAME} =${funkwhale-sn}
+ RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
+
+ <Location "/.well-known/acme-challenge/">
+ Options None
+ Require all granted
+ </Location>
+</VirtualHost>
+
+
+<IfModule mod_ssl.c>
+<VirtualHost 127.0.0.2:443>
+ # Protocols h2 http/1.1
+ ServerName ${funkwhale-sn}
+
+ # Path to ErrorLog and access log
+ ErrorLog /var/log/httpd/funkwhale/error.log
+ CustomLog /var/log/httpd/funkwhale/access.log combined
+
+ # TLS
+ # Feel free to use your own configuration for SSL here or simply remove the
+ # lines and move the configuration to the previous server block if you
+ # don't want to run funkwhale behind https (this is not recommended)
+ # have a look here for let's encrypt configuration:
+ # https://certbot.eff.org/lets-encrypt/debianstretch-apache.html
+ SSLEngine on
+ SSLProxyEngine On
+ SSLCertificateFile "/etc/webapps/funkwhale/config/funkwhale-server.crt"
+ SSLCertificateKeyFile "/etc/webapps/funkwhale/config/funkwhale-server.key"
+# SSLCertificateFile /etc/letsencrypt/live/${funkwhale-sn}/fullchain.pem
+# SSLCertificateKeyFile /etc/letsencrypt/live/${funkwhale-sn}/privkey.pem
+# Include /etc/letsencrypt/options-ssl-apache.conf
+
+ # Tell the api that the client is using https
+ RequestHeader set X-Forwarded-Proto "https"
+
+ DocumentRoot ${FRONTEND_PATH}
+
+ FallbackResource /index.html
+
+ # Configure Proxy settings
+ # ProxyPreserveHost pass the original Host header to the backend server
+ ProxyVia On
+ ProxyPreserveHost On
+ <IfModule mod_remoteip.c>
+ RemoteIPHeader X-Forwarded-For
+ </IfModule>
+
+ # Turning ProxyRequests on and allowing proxying from all may allow
+ # spammers to use your proxy to send email.
+ ProxyRequests Off
+
+ <Proxy *>
+ AddDefaultCharset off
+ Order Allow,Deny
+ Allow from all
+ </Proxy>
+
+ # Activating WebSockets
+ ProxyPass "/api/v1/instance/activity" ${funkwhale-api-ws}/api/v1/instance/activity
+
+ <Location "/api">
+ # similar to nginx 'client_max_body_size 30M;'
+ LimitRequestBody 31457280
+
+ ProxyPass ${funkwhale-api}/api
+ ProxyPassReverse ${funkwhale-api}/api
+ </Location>
+ <Location "/federation">
+ ProxyPass ${funkwhale-api}/federation
+ ProxyPassReverse ${funkwhale-api}/federation
+ </Location>
+
+ # You can comment this if you don't plan to use the Subsonic API
+ <Location "/rest">
+ ProxyPass ${funkwhale-api}/api/subsonic/rest
+ ProxyPassReverse ${funkwhale-api}/api/subsonic/rest
+ </Location>
+
+ <Location "/.well-known/">
+ ProxyPass ${funkwhale-api}/.well-known/
+ ProxyPassReverse ${funkwhale-api}/.well-known/
+ </Location>
+
+ Alias /media /srv/funkwhale/data/media
+
+ Alias /staticfiles /srv/funkwhale/data/static
+
+ # Setting appropriate access levels to serve frontend
+ <Directory "/srv/funkwhale/data/static">
+ Options FollowSymLinks
+ AllowOverride None
+ Require all granted
+ </Directory>
+
+ <Directory ${FRONTEND_PATH}>
+ Options FollowSymLinks
+ AllowOverride None
+ Require all granted
+ </Directory>
+
+ <Directory /srv/funkwhale/data/media>
+ Options FollowSymLinks
+ AllowOverride None
+ Require all granted
+ </Directory>
+
+ # XSendFile is serving audio files
+ # WARNING : permissions on paths specified below overrides previous definition,
+ # everything under those paths is potentially exposed.
+ # Following directive may be needed to ensure xsendfile is loaded
+ LoadModule xsendfile_module modules/mod_xsendfile.so
+ <IfModule mod_xsendfile.c>
+ XSendFile On
+ XSendFilePath /srv/funkwhale/data/media
+ XSendFilePath ${MUSIC_DIRECTORY_PATH}
+ SetEnv MOD_X_SENDFILE_ENABLED 1
+ </IfModule>
+</VirtualHost>
+</IfModule>
diff --git a/env-template b/env-template
new file mode 100644
index 00000000000..595ed943a98
--- /dev/null
+++ b/env-template
@@ -0,0 +1,141 @@
+# If you have any doubts about what a setting does,
+# check https://docs.funkwhale.audio/configuration.html#configuration-reference
+
+# If you're tweaking this file from the template, ensure you edit at least the
+# following variables:
+# - DJANGO_SECRET_KEY
+# - DJANGO_ALLOWED_HOSTS
+# - FUNKWHALE_HOSTNAME
+# - EMAIL_CONFIG and DEFAULT_FROM_EMAIL if you plan to send emails)
+# On non-docker setup **only**, you'll also have to tweak/uncomment those variables:
+# - DATABASE_URL
+# - CACHE_URL
+#
+# You **don't** need to update those variables on pure docker setups.
+#
+# Additional options you may want to check:
+# - MUSIC_DIRECTORY_PATH and MUSIC_DIRECTORY_SERVE_PATH if you plan to use
+# in-place import
+#
+# Docker only
+# -----------
+
+# The tag of the image we should use
+# (it will be interpolated in docker-compose file)
+# You can comment or ignore this if you're not using docker
+FUNKWHALE_VERSION=latest
+
+# End of Docker-only configuration
+
+# General configuration
+# ---------------------
+
+# Set this variables to bind the API server to another interface/port
+# example: FUNKWHALE_API_IP=0.0.0.0
+# example: FUNKWHALE_API_PORT=5678
+FUNKWHALE_API_IP=127.0.0.1
+FUNKWHALE_API_PORT=5000
+
+# Replace this by the definitive, public domain you will use for
+# your instance
+FUNKWHALE_HOSTNAME=funkwhale.local
+FUNKWHALE_PROTOCOL=https
+
+# Configure email sending using this variale
+# By default, funkwhale will output emails sent to stdout
+# here are a few examples for this setting
+# EMAIL_CONFIG=consolemail:// # output emails to console (the default)
+# EMAIL_CONFIG=dummymail:// # disable email sending completely
+# On a production instance, you'll usually want to use an external SMTP server:
+# EMAIL_CONFIG=smtp://user@:password@youremail.host:25
+# EMAIL_CONFIG=smtp+ssl://user@:password@youremail.host:465
+# EMAIL_CONFIG=smtp+tls://user@:password@youremail.host:587
+
+# The email address to use to send system emails.
+# DEFAULT_FROM_EMAIL=noreply@yourdomain
+
+# Depending on the reverse proxy used in front of your funkwhale instance,
+# the API will use different kind of headers to serve audio files
+# Allowed values: nginx, apache2
+REVERSE_PROXY_TYPE=apache2
+
+# API/Django configuration
+
+# Database configuration
+# Examples:
+# DATABASE_URL=postgresql://<user>:<password>@<host>:<port>/<database>
+# DATABASE_URL=postgresql://funkwhale:passw0rd@localhost:5432/funkwhale_database
+# Use the next one if you followed Debian installation guide
+DATABASE_URL=postgresql://funkwhale@:5432/funkwhale
+
+# Cache configuration
+# Examples:
+# CACHE_URL=redis://<host>:<port>/<database>
+# CACHE_URL=redis://localhost:6379/0
+# Use the next one if you followed Debian installation guide
+CACHE_URL=redis://127.0.0.1:6379/0
+
+# Where media files (such as album covers or audio tracks) should be stored
+# on your system?
+# (Ensure this directory actually exists)
+MEDIA_ROOT=/srv/funkwhale/data/media
+
+# Where static files (such as API css or icons) should be compiled
+# on your system?
+# (Ensure this directory actually exists)
+STATIC_ROOT=/srv/funkwhale/data/static
+
+# Update it to match the domain that will be used to reach your funkwhale
+# instance
+# Example: DJANGO_ALLOWED_HOSTS=funkwhale.yourdomain.com
+DJANGO_ALLOWED_HOSTS=127.0.0.2,funkwhale.local
+
+# which settings module should django use?
+# You don't have to touch this unless you really know what you're doing
+DJANGO_SETTINGS_MODULE=config.settings.production
+
+# Generate one using `openssl rand -base64 45`, for example
+DJANGO_SECRET_KEY=
+
+# You don't have to edit this, but you can put the admin on another URL if you
+# want to
+# DJANGO_ADMIN_URL=^api/admin/
+
+# Sentry/Raven error reporting (server side)
+# Enable Raven if you want to help improve funkwhale by
+# automatically sending error reports our Sentry instance.
+# This will help us detect and correct bugs
+RAVEN_ENABLED=false
+RAVEN_DSN=https://44332e9fdd3d42879c7d35bf8562c6a4:0062dc16a22b41679cd5765e5342f716@sentry.eliotberriot.com/5
+
+# In-place import settings
+# You can safely leave those settings uncommented if you don't plan to use
+# in place imports.
+# Typical docker setup:
+# MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
+# MUSIC_DIRECTORY_SERVE_PATH=/music # docker-only
+# Typical non-docker setup:
+# MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
+# # MUSIC_DIRECTORY_SERVE_PATH= # stays commented, not needed
+
+MUSIC_DIRECTORY_PATH=/srv/funkwhale/data/music
+MUSIC_DIRECTORY_SERVE_PATH=/srv/funkwhale/data/music
+
+# LDAP settings
+# Use the following options to allow authentication on your Funkwhale instance
+# using a LDAP directory.
+# Have a look at https://docs.funkwhale.audio/installation/ldap.html for
+# detailed instructions.
+
+# LDAP_ENABLED=False
+# LDAP_SERVER_URI=ldap://your.server:389
+# LDAP_BIND_DN=cn=admin,dc=domain,dc=com
+# LDAP_BIND_PASSWORD=bindpassword
+# LDAP_SEARCH_FILTER=(|(cn={0})(mail={0}))
+# LDAP_START_TLS=False
+# LDAP_ROOT_DN=dc=domain,dc=com
+
+FUNKWHALE_FRONTEND_PATH=/usr/share/webapps/funkwhale/front/dist
+
+# Nginx related configuration
+NGINX_MAX_BODY_SIZE=30M