From 8d6fe601684ab91451aae0684a8e7b8bd8555367 Mon Sep 17 00:00:00 2001 From: NixReaper Date: Sat, 11 Apr 2026 08:53:47 -0500 Subject: [PATCH] fix(install): set world-readable permissions on frontend dist dirs Apache (www-data) couldn't traverse /opt/nixpanel/nixserver because the directories lacked execute permission for other. Add an explicit chmod step after the build to ensure all dist directories are 755 and files are 644 so Apache can serve the static assets. --- scripts/install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 62e7503..bc43d18 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -577,6 +577,16 @@ cd "$INSTALL_DIR/server" npm run build --silent success "Build complete" +# ── Set web-readable permissions on frontend assets ─────────────────────────── +step "Setting frontend file permissions" +# Apache runs as www-data — ensure it can traverse parents and read dist files +chmod 755 "$INSTALL_DIR" "$INSTALL_DIR/nixserver" "$INSTALL_DIR/nixclient" +find "$INSTALL_DIR/nixserver/dist" -type d -exec chmod 755 {} \; +find "$INSTALL_DIR/nixserver/dist" -type f -exec chmod 644 {} \; +find "$INSTALL_DIR/nixclient/dist" -type d -exec chmod 755 {} \; +find "$INSTALL_DIR/nixclient/dist" -type f -exec chmod 644 {} \; +success "File permissions set" + # ── systemd service ─────────────────────────────────────────────────────────── step "Creating systemd service" cat > /etc/systemd/system/nixpanel.service <