Merge pull request #105 from outis1one/claude/brave-tesla-hwf1m8
Fix Electron binary extraction: chown dist/ before extracting as kios…
This commit is contained in:
@@ -11099,12 +11099,12 @@ install_electron_binary() {
|
|||||||
tmp_zip=$(mktemp --suffix=.zip)
|
tmp_zip=$(mktemp --suffix=.zip)
|
||||||
if wget --timeout=300 --tries=3 --show-progress -O "$tmp_zip" "$electron_url" 2>&1; then
|
if wget --timeout=300 --tries=3 --show-progress -O "$tmp_zip" "$electron_url" 2>&1; then
|
||||||
command -v unzip >/dev/null 2>&1 || sudo apt install -y unzip
|
command -v unzip >/dev/null 2>&1 || sudo apt install -y unzip
|
||||||
# Run as root so we can write regardless of who owns node_modules/electron/dist/
|
# Fix ownership first so the kiosk user can write into the directory
|
||||||
# (npm postinstall may create it as root when --unsafe-perm is used)
|
# (npm postinstall with --unsafe-perm can leave dist/ owned by root)
|
||||||
mkdir -p "$KIOSK_DIR/node_modules/electron/dist"
|
sudo chown -R "$KIOSK_USER:$KIOSK_USER" "$KIOSK_DIR/node_modules/electron/" 2>/dev/null || true
|
||||||
unzip -o "$tmp_zip" -d "$KIOSK_DIR/node_modules/electron/dist/"
|
sudo -u "$KIOSK_USER" mkdir -p "$KIOSK_DIR/node_modules/electron/dist"
|
||||||
chown -R "$KIOSK_USER:$KIOSK_USER" "$KIOSK_DIR/node_modules/electron/dist/"
|
sudo -u "$KIOSK_USER" unzip -o "$tmp_zip" -d "$KIOSK_DIR/node_modules/electron/dist/" || true
|
||||||
chmod +x "$electron_bin"
|
sudo -u "$KIOSK_USER" chmod +x "$electron_bin" || true
|
||||||
fi
|
fi
|
||||||
rm -f "$tmp_zip"
|
rm -f "$tmp_zip"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user