From d573554fbb1d1275be0ce5302ffb334d9bcc511e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 1 Jul 2026 12:00:09 +0300 Subject: jellyfin: self-heal setup-wizard flag via initContainer Adds ensure-wizard-completed initContainer after nfs-check-config. If jellyfin.db already exists but IsStartupWizardCompleted flipped to false (interrupted wizard run or partial config restore), restore it to true so a working instance never drops back into the setup wizard. Fresh installs (no jellyfin.db) keep their legitimate first-run wizard. Runs after the sentinel check so config is only rewritten on the real NFS volume. --- f3s/jellyfin/helm-chart/templates/deployment.yaml | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/f3s/jellyfin/helm-chart/templates/deployment.yaml b/f3s/jellyfin/helm-chart/templates/deployment.yaml index 5bc48cd..72340f7 100644 --- a/f3s/jellyfin/helm-chart/templates/deployment.yaml +++ b/f3s/jellyfin/helm-chart/templates/deployment.yaml @@ -34,6 +34,31 @@ spec: - name: jellyfin-config mountPath: /mnt readOnly: true + # Self-heal the setup-wizard flag. Runs only after nfs-check-config has + # proven /config is the real NFS directory (not a local-XFS shadow), so + # we never rewrite config on the wrong volume. If the DB already exists + # (server was set up) but IsStartupWizardCompleted flipped to false + # (e.g. an interrupted wizard run or partial config restore), restore it + # to true so a working instance never drops back into the setup wizard. + # A genuine fresh install has no jellyfin.db yet, so its first-run wizard + # is left untouched. + - name: ensure-wizard-completed + image: busybox:stable + command: + - sh + - -c + - | + cfg=/config/config/system.xml + if [ -f /config/data/jellyfin.db ] && \ + grep -q "false" "$cfg" 2>/dev/null; then + echo "existing jellyfin.db present but setup-wizard flag was false; restoring to true" + sed -i 's#false#true#' "$cfg" + else + echo "no action: fresh install (no jellyfin.db) or wizard flag already true" + fi + volumeMounts: + - name: jellyfin-config + mountPath: /config - name: nfs-check-libraries image: busybox:stable command: -- cgit v1.2.3