tubearchivist/backend
SystemZ c2594b89b9 Add OIDC SSO login via mozilla-django-oidc
Adds native OpenID Connect login alongside the existing LDAP and
forward-auth modes. Two new TA_LOGIN_AUTH_MODE values: oidc (SSO only)
and oidc_local (SSO + local break-glass), mirroring ldap/ldap_local.

TAOIDCBackend maps OIDC claims onto the Account model (USERNAME_FIELD is
name) and promotes staff/superuser from a configurable group claim, like
the LDAP backend. The redirect_uri is anchored to TA_HOST so it stays
correct behind nginx and a TLS-terminating proxy; PKCE and audience
verification are on. The login page gains a "Log in with SSO" button
driven by a public /api/user/oidc/ endpoint, hidden in oidc-only mode.
API token auth is unaffected.

Configured entirely via TA_OIDC_* env vars. Tested against Authentik.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 19:29:24 +02:00
..
appsettings fix cleanup old appsettings keys 2026-03-01 14:23:17 +07:00
channel fix channel search 404 error response 2026-05-13 22:43:50 +07:00
common bump dependencies 2026-04-11 12:27:43 +07:00
config Add OIDC SSO login via mozilla-django-oidc 2026-06-20 19:29:24 +02:00
download switch to forked pot plugin with disable flag, #1156 2026-05-16 13:22:16 +07:00
playlist handle video delete from playlist fialure 2026-02-28 11:49:00 +07:00
stats limit log to debug only 2025-11-15 11:08:33 +07:00
task remove redundant thumbnail embed task 2025-12-28 11:44:52 +07:00
user Add OIDC SSO login via mozilla-django-oidc 2026-06-20 19:29:24 +02:00
video fix: handle empty description for mutagen, #1124 2026-02-28 17:46:39 +07:00
README.md add django app overview readme 2024-08-10 16:12:06 +02:00
manage.py bump dependencies 2026-04-11 12:27:43 +07:00
requirements.txt Add OIDC SSO login via mozilla-django-oidc 2026-06-20 19:29:24 +02:00

README.md

Django Setup

Apps

The backend is split up into the following apps.

config

Root Django App. Doesn't define any views.

  • Has main settings.py
  • Has main urls.py responsible for routing to other apps

common

Functionality shared between apps.

Defines views on the root /api/* path. Has base views to inherit from.

  • Connections to ES and Redis
  • Searching
  • URL parser
  • Collection of helper functions

appsettings

Responsible for functionality from the settings pages.

Defines views at /api/appsettings/*.

  • Index setup
  • Reindexing
  • Snapshots
  • Filesystem Scan
  • Manual import

channel

Responsible for Channel Indexing functionality.

Defines views at /api/channel/* path.

download

Implements download functionality with yt-dlp.

Defines views at /api/download/*.

  • Download videos
  • Queue management
  • Thumbnails
  • Subscriptions

playlist

Implements playlist functionality.

Defines views at /api/playlist/*.

  • Index Playlists
  • Manual Playlists

stats

Builds aggregations views for the statistics dashboard.

Defines views at /api/stats/*.

task

Defines tasks for Celery.

Defines views at /api/task/*.

  • Has main tasks.py with all shared_task definitions
  • Has CustomPeriodicTask model
  • Implements apprise notifications links
  • Implements schedule functionality

user

Implements user and auth functionality.

Defines views at /api/config/*.

  • Defines custom Account model

video

Index functionality for videos.

Defines views at /api/video/*.

  • Index videos
  • Index comments
  • Index/download subtitles
  • Media stream parsing