From 7399f869858866e56daefef80b1b891b0c4d21f3 Mon Sep 17 00:00:00 2001 From: Jon Pascoe Date: Sun, 10 May 2026 15:16:52 +0100 Subject: [PATCH] Soft-fail chown during container init setPermissions calls ChownFolderRecursive on /app and /config and log.Fatal's on any error. On filesystems where root cannot chown arbitrary files (notably NFS exports with root_squash, common on Kubernetes-backed home labs and NAS-backed clusters), this prevents the supervisor from starting even though /config is typically already writable to the application. Log a warning and continue instead. The chown is a best-effort permissions tighten-up; nginx/php-fpm only need to be able to write inside /config/data, which is satisfied by the volume's existing mode regardless of ownership. --- supervisor/fileinit/fileinit.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/supervisor/fileinit/fileinit.go b/supervisor/fileinit/fileinit.go index 29f0086..e23c0fe 100644 --- a/supervisor/fileinit/fileinit.go +++ b/supervisor/fileinit/fileinit.go @@ -23,10 +23,12 @@ func initPaths() { } func setPermissions() { - err := osutils.ChownFolderRecursive("/app", "barcodebuddy") - check(err) - err = osutils.ChownFolderRecursive("/config", "barcodebuddy") - check(err) + if err := osutils.ChownFolderRecursive("/app", "barcodebuddy"); err != nil { + log.Printf("Warning: chown /app failed: %v (continuing)", err) + } + if err := osutils.ChownFolderRecursive("/config", "barcodebuddy"); err != nil { + log.Printf("Warning: chown /config failed: %v (continuing)", err) + } fmt.Println("File permissions set") }