#!/bin/bash # ============================================================================= # VITEC — fix backend asset permissions after a deploy via the Windows sshfs mount # ----------------------------------------------------------------------------- # sshfs-win (WinFsp) writes newly deployed files with mode 770 (no other-read). # The webserver runs as "other" (suexec) -> assets under Resources/Public and # public/_assets return HTTP 403 (backend icons / CSS / JS missing). # # chmod OVER the Windows mount does NOT change the real server mode, so this # has to run ON THE SERVER, via real SSH, as the site owner (vitecevo). # # Usage (from the live/ project root on the server): # bash fix-asset-perms.sh # ============================================================================= set -u cd "$(dirname "$0")" || exit 1 echo "[perms] Project root: $(pwd)" # public/fileadmin as a whole, not just icons: every editorial upload and every # importer output lands there (success_stories_import, blog-import, downloads, # user_upload/products ...) and hits the same 403 otherwise. Found 2026-09-11, # when the imported success-story images stayed invisible in the megamenu. TARGETS="public/_assets public/fileadmin packages/vitec/Resources/Public" echo "[perms] Setting files 644 / directories 755 under $TARGETS ..." find $TARGETS -type f -exec chmod 644 {} \; 2>/dev/null find $TARGETS -type d -exec chmod 755 {} \; 2>/dev/null echo "[perms] Flushing TYPO3 caches ..." if [ -x vendor/bin/typo3 ]; then vendor/bin/typo3 cache:flush else echo "[perms] (vendor/bin/typo3 not found — skip cache flush)" fi echo "[perms] Done."