fix(deploy): restore www-data ownership after deploy-code to prevent HTTP 500

This commit is contained in:
Pontoporeia
2026-09-18 16:26:49 +02:00
parent 0e009c49d4
commit b1715b210d
4 changed files with 137 additions and 11 deletions
+13
View File
@@ -0,0 +1,13 @@
# Scoped passwordless sudo for the deploy permission-restore step.
#
# `just deploy-permissions` (and thereby `just deploy-code`) resyncs the app
# tree as the deploy SSH user, then runs `fix-permissions.sh` as root to
# restore www-data:xamxam ownership. Using an interactive remote pty for that
# sudo is fragile: `ssh -t` silently drops the pseudo-terminal when the local
# process stdin is not a TTY, so sudo's password prompt prints but cannot
# receive keystrokes. Because the script is fixed-path, takes no arguments and
# only touches /var/www/xamxam, it is safe to whitelist with NOPASSWD.
#
# Install via `just deploy-sudoers` (must be run interactively once as a
# password-lessed sudoer, or with root).
theophile ALL=(root) NOPASSWD: /bin/bash /tmp/fix-permissions.sh