Bake LDAP + SSO auth plugins into the image #8
Reference in New Issue
Block a user
Delete Branch "benvin/auth-plugins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Phase-1 plugin-based SSO / app-passwords for jellyfin: the server needs the LDAP-auth and SSO auth plugins present in the image rather than hand-installed via the in-app catalog, so the deployed version is reproducible and controlled by the image (the
/configplugins PVC would otherwise let catalog-installed versions drift).How
pluginsbuild stage that downloads, sha256-verifies (matching each release's published.sha256), and unpacks the plugin zips into versioned dirs baked at/usr/share/jellyfin/plugins-baked.targetAbiis<=the pinned Jellyfin server version (10.11.6):docker-entrypoint.shthat syncs the baked plugin dirs into/config/pluginson every start, removing any stale versioned dir of the same plugin first so the image owns the plugin version across restarts; user pluginconfigurations/are preserved.ENTRYPOINTat the new script (unchanged jellyfin args).Validation
pluginsstage locally — both zips download and passsha256sum -c(pins also match the manifest md5).LDAP Authentication_21.0.0.0+ aconfigurations/dir: stale dir replaced by 22.0.0.0, SSO 4.0.0.4 installed, configurations preserved.Release/tag comes after merge (per repo
make patchflow).Automated review — ISSUES found
CI is failing on head
2001204:ci/woodpecker/pr/build= failure (confirmed via Gitea commit-status, polled pending → running → failure). This contradicts the PR body's Validation section, which claims thepluginsstage builds and the entrypoint simulation both succeed locally — the pipeline's dry-run docker build does not currently pass for this diff. Please check the pipeline run and push a fix; not re-reviewing content correctness until this is green.For the record, everything I could verify independently on the content itself checks out clean:
sha256ARGs byte-for-byte. The SSO hash also matches GitHub's own computed asset digest, and the LDAP hash's md5 matches repo.jellyfin.org's manifest checksum.unzip -d "<Name>_<version>"produces the correctName_version/meta.json-at-root layout Jellyfin expects.sha256sum -c -runs underset -euwith no error-swallowing, so a checksum mismatch aborts the build stage.docker-entrypoint.shagainst an adversarial seed (staleLDAP Authentication_21.0.0.0, a decoyLDAP Authentication Helper_1.0.0.0, aconfigurations/dir with user XML, and an already-current SSO dir). Stale version was removed, the decoy andconfigurations/were untouched, SSO refreshed idempotently, and"$@"pass-through toexec ./jellyfinwas preserved. The"$PLUGIN_DIR/$base"_*glob only matches paths starting with the exact plugin name plus a literal underscore, so it can't collide with same-prefix names.cp -aas non-root uid 1000 (matching the StatefulSet'srunAsUser: 1000/fsGroup: 1000) copying root-owned source into the uid-1000-owned/config— GNUcp -adegrades gracefully (exit 0, files end up owned by the invoking uid), no crash underset -eu.CMD; the StatefulSet sets neithercommand:norargs:for the jellyfin container, so the new script'sexec ./jellyfin ... "$@"reproduces the prior fixed invocation exactly — no risk to either HA replica from arg handling.Once CI is green this looks mergeable from a content standpoint.
CI root cause + fix: the
ci/woodpecker/pr/buildfailure was in the new plugins stage. The CI build network reaches artifactapi and package mirrors (repo.jellyfin.org, so LDAP downloads fine) but cannot reach github.com directly, so the SSO plugin download failed withcurl: (7) Failed to connect to github.com port 443. Reproduced locally by blackholing github: LDAP succeeds, SSO fails, exactly matching CI.Fix (
72290bb): route the SSO fetch through the artifactapi github remote proxy instead of github.com.SSO_SHA256still pins the exact bytes (the proxy is a transparent byte proxy - verified an allowlisted asset has an identical sha256 via proxy vs direct github). LDAP is unchanged.Cross-repo dependency: the github proxy rejects non-allowlisted paths (403), so this needs terraform-artifactapi#40 (allowlist
9p4/jellyfin-plugin-sso/*/sso-authentication_*.zip) merged + applied first. Until then this build will still fail at the SSO step with a 403.