feat(common,compose): add optional FUNKWHALE_PORT for single-node development
This commit is contained in:
parent
51d5bbf52b
commit
c375329580
1
.env.dev
1
.env.dev
|
@ -4,6 +4,7 @@ DJANGO_SECRET_KEY=dev
|
|||
C_FORCE_ROOT=true
|
||||
FUNKWHALE_HOSTNAME=localhost
|
||||
FUNKWHALE_PROTOCOL=http
|
||||
FUNKWHALE_PORT=8000
|
||||
PYTHONDONTWRITEBYTECODE=true
|
||||
VUE_PORT=8080
|
||||
MUSIC_DIRECTORY_PATH=/music
|
||||
|
|
|
@ -224,7 +224,15 @@ ALLOWED_HOSTS = env.list("DJANGO_ALLOWED_HOSTS", default=[]) + [FUNKWHALE_HOSTNA
|
|||
List of allowed hostnames for which the Funkwhale server will answer.
|
||||
"""
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [urlparse(o, FUNKWHALE_PROTOCOL).geturl() for o in ALLOWED_HOSTS]
|
||||
try:
|
||||
FUNKWHALE_PORT = env.int("FUNKWHALE_PORT")
|
||||
except:
|
||||
logger.warning("Funkwhale is served from default port.")
|
||||
|
||||
try:
|
||||
CSRF_TRUSTED_ORIGINS = [urlparse('//' + o + (':' + str(FUNKWHALE_PORT) if (FUNKWHALE_PORT != 80) else ''), FUNKWHALE_PROTOCOL).geturl() for o in ALLOWED_HOSTS]
|
||||
except:
|
||||
CSRF_TRUSTED_ORIGINS = [urlparse('//' + o, FUNKWHALE_PROTOCOL).geturl() for o in ALLOWED_HOSTS]
|
||||
"""
|
||||
List of origins that are trusted for unsafe requests
|
||||
We simply consider all allowed hosts to be trusted origins
|
||||
|
|
|
@ -79,6 +79,7 @@ services:
|
|||
- "DATABASE_URL=postgresql://postgres@postgres/postgres"
|
||||
- "CACHE_URL=redis://redis:6379/0"
|
||||
- "STATIC_ROOT=/staticfiles"
|
||||
# - FUNKWHALE_PORT=${FUNKWHALE_PORT}
|
||||
|
||||
depends_on:
|
||||
- postgres
|
||||
|
@ -110,6 +111,7 @@ services:
|
|||
- "FUNKWHALE_PROTOCOL=${FUNKWHALE_PROTOCOL:-http}"
|
||||
- "DATABASE_URL=postgresql://postgres@postgres/postgres"
|
||||
- "CACHE_URL=redis://redis:6379/0"
|
||||
# - FUNKWHALE_PORT=${FUNKWHALE_PORT}
|
||||
volumes:
|
||||
- ./api:/app
|
||||
- "${MUSIC_DIRECTORY_SERVE_PATH:-./data/music}:/music:ro"
|
||||
|
|
Loading…
Reference in New Issue