Files
funkwhale-oidc/tests/compose.yaml
T
claudeandClaude Opus 5.5 b8978221a3 Option to turn off local login (FUNKWHALE_OIDC_LOCAL_LOGIN)
With it false, a middleware rejects password login, sign-up and password
reset/change in the API, allauth's pages and the Django admin, and the
web app shows only the provider button. /login and /signup go straight
to the provider, and the post-login redirect never points back at them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:41:28 -05:00

97 lines
3.7 KiB
YAML

# End-to-end test: Funkwhale 2.0.13 + this plugin + a throwaway Dex.
# docker compose -f tests/compose.yaml up -d
# open http://funkwhale.localhost/login (admin@example.com / password)
# docker compose -f tests/compose.yaml down -v
name: funkwhale-oidc-test
x-api: &api
image: docker.io/funkwhale/api:${FUNKWHALE_VERSION:-2.0.13}
depends_on:
postgres: {condition: service_started}
redis: {condition: service_started}
plugins: {condition: service_completed_successfully}
extra_hosts: ["dex.localhost:host-gateway"]
volumes:
- plugins:/srv/funkwhale/plugins:ro
- media:/srv/funkwhale/data/media
- static:/srv/funkwhale/data/static
environment: &env
FUNKWHALE_HOSTNAME: funkwhale.localhost
FUNKWHALE_PROTOCOL: http
FUNKWHALE_API_PORT: "5000"
FUNKWHALE_SPA_HTML_ROOT: http://front/
DJANGO_SECRET_KEY: test-only-secret-key-test-only-secret-key
DATABASE_URL: postgresql://funkwhale:funkwhale@postgres:5432/funkwhale
CACHE_URL: redis://redis:6379/0
MEDIA_ROOT: /srv/funkwhale/data/media
STATIC_ROOT: /srv/funkwhale/data/static
MUSIC_DIRECTORY_PATH: /music
FUNKWHALE_PLUGINS: funkwhale_oidc
FUNKWHALE_OIDC_SERVER_URL: http://dex.localhost:5556/dex
FUNKWHALE_OIDC_CLIENT_ID: funkwhale
FUNKWHALE_OIDC_CLIENT_SECRET: test-secret
FUNKWHALE_OIDC_PROVIDER_ID: dex
FUNKWHALE_OIDC_NAME: Dex
FUNKWHALE_OIDC_ADMIN_USERS: alice
FUNKWHALE_OIDC_LINK_BY_EMAIL: "true"
FUNKWHALE_OIDC_LOCAL_LOGIN: ${LOCAL_LOGIN:-true}
services:
postgres:
image: postgres:17.11-alpine
environment: {POSTGRES_USER: funkwhale, POSTGRES_PASSWORD: funkwhale, POSTGRES_DB: funkwhale}
redis:
image: redis:7-alpine
dex:
image: ghcr.io/dexidp/dex:v2.44.0
command: [dex, serve, /etc/dex/config.yaml]
ports: ["5556:5556"]
volumes: ["./dex.yaml:/etc/dex/config.yaml:ro"]
# Same as the Kubernetes init container: pip-install the plugin and
# PyJWT into FUNKWHALE_PLUGINS_PATH, which Funkwhale puts on sys.path.
plugins:
image: docker.io/funkwhale/api:${FUNKWHALE_VERSION:-2.0.13}
entrypoint: [sh, -c]
command: ["cp -r /src /tmp/src && pip install --no-cache-dir --no-compile --upgrade --target /plugins /tmp/src"]
volumes: ["..:/src:ro", "plugins:/plugins"]
restart: "no"
migrate:
<<: *api
command: sh -c "funkwhale-manage migrate && funkwhale-manage collectstatic --noinput"
restart: "no"
api:
<<: *api
command: gunicorn
depends_on:
migrate: {condition: service_completed_successfully}
celeryworker:
<<: *api
command: celery --app=funkwhale_api.taskapp worker --loglevel=INFO --concurrency=1
environment: {<<: *env, C_FORCE_ROOT: "true"}
depends_on:
migrate: {condition: service_completed_successfully}
front:
image: docker.io/funkwhale/front:${FUNKWHALE_VERSION:-2.0.13}
depends_on: [api]
ports: ["80:80"]
environment:
FUNKWHALE_API_HOST: api
FUNKWHALE_API_PORT: "5000"
FUNKWHALE_HOSTNAME: funkwhale.localhost
FUNKWHALE_PROTOCOL: http
NGINX_MAX_BODY_SIZE: 100M
MEDIA_ROOT: /srv/funkwhale/data/media
MUSIC_DIRECTORY_PATH: /music
FUNKWHALE_OIDC_PROVIDER_ID: dex
FUNKWHALE_OIDC_NAME: Dex
FUNKWHALE_OIDC_AUTO_REDIRECT: "false"
FUNKWHALE_OIDC_LOCAL_LOGIN: ${LOCAL_LOGIN:-true}
volumes:
- ../funkwhale_oidc/front/inject.sh:/docker-entrypoint.d/98-funkwhale-oidc.sh:ro
- ../funkwhale_oidc/front/oidc-login.js:/usr/share/nginx/html/oidc/oidc-login.js:ro
- ../funkwhale_oidc/front/oidc-login.css:/usr/share/nginx/html/oidc/oidc-login.css:ro
- media:/srv/funkwhale/data/media:ro
- static:/usr/share/nginx/html/staticfiles:ro
volumes:
plugins:
media:
static: