feat: auto-install polkit for sudoless updates in LXC containers

- Add policykit-1 package to automatic dependency installation
- Check for pkexec command availability before installing polkit
- Enable sudoless update system to work in LXC environments
- Improve compatibility with community Proxmox VE installation scripts

This ensures that new installations (including via community scripts)
automatically get polkit support for seamless web-based updates
without requiring manual sudo commands.
This commit is contained in:
courtmanr@gmail.com
2025-06-04 15:49:16 +01:00
parent 1d6f4b8a64
commit 681c528aff
+8
View File
@@ -372,6 +372,11 @@ install_dependencies() {
fi
done
# Check for polkit separately since it's a package, not a command
if ! command -v pkexec &> /dev/null; then
missing_deps="$missing_deps policykit-1"
fi
if [ -n "$missing_deps" ]; then
print_info "Installing:$missing_deps"
apt-get install -y -qq $missing_deps || { print_error "Failed to install dependencies"; exit 1; }
@@ -492,6 +497,9 @@ EOF
setup_polkit_rule() {
print_info "Setting up polkit rule for automatic updates..."
# Note: polkit is required for sudoless updates in the web interface
# Without this, users would need to manually restart the service after updates
# Create polkit rules directory if it doesn't exist
mkdir -p /etc/polkit-1/rules.d