Files
shell-scripts/0-部署应用/Oracle-Cloud/tailscale全互联/derper-new-tc-hk.sh
2024-11-28 16:42:36 +08:00

28 lines
756 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 参考 https://www.boris1993.com/self-hosting-tailscale-derp.html
# /etc/systemd/system/derper-server.service
[Unit]
# 服务名字
Description=Tailscale DERP Server
# 在网络服务启动后启动这个服务
After=network.target
[Service]
# 改成你的用户名
User=root
# 总是自动重新启动
Restart=always
# 重启前等待5秒
RestartSec=5
# 启动derper的命令跟上面测试用的命令一样
ExecStart=/root/go/bin/derper -c=/root/app-install/derper/derper.conf -hostname derper.107421.xyz -a :21443 -certmode manual -certdir /root/app-install/derper/
# 停止derper的命令
ExecStop=/bin/kill $MAINPID
# 赋予CAP_NET_BIND_SERVICE这个capability
#AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target