media-backend/media-webui: proxy admin login identity to AuthGuard

The media-collection family (KioskDisplay, MediaAnalyzer, MediaTools,
MediaViewer, MediaServant, ModerationHub, ProjectConfigurator) shared one
standalone local single-admin auth implementation with no AuthGuard
connection, including its own local "reset admin account" flow - the same
situation the recently-migrated forks were in. Proxies every /auth/... and
/api/auth/... admin-identity operation to AuthGuard via the existing Go
authclient, forwards its Set-Cookie, keeps a local one-time setup-claim flag
(reusing the existing settings table, no schema change), and drops the local
reset flow entirely (only AuthGuard's own web UI keeps one now).

Deliberately left untouched: the separate "moderator manages platform
users" surface (admin_storage.go's mountModeratorRoutes) and the
independent loginRequired/auth_required public-install toggle, both of
which are unrelated to this service's own admin login identity despite
superficially sharing code style/table with the migrated pieces.
This commit is contained in:
Gabriel20xx committed 2026-09-02 21:45:19 +02:00
1 parent de9b599232
commit 9589d07baf
7 files changed
+1055 -560

No files matched your search

+6
View File
@@ -39,6 +39,11 @@ type Config struct {
PublicURL string
SessionCookie string
SecureCookies bool
// AuthGuardURL is AuthGuard's base URL (see Web/Central/AuthGuard);
// empty means auth-disabled mode (see internal/auth's package doc
// comment). Read raw via os.Getenv rather than envOr since "" is a
// meaningful, distinct value here (not a fallback-worthy blank).
AuthGuardURL string
InternalServiceSecret string
FFmpeg string
FFprobe string
@@ -94,6 +99,7 @@ func Load() (*Config, error) {
PublicURL: strings.TrimRight(strings.TrimSpace(os.Getenv("PUBLIC_URL")), "/"),
SessionCookie: envOr("SESSION_COOKIE", "mediacollection_session"),
SecureCookies: envBool("COOKIE_SECURE", os.Getenv("TLS_CERT_FILE") != ""),
AuthGuardURL: strings.TrimSpace(os.Getenv("AUTHGUARD_URL")),
InternalServiceSecret: strings.TrimSpace(os.Getenv("INTERNAL_SERVICE_SECRET")),
FFmpeg: envOr("FFMPEG_PATH", "ffmpeg"),
FFprobe: envOr("FFPROBE_PATH", "ffprobe"),