Backported some edits from Funkwhale repo merge request

master fw-mr
Meliurwen 4 years ago
parent 36674edd2f
commit 06375f9b00
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 10
      .env.example
  2. 6
      docker-compose.yml
  3. 14
      nginx/funkwhale.template

@ -5,9 +5,9 @@ HOST_CACHE_DIR=/srv/funkwhale/redis/data
HOST_MUSIC_DIRECTORY_PATH=/srv/funkwhale/media/music HOST_MUSIC_DIRECTORY_PATH=/srv/funkwhale/media/music
# Where media files (such as album covers or audio tracks) should be stored # Where media files (such as album covers or audio tracks) should be stored
HOST_MEDIA_ROOT=/srv/funkwhale/media/media HOST_MEDIA_ROOT=/srv/funkwhale/media/media
# Where static files (such as API css or icons) should be compiled # Where Django static files (such as API css or icons) should be compiled
HOST_STATIC_ROOT=/srv/funkwhale/api/static HOST_STATIC_ROOT=/srv/funkwhale/api/static
# Why this exists? # Where the Funkwhale webapp static files are located
HOST_FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/api/frontend HOST_FUNKWHALE_FRONTEND_PATH=/srv/funkwhale/api/frontend
# Replace this by the definitive, public domain you will use for # Replace this by the definitive, public domain you will use for
# your instance. It cannot be changed after initial deployment # your instance. It cannot be changed after initial deployment
@ -19,15 +19,15 @@ FUNKWHALE_HOSTNAME=
FUNKWHALE_VERSION= FUNKWHALE_VERSION=
# Networks # Networks
# Name of the external network of the reverse proxy # Name of the main reverse proxy network
REVERSE_PROXY_NETWORK=webservices REVERSE_PROXY_NETWORK=
# Networks (optional) # Networks (optional)
# Restrict internet access to the whole Funkwhale app # Restrict internet access to the whole Funkwhale app
# Note: It will be normally reachable from the web (via the reverse-proxy), but # Note: It will be normally reachable from the web (via the reverse-proxy), but
# the containers cannot make external calls on their own, thus no # the containers cannot make external calls on their own, thus no
# federation or anything that may require internet from the server side. # federation or anything that may require internet from the server side.
NO_INTERNET_ACC=true NO_INTERNET_ACC=
# postgres (optional) # postgres (optional)
DB_IMG= DB_IMG=

@ -100,6 +100,10 @@ services:
- nginx.env - nginx.env
environment: environment:
- FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME} - FUNKWHALE_HOSTNAME=${FUNKWHALE_HOSTNAME}
- MEDIA_ROOT=/srv/wwww/media
- MUSIC_DIRECTORY_PATH=/srv/wwww/music
- STATIC_ROOT=/srv/wwww/static
- FUNKWHALE_FRONTEND_PATH=/srv/wwww/frontend
command: > command: >
sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\" sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\"
< /etc/nginx/conf.d/funkwhale.template < /etc/nginx/conf.d/funkwhale.template
@ -111,7 +115,7 @@ networks:
default: default:
internal: true internal: true
internet-access: internet-access:
internal: ${NO_INTERNET_ACC} internal: ${NO_INTERNET_ACC:-false}
main-webservices: main-webservices:
external: external:
name: ${REVERSE_PROXY_NETWORK} name: ${REVERSE_PROXY_NETWORK}

@ -21,7 +21,7 @@ server {
# have a look here for let's encrypt configuration: # have a look here for let's encrypt configuration:
# https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx # https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx
root /srv/wwww/frontend; root ${FUNKWHALE_FRONTEND_PATH};
# If you are using S3 to host your files, remember to add your S3 URL to the # If you are using S3 to host your files, remember to add your S3 URL to the
# media-src and img-src headers (e.g. img-src 'self' https://<your-S3-URL> data:) # media-src and img-src headers (e.g. img-src 'self' https://<your-S3-URL> data:)
@ -42,7 +42,7 @@ server {
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header Service-Worker-Allowed "/"; add_header Service-Worker-Allowed "/";
add_header X-Frame-Options "ALLOW"; add_header X-Frame-Options "ALLOW";
alias /srv/wwww/frontend/; alias ${FUNKWHALE_FRONTEND_PATH}/;
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Cache-Control "public, must-revalidate, proxy-revalidate";
@ -53,7 +53,7 @@ server {
add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header Referrer-Policy "strict-origin-when-cross-origin";
add_header X-Frame-Options "ALLOW"; add_header X-Frame-Options "ALLOW";
alias /srv/wwww/frontend/embed.html; alias ${FUNKWHALE_FRONTEND_PATH}/embed.html;
expires 30d; expires 30d;
add_header Pragma public; add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Cache-Control "public, must-revalidate, proxy-revalidate";
@ -76,7 +76,7 @@ server {
} }
location /media/ { location /media/ {
alias /srv/wwww/media/; alias ${MEDIA_ROOT}/;
} }
# this is an internal location that is used to serve # this is an internal location that is used to serve
@ -84,7 +84,7 @@ server {
# has been checked on API side # has been checked on API side
location /_protected/media { location /_protected/media {
internal; internal;
alias /srv/wwww/media; alias ${MEDIA_ROOT};
} }
# Comment the previous location and uncomment this one if you're storing # Comment the previous location and uncomment this one if you're storing
@ -102,11 +102,11 @@ server {
# has been checked on API side # has been checked on API side
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting # Set this to the same value as your MUSIC_DIRECTORY_PATH setting
internal; internal;
alias /srv/wwww/music; alias ${MUSIC_DIRECTORY_PATH};
} }
location /staticfiles/ { location /staticfiles/ {
# django static files # django static files
alias /srv/wwww/static/; alias ${STATIC_ROOT}/;
} }
} }

Loading…
Cancel
Save