Created
March 18, 2023 11:28
-
-
Save sr/f8b1860cca428b04fc2b0b84ea561348 to your computer and use it in GitHub Desktop.
tsproxy systemd service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Tailscale Proxy | |
Wants=network-pre.target tailscaled.service | |
After=network-pre.target tailscaled.service | |
StartLimitIntervalSec=0 | |
[Service] | |
EnvironmentFile=/etc/default/tsproxy | |
ExecStart=/usr/local/bin/tsproxy \ | |
--state="${STATE_DIRECTORY}" \ | |
--port=80 \ | |
--upstream="my-app=http://127.0.0.1:8000;prometheus;funnel" | |
TimeoutStartSec=0 | |
Restart=always | |
RestartSec=1 | |
DynamicUser=yes | |
StateDirectory=tsproxy | |
StateDirectoryMode=0777 | |
NoNewPrivileges=yes | |
AmbientCapabilities=CAP_NET_BIND_SERVICE | |
CapabilityBoundingSet=CAP_NET_BIND_SERVICE | |
PrivateTmp=yes | |
PrivateMounts=yes | |
PrivateDevices=yes | |
ProtectSystem=strict | |
ProtectHome=yes | |
ProtectHostname=yes | |
ProtectProc=noaccess | |
ProtectControlGroups=yes | |
ProtectKernelModules=yes | |
ProtectKernelTunables=yes | |
ProtectKernelLogs=yes | |
ProtectClock=yes | |
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX | |
RestrictNamespaces=yes | |
SystemCallFilter=@system-service | |
RestrictRealtime=yes | |
RestrictSUIDSGID=yes | |
MemoryDenyWriteExecute=yes | |
LockPersonality=yes | |
SystemCallArchitectures=native | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment