Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c88e6d76c8 | |||
| e6e847598a | |||
| f150d915f5 | |||
| b43e10f752 | |||
| c4d4dd75a7 | |||
| 521ef065ca | |||
| e103b57e97 | |||
| e0a195179b | |||
| 64b6c01e91 | |||
| c8960dbe82 | |||
| 8631c39979 | |||
| f7ea7675cb | |||
| 2924cbb63d | |||
| 26d399b8d5 | |||
| ac61265ea0 | |||
| 72290bbacd | |||
| 2001204e0b |
@@ -5,7 +5,7 @@ steps:
|
|||||||
# Clone the pinned upstream jellyfin-ha source and publish the .NET server
|
# Clone the pinned upstream jellyfin-ha source and publish the .NET server
|
||||||
# into ./publish-output (consumed by Dockerfile.runtime).
|
# into ./publish-output (consumed by Dockerfile.runtime).
|
||||||
- name: publish
|
- name: publish
|
||||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
REF=$$(cat UPSTREAM_REF)
|
REF=$$(cat UPSTREAM_REF)
|
||||||
@@ -26,7 +26,7 @@ steps:
|
|||||||
|
|
||||||
# Validate the runtime image builds (no push on PRs).
|
# Validate the runtime image builds (no push on PRs).
|
||||||
- name: docker-build
|
- name: docker-build
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/plugin-docker-buildx:latest
|
||||||
settings:
|
settings:
|
||||||
repo: artifactapi.k8s.syd1.au.unkin.net/docker-internal/jellyfin-ha
|
repo: artifactapi.k8s.syd1.au.unkin.net/docker-internal/jellyfin-ha
|
||||||
dockerfile: Dockerfile.runtime
|
dockerfile: Dockerfile.runtime
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ when:
|
|||||||
steps:
|
steps:
|
||||||
# Same publish step as the PR pipeline: clone pinned upstream + dotnet publish.
|
# Same publish step as the PR pipeline: clone pinned upstream + dotnet publish.
|
||||||
- name: publish
|
- name: publish
|
||||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
commands:
|
commands:
|
||||||
- |
|
- |
|
||||||
REF=$$(cat UPSTREAM_REF)
|
REF=$$(cat UPSTREAM_REF)
|
||||||
|
|||||||
+44
-9
@@ -18,14 +18,49 @@ RUN apt-get update \
|
|||||||
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/jellyfin.gpg] https://repo.jellyfin.org/debian bookworm main" \
|
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/jellyfin.gpg] https://repo.jellyfin.org/debian bookworm main" \
|
||||||
> /etc/apt/sources.list.d/jellyfin.list \
|
> /etc/apt/sources.list.d/jellyfin.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends "jellyfin-web=10.11.6+deb12" \
|
&& apt-get install -y --no-install-recommends "jellyfin-web=12.0+deb12" \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# ── Plugin stage ──────────────────────────────────────────────────────────────
|
||||||
|
# Download and verify the auth plugins, unpacked into versioned dirs baked into
|
||||||
|
# the image and synced into /config/plugins at start (docker-entrypoint.sh).
|
||||||
|
# Versions are the newest each plugin publishes whose targetAbi <= the pinned
|
||||||
|
# Jellyfin server version (12.0.0):
|
||||||
|
# LDAP Authentication 24.0.0.0 targetAbi 12.0.0.0
|
||||||
|
# SSO Authentication 5.0.0.0 targetAbi 12.0.0.0
|
||||||
|
# sha256 pins make each fetch reproducible.
|
||||||
|
FROM --platform=linux/amd64 debian:bookworm-slim AS plugins
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends curl ca-certificates unzip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ARG LDAP_URL=http://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/jellyfin/files/plugin/ldap-authentication/ldap-authentication_24.0.0.0.zip
|
||||||
|
ARG LDAP_SHA256=3be1f9d6a6ce9ea375e556dd30136d178a8dbe35cbe866d30d3451dc3ff7e804
|
||||||
|
# Both are served through artifactapi remotes over http: this stage's base image
|
||||||
|
# trusts only public CAs and artifactapi presents an internal-CA certificate, so
|
||||||
|
# https here fails to verify. The sha256 pins below supply the integrity guarantee.
|
||||||
|
# SSO is the in-house unkin fork (valkey-backed OAuth state, shared across replicas).
|
||||||
|
ARG SSO_URL=http://artifactapi.k8s.syd1.au.unkin.net/api/v2/remotes/jellyfin-plugins/files/unkin/jellyfin-plugin-sso/5.0.0.0/sso-authentication_5.0.0.0.zip
|
||||||
|
ARG SSO_SHA256=7e5f09cc4c81dce35edca650d74ed0680f425ca65c6221bb75456de9b8557e14
|
||||||
|
|
||||||
|
WORKDIR /plugins
|
||||||
|
RUN set -eu; \
|
||||||
|
curl -fsSL "$LDAP_URL" -o ldap.zip; \
|
||||||
|
echo "$LDAP_SHA256 ldap.zip" | sha256sum -c -; \
|
||||||
|
mkdir -p "LDAP Authentication_24.0.0.0"; \
|
||||||
|
unzip -oq ldap.zip -d "LDAP Authentication_24.0.0.0"; \
|
||||||
|
curl -fsSL "$SSO_URL" -o sso.zip; \
|
||||||
|
echo "$SSO_SHA256 sso.zip" | sha256sum -c -; \
|
||||||
|
mkdir -p "SSO Authentication_5.0.0.0"; \
|
||||||
|
unzip -oq sso.zip -d "SSO Authentication_5.0.0.0"; \
|
||||||
|
rm -f ldap.zip sso.zip
|
||||||
|
|
||||||
# ── Runtime stage ─────────────────────────────────────────────────────────────
|
# ── Runtime stage ─────────────────────────────────────────────────────────────
|
||||||
# .NET 9 runtime: matches the SDK 9.0 publish step (framework-dependent), so the
|
# .NET 10 runtime: matches the SDK 10.0 publish step (framework-dependent) and the
|
||||||
# app's required Microsoft.NETCore.App 9.0 is present. Keep in lockstep with the
|
# fork's net10.0 TFM, so the app's required Microsoft.NETCore.App 10.0 is present.
|
||||||
# `mcr.microsoft.com/dotnet/sdk` major in .woodpecker/*.yaml and the Makefile.
|
# Keep in lockstep with the `mcr.microsoft.com/dotnet/sdk` major in .woodpecker/*.yaml.
|
||||||
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:9.0
|
FROM --platform=linux/amd64 mcr.microsoft.com/dotnet/aspnet:10.0
|
||||||
|
|
||||||
# FFmpeg and the native deps required by SkiaSharp and fontconfig.
|
# FFmpeg and the native deps required by SkiaSharp and fontconfig.
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
@@ -42,6 +77,9 @@ WORKDIR /jellyfin
|
|||||||
COPY publish-output/ .
|
COPY publish-output/ .
|
||||||
# jellyfin-web client assets from the webclient stage.
|
# jellyfin-web client assets from the webclient stage.
|
||||||
COPY --from=webclient /usr/share/jellyfin/web ./jellyfin-web/
|
COPY --from=webclient /usr/share/jellyfin/web ./jellyfin-web/
|
||||||
|
# Baked auth plugins; docker-entrypoint.sh syncs these into /config/plugins.
|
||||||
|
COPY --from=plugins /plugins /usr/share/jellyfin/plugins-baked
|
||||||
|
COPY --chmod=0755 docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||||
|
|
||||||
# Jellyfin default ports
|
# Jellyfin default ports
|
||||||
EXPOSE 8096
|
EXPOSE 8096
|
||||||
@@ -54,7 +92,4 @@ ENV JELLYFIN_DATA_DIR=/config \
|
|||||||
JELLYFIN_CACHE_DIR=/cache \
|
JELLYFIN_CACHE_DIR=/cache \
|
||||||
JELLYFIN_LOG_DIR=/config/log
|
JELLYFIN_LOG_DIR=/config/log
|
||||||
|
|
||||||
ENTRYPOINT ["./jellyfin", \
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||||
"--datadir", "/config", \
|
|
||||||
"--cachedir", "/cache", \
|
|
||||||
"--webdir", "/jellyfin/jellyfin-web"]
|
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ Build-orchestration repo for [ZoltyMat/jellyfin-ha](https://github.com/ZoltyMat/
|
|||||||
that adds distributed, Redis-backed transcoding for multi-pod Kubernetes (lease-aware cleanup, HA session
|
that adds distributed, Redis-backed transcoding for multi-pod Kubernetes (lease-aware cleanup, HA session
|
||||||
takeover, optional PostgreSQL).
|
takeover, optional PostgreSQL).
|
||||||
|
|
||||||
This repo does **not** vendor the fork's source. It pins an upstream commit, builds the .NET 9 server, and
|
This repo does **not** vendor the fork's source. It pins an upstream commit, builds the .NET 10 server, and
|
||||||
produces a runtime container image pushed to the Gitea registry.
|
produces a runtime container image pushed to the Gitea registry.
|
||||||
|
|
||||||
## What it produces
|
## What it produces
|
||||||
|
|
||||||
`artifactapi.k8s.syd1.au.unkin.net/docker-internal/jellyfin-ha:<tag>` — an `mcr.microsoft.com/dotnet/aspnet:9.0` based image with ffmpeg and
|
`artifactapi.k8s.syd1.au.unkin.net/docker-internal/jellyfin-ha:<tag>` — an `mcr.microsoft.com/dotnet/aspnet:10.0` based image with ffmpeg and
|
||||||
the prebuilt `jellyfin-web` client, running the published `jellyfin-ha` server.
|
the prebuilt `jellyfin-web` client, running the published `jellyfin-ha` server.
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
@@ -34,7 +34,7 @@ the prebuilt `jellyfin-web` client, running the published `jellyfin-ha` server.
|
|||||||
make build # clones pinned upstream, dotnet publish, docker build
|
make build # clones pinned upstream, dotnet publish, docker build
|
||||||
```
|
```
|
||||||
|
|
||||||
Requires the .NET 9 SDK and Docker. `make publish` runs just the clone + publish into `./publish-output`.
|
Requires the .NET 10 SDK and Docker. `make publish` runs just the clone + publish into `./publish-output`.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2e1e445e470c2f2c1520f66678a73faa226c2058
|
6691b785c30715ec4561b00b7bd0fd112478d3e3
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Sync image-baked plugins into the /config (datadir) plugins directory on
|
||||||
|
# start. /config is an RWX volume shared across replicas, so plugins baked
|
||||||
|
# into the image are invisible until copied in here -- and this must be safe
|
||||||
|
# when several replicas start (or restart) at the same instant:
|
||||||
|
# - skip entirely once the correct version is already in place, so the
|
||||||
|
# steady state (almost every start) never touches the shared volume;
|
||||||
|
# - install a new/changed version via copy-to-staging + atomic rename, so
|
||||||
|
# no reader (another replica, or this container's own jellyfin process)
|
||||||
|
# ever observes a partially-written plugin directory. A replica that
|
||||||
|
# loses the rename race just discards its own copy -- that's success,
|
||||||
|
# not an error;
|
||||||
|
# - drop stale, differently-versioned copies of the same plugin afterwards
|
||||||
|
# so they don't shadow the current one. Best-effort: another replica may
|
||||||
|
# already be doing, or have finished, the same cleanup.
|
||||||
|
# Deliberately no locking: a lock held by a replica that dies mid-sync would
|
||||||
|
# wedge every future start on this volume, which is worse than the race it
|
||||||
|
# would prevent.
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
BAKED_DIR=/usr/share/jellyfin/plugins-baked
|
||||||
|
PLUGIN_DIR=/config/plugins
|
||||||
|
STAGING_DIR="$PLUGIN_DIR/.sync-tmp"
|
||||||
|
REPLICA=$(hostname)
|
||||||
|
|
||||||
|
if [ -d "$BAKED_DIR" ]; then
|
||||||
|
mkdir -p "$PLUGIN_DIR" "$STAGING_DIR"
|
||||||
|
for src in "$BAKED_DIR"/*; do
|
||||||
|
[ -d "$src" ] || continue
|
||||||
|
name=$(basename "$src") # e.g. "LDAP Authentication_24.0.0.0"
|
||||||
|
base=${name%_*} # plugin name without the trailing _<version>
|
||||||
|
target="$PLUGIN_DIR/$name"
|
||||||
|
|
||||||
|
if [ ! -d "$target" ]; then
|
||||||
|
# Build the new version privately (keyed by this replica's own
|
||||||
|
# hostname, so concurrent replicas never share a staging path), then
|
||||||
|
# move it into place in one atomic rename. mv -T fails with
|
||||||
|
# "Directory not empty" if another replica's rename already won --
|
||||||
|
# that's fine, our copy just becomes garbage we discard.
|
||||||
|
staging="$STAGING_DIR/$REPLICA.$name"
|
||||||
|
rm -rf "$staging"
|
||||||
|
cp -a "$src" "$staging"
|
||||||
|
if mv_err=$(mv -T "$staging" "$target" 2>&1); then
|
||||||
|
:
|
||||||
|
elif [ -d "$target" ]; then
|
||||||
|
rm -rf "$staging"
|
||||||
|
else
|
||||||
|
echo "docker-entrypoint: failed to install plugin $name: $mv_err" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove any other version of this plugin so it can't shadow the one
|
||||||
|
# above. Another replica may be racing the same cleanup, or have already
|
||||||
|
# finished it -- an entry that's already gone is success, not an error.
|
||||||
|
for existing in "$PLUGIN_DIR/$base"_*; do
|
||||||
|
[ -e "$existing" ] || continue
|
||||||
|
[ "$existing" = "$target" ] && continue
|
||||||
|
rm -rf "$existing" 2>/dev/null || true
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ./jellyfin \
|
||||||
|
--datadir /config \
|
||||||
|
--cachedir /cache \
|
||||||
|
--webdir /jellyfin/jellyfin-web \
|
||||||
|
"$@"
|
||||||
Reference in New Issue
Block a user