summaryrefslogtreecommitdiff
path: root/net-vpn/headscale/files/headscale.service
diff options
context:
space:
mode:
Diffstat (limited to 'net-vpn/headscale/files/headscale.service')
-rw-r--r--net-vpn/headscale/files/headscale.service24
1 files changed, 24 insertions, 0 deletions
diff --git a/net-vpn/headscale/files/headscale.service b/net-vpn/headscale/files/headscale.service
new file mode 100644
index 000000000000..fb27b40d4e31
--- /dev/null
+++ b/net-vpn/headscale/files/headscale.service
@@ -0,0 +1,24 @@
+[Unit]
+Description=headscale controller
+After=syslog.target
+After=network.target
+
+[Service]
+Type=simple
+User=headscale
+Group=headscale
+ExecStart=/usr/bin/headscale serve
+Restart=always
+RestartSec=5
+
+# Optional security enhancements
+NoNewPrivileges=yes
+PrivateTmp=yes
+ProtectSystem=strict
+ProtectHome=yes
+ReadWritePaths=/var/lib/headscale /run/headscale
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+RuntimeDirectory=headscale
+
+[Install]
+WantedBy=multi-user.target