scripts/deploy-prod: web-taugliche Rechte erzwingen (--chmod=D755,F644)
mktemp -d legt das Staging-Verzeichnis mit 0700 an; rsync -a uebertrug diesen Modus auf das Ziel-Verzeichnis, sodass der Webserver es nicht betreten konnte (Apache 403 "Server unable to read htaccess file, denying access to be safe" — die .htaccess-Suche selbst ist normal, der Zugriff scheiterte an den Rechten). Fix: rsync mit --chmod=D755,F644, unabhaengig von lokalen mktemp-/umask-Rechten. Lokal verifiziert: Ziel wird 755, Dateien 644 (auch wenn das Ziel vorher 700 war). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
18363d46c7
commit
483bd89d25
@@ -91,9 +91,14 @@ sed "${SED_ARGS[@]}" frontend/dist/index.html > "$STAGE/index.html"
|
|||||||
cp LICENSE "$STAGE/LICENSE"
|
cp LICENSE "$STAGE/LICENSE"
|
||||||
|
|
||||||
# ---- 3) Spiegeln (--delete: nichts Altes bleibt am Ziel) ----
|
# ---- 3) Spiegeln (--delete: nichts Altes bleibt am Ziel) ----
|
||||||
|
# --chmod=D755,F644 erzwingt web-taugliche Rechte am Ziel, unabhängig von den
|
||||||
|
# lokalen Rechten: `mktemp -d` legt $STAGE mit 0700 an, und `rsync -a` würde
|
||||||
|
# diesen Modus sonst auf das Ziel-Verzeichnis übertragen — dann kann der
|
||||||
|
# Webserver es nicht betreten (Apache 403 „unable to read htaccess file“).
|
||||||
|
RSYNC_OPTS=(-avz --delete --chmod=D755,F644)
|
||||||
if [ "$YES" -ne 1 ]; then
|
if [ "$YES" -ne 1 ]; then
|
||||||
echo "==> Vorschau (rsync --dry-run --delete) nach ${TARGET}:"
|
echo "==> Vorschau (rsync --dry-run --delete) nach ${TARGET}:"
|
||||||
rsync -avz --delete --dry-run "$STAGE"/ "$TARGET"
|
rsync "${RSYNC_OPTS[@]}" --dry-run "$STAGE"/ "$TARGET"
|
||||||
printf '==> Wirklich spiegeln? --delete löscht am Ziel alles Fremde. [y/N] '
|
printf '==> Wirklich spiegeln? --delete löscht am Ziel alles Fremde. [y/N] '
|
||||||
read -r ANS
|
read -r ANS
|
||||||
case "$ANS" in
|
case "$ANS" in
|
||||||
@@ -103,5 +108,5 @@ if [ "$YES" -ne 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> rsync -> ${TARGET}"
|
echo "==> rsync -> ${TARGET}"
|
||||||
rsync -avz --delete "$STAGE"/ "$TARGET"
|
rsync "${RSYNC_OPTS[@]}" "$STAGE"/ "$TARGET"
|
||||||
echo "==> Fertig."
|
echo "==> Fertig."
|
||||||
|
|||||||
Reference in New Issue
Block a user