Skip to content

Commit b5cc0f8

Browse files
committed
feat(install): add Polkit rule to allow dployrd to manage systemd units without interactive auth
1 parent a581097 commit b5cc0f8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

install.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,19 @@ EOF
980980
systemctl daemon-reload
981981
systemctl start dployr-system.slice 2>/dev/null || true
982982
info "System protection slice configured (MemoryMin=256M CPUWeight=1000)"
983+
984+
# Add permissions
985+
mkdir -p /etc/polkit-1/rules.d
986+
cat > /etc/polkit-1/rules.d/50-dployrd.rules << 'EOF'
987+
polkit.addRule(function(action, subject) {
988+
if ((action.id === "org.freedesktop.systemd1.manage-units" ||
989+
action.id === "org.freedesktop.systemd1.manage-unit-files") &&
990+
subject.user === "dployrd") {
991+
return polkit.Result.YES;
992+
}
993+
});
994+
EOF
995+
info "Polkit rule installed — dployrd can manage systemd units without interactive auth"
983996
fi
984997

985998
info "Setting up dployrd service..."

0 commit comments

Comments
 (0)