From c3bda963abcf5d2bd93f1ad40a07fce715154f5f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 2 Aug 2026 09:08:22 +0300 Subject: shuriken-sync: guard rsync --delete with NFS sentinel (review fix) Without an nfs-check initContainer, a run scheduled while NFS is unmounted on the node would see an empty/stale /data source and rsync --delete would wipe the live public site on fishfinger/blowfish. Mirror the generation CronJob's sentinel guard (refuse to start if /mnt/shuriken.sh/.nfs-sentinel is missing). Also run the publish script under /bin/bash for reliable pipefail (ash's is version-gated). --- f3s/shuriken/helm-chart/templates/sync-cronjob.yaml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml b/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml index f3155c6..b24c090 100644 --- a/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml +++ b/f3s/shuriken/helm-chart/templates/sync-cronjob.yaml @@ -35,11 +35,28 @@ spec: template: spec: restartPolicy: Never + initContainers: + - name: nfs-check + image: busybox:stable + command: + - sh + - -c + - | + test -f /mnt/shuriken.sh/.nfs-sentinel || ( + echo "ERROR: NFS sentinel missing at /mnt/shuriken.sh/.nfs-sentinel" + echo "refusing to publish; NFS likely unmounted on this node" + echo "rsync --delete against an empty/stale source would wipe the live site" + exit 1 + ) + volumeMounts: + - name: data + mountPath: /mnt + readOnly: true containers: - name: shuriken-sync image: registry.lan.buetow.org:30001/shuriken:0.13.2 imagePullPolicy: Always - command: ["/bin/sh", "-c"] + command: ["/bin/bash", "-c"] args: - | set -euo pipefail -- cgit v1.2.3