Hello everyone,
I have been looking into funkwhale for a while now and have been wanting to start up my own pod, but I have been having some issues. Primarily that I am unable to log in with a created account.
[error] 37#37: *32 connect() failed (111: Connection refused) while connecting to upstream, client: <Home_IP>, server: _, request: "GET /api/v1/users/me/ HTTP/1.1", upstream: "http://<Server_IP>/api/v1/users/me/", host: "<Server_IP>", referrer: "http://<Server_IP>/"
I think this might stem from a configuration issue, which I will post the compose and env files later on.
Before I get to my specific config settings, I wanted to give a bit of a heads up on my system overall. I am unfortunately behind a CGNAT and so I can't forward directly. So what I do instead is use cloudflare tunnels to expose. My general workflow with containers is to spin up a container, do what I do from the IP and then eventually point a cloudflare tunnel record at the ip and then I can use it from my domain.
I have tried all manor of configurations of setting the API_IP and HOSTNAME variables to any and all combinations of 0.0.0.0, 127.0.0.1, the servers ip, and the eventual cloudflare tunnel domain address. If I set the eventual domain of funkwhale.my.domain
then the site is completely unreachable no matter what I do, however if I set the server ip as the hostname it is reachable, but then I am I cannot log in (see error message above), I have also execd into the api and created the superuser.
I have a feeling it might be from a mismatch in the http/https settings, typically I don't bother with ssl certs for my internal containers but anythign that I expose I just let cloudflare handle the ssl certs for me. But that seems to be conflicting here.
Thank you for taking the time to read my post, any help would be much appreciated!
`
version: "3"
services:
postgres:
restart: unless-stopped
env_file: .env
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
image: postgres:15-alpine
volumes:
- ${POSTGRES_DATA_DIR}:/var/lib/postgresql/data
redis:
restart: unless-stopped
env_file: .env
image: redis:7-alpine
volumes:
- ${REDIS_DATA_DIR}:/data
celeryworker:
restart: unless-stopped
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
depends_on:
- postgres
- redis
env_file: .env
Celery workers handle background tasks (such file imports or federation
messaging). The more processes a worker gets, the more tasks
can be processed in parallel. However, more processes also means
a bigger memory footprint.
By default, a worker will span a number of process equal to your number
of CPUs. You can adjust this, by explicitly setting the --concurrency
flag:
celery -A funkwhale_api.taskapp worker -l INFO --concurrency=4
command:
- celery
- --app=funkwhale_api.taskapp
- worker
- --loglevel=INFO
- --concurrency=${CELERYD_CONCURRENCY-0}
environment:
- C_FORCE_ROOT=true
volumes:
- ${MUSIC_DIRECTORY_SERVE_PATH}:/music:ro
- ${MEDIA_ROOT}:/srv/funkwhale/data/media
celerybeat:
restart: unless-stopped
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
command:
- celery
- --app=funkwhale_api.taskapp
- beat
- --loglevel=INFO
depends_on:
- postgres
- redis
env_file: .env
api:
restart: unless-stopped
image: funkwhale/api:${FUNKWHALE_VERSION:-latest}
depends_on:
- postgres
- redis
env_file: .env
volumes:
- ${MUSIC_DIRECTORY_SERVE_PATH}:/music:ro
- ${MEDIA_ROOT}:/srv/funkwhale/data/media
- ${STATIC_ROOT}:/srv/funkwhale/data/static
front:
restart: unless-stopped
image: funkwhale/front:${FUNKWHALE_VERSION:-latest}
depends_on:
- api
env_file:
- .env
environment:
Override those variables in your .env file if needed
- NGINX_MAX_BODY_SIZE=${NGINX_MAX_BODY_SIZE-100M}
volumes:
Uncomment if you want to use your previous nginx config, please let us
know what special configuration you need, so we can support it with out
upstream nginx configuration!
#- "./nginx/funkwhale.template:/etc/nginx/templates/default.conf.template:ro"
#- "./nginx/funkwhale_proxy.conf:/etc/nginx/funkwhale_proxy.conf:ro"
- ${MUSIC_DIRECTORY_SERVE_PATH}:/music:ro
- ${MEDIA_ROOT}:/srv/funkwhale/data/media:ro
- ${STATIC_ROOT}:/usr/share/nginx/html/staticfiles:ro
ports:
# override those variables in your .env file if needed
- ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80
typesense:
restart: unless-stopped
env_file:
- .env
image: typesense/typesense:0.24.0
volumes:
- ${TYPESENSE_DATA_DIR}:/data
command: --data-dir /data --enable-cors
profiles:
- typesense
networks: {}
`
FUNKWHALE_VERSION=latest
FUNKWHALE_API_IP=<SERVER_IP>
FUNKWHALE_API_PORT=5002
FUNKWHALE_WEB_WORKERS=4
FUNKWHALE_HOSTNAME=<Server_IP>
FUNKWHALE_PROTOCOL=http
LOGLEVEL=error
REVERSE_PROXY_TYPE=nginx
MEDIA_ROOT=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Config/Config/funkwhale/data/media
STATIC_ROOT=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Config/Config/funkwhale/static
DJANGO_SETTINGS_MODULE=config.settings.production
DJANGO_SECRET_KEY=<Secret_KEY>
MUSIC_DIRECTORY_PATH=/music
MUSIC_DIRECTORY_SERVE_PATH=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Media/Music
FUNKWHALE_FRONTEND_PATH=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Media/Music
NGINX_MAX_BODY_SIZE=100M
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_STORAGE_BUCKET_NAME=
POSTGRES_DATA_DIR=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Config/Config/funkwhale/data/postgres
REDIS_DATA_DIR=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Config/Config/funkwhale/data/redis
TYPESENSE_DATA_DIR=/srv/dev-disk-by-uuid-058495e8-6106-4b49-aaf9-3690dd874cbc/Config/Config/funkwhale/data/typesense