Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions deploy/narvana-worker.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ RestartSec=5
# Environment
EnvironmentFile=/etc/narvana/control-plane.env
Environment=HOME=/opt/narvana
Environment=XDG_RUNTIME_DIR=/run/user/1001

# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
ReadWritePaths=/var/log/narvana /var/lib/narvana/builds /opt/narvana
# Security settings relaxed for rootless Podman (requires user namespaces)
NoNewPrivileges=false
ProtectSystem=full
ProtectHome=false
PrivateTmp=false

[Install]
WantedBy=multi-user.target
12 changes: 11 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,19 @@ run_migrations() {
setup_services() {
log_info "Configuring systemd services..."

# Get narvana user's UID for XDG_RUNTIME_DIR
local NARVANA_UID=$(id -u narvana)

# Create XDG_RUNTIME_DIR for rootless Podman
mkdir -p "/run/user/${NARVANA_UID}"
chown narvana:narvana "/run/user/${NARVANA_UID}"
chmod 700 "/run/user/${NARVANA_UID}"

cd "$INSTALL_DIR"

# Update XDG_RUNTIME_DIR in service file with actual UID
sed "s|/run/user/1001|/run/user/${NARVANA_UID}|g" deploy/narvana-worker.service > /etc/systemd/system/narvana-worker.service
cp deploy/narvana-api.service /etc/systemd/system/
cp deploy/narvana-worker.service /etc/systemd/system/
cp deploy/narvana-web.service /etc/systemd/system/

systemctl daemon-reload
Expand Down
Loading