feat: add script to fix Electron app permissions and update package configuration

This commit is contained in:
2025-03-11 09:50:59 +01:00
parent da3db10d03
commit df04f3c4ac
4 changed files with 59 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
echo "=============================================="
echo "Electron chrome-sandbox permission fixer"
echo "=============================================="
echo "This script requires sudo permissions to fix"
echo "Electron app permissions."
echo ""
# Find all electron sandbox paths
echo "Finding Electron chrome-sandbox instances..."
SANDBOX_PATHS=$(find /nix/store -path "*/electron/chrome-sandbox" -type f -executable 2>/dev/null)
if [ -n "$SANDBOX_PATHS" ]; then
count=$(echo "$SANDBOX_PATHS" | wc -l)
echo "Found $count chrome-sandbox instances"
# If we get here, we're running with sudo
echo "$SANDBOX_PATHS" | while read -r SANDBOX_PATH; do
if [ -e "$SANDBOX_PATH" ]; then
echo "Setting permissions for $SANDBOX_PATH"
sudo chown root:root "$SANDBOX_PATH" || echo "Failed to set owner for $SANDBOX_PATH"
sudo chmod 4755 "$SANDBOX_PATH" || echo "Failed to set permissions for $SANDBOX_PATH"
fi
done
echo "All permissions set successfully"
else
echo "Could not find any Electron chrome-sandbox paths"
fi