fix: права www-data после git pull и npm install

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
shop
2026-05-17 14:48:33 +03:00
parent db6ab9a701
commit 7cb61d4242
5 changed files with 61 additions and 2 deletions
+14 -1
View File
@@ -10,6 +10,7 @@ source "$SCRIPT_DIR/shop-root.sh"
PORT="${PORT:-3000}"
REPO_OWNER="${SHOP_GIT_USER:-$(stat -c '%U' "$SHOP_ROOT/.git" 2>/dev/null || stat -c '%U' "$SHOP_ROOT" 2>/dev/null || echo root)}"
SHOP_SERVICE_USER="${SHOP_SERVICE_USER:-www-data}"
ensure_git_safe() {
local user="$1"
@@ -52,7 +53,19 @@ run_as_owner "bash scripts/git-sync.sh"
echo ""
echo "--- npm install ---"
run_as_owner "npm install --omit=dev"
if [ "$(id -u)" -eq 0 ]; then
npm install --omit=dev
else
run_as_owner "npm install --omit=dev"
fi
echo ""
echo "--- права для службы shop ($SHOP_SERVICE_USER) ---"
if [ "$(id -u)" -eq 0 ]; then
bash "$SCRIPT_DIR/fix-shop-permissions.sh"
else
echo "WARN: запустите от root: sudo bash scripts/fix-shop-permissions.sh"
fi
echo ""
echo "Новая версия:"