Просмотр исходного кода

fix(deploy): grant CAP_NET_BIND_SERVICE so the TLS listener can bind :443 without root (#1306) (#1311)

The shipped unit runs as User=netpulse with no capabilities, so enabling
the extra HTTPS listener on its default port 443 always failed with
'permission denied' on the bind. AmbientCapabilities=CAP_NET_BIND_SERVICE
lets systemd grant exactly that one capability to exactly this service:
the process stays the unprivileged netpulse user for everything else.
Nacho 1 месяц назад
Родитель
Сommit
ff3433f884
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      deploy/netpulse-go.service

+ 4 - 0
deploy/netpulse-go.service

@@ -24,6 +24,10 @@ Wants=network-online.target
 Type=simple
 User=netpulse
 Group=netpulse
+# #1306: permitir el bind de puertos privilegiados (<=1024, p.ej. el TLS por
+# defecto en :443) sin root. La capability la concede systemd SOLO a este
+# servicio; el proceso sigue siendo el usuario netpulse en todo lo demás.
+AmbientCapabilities=CAP_NET_BIND_SERVICE
 WorkingDirectory=/opt/netpulse/server-go
 EnvironmentFile=/opt/netpulse/server-go/.env
 ExecStart=/opt/netpulse/server-go/netpulse