[Unit]
Description=Pangolin node agent (self-enrolls, manages local sing-box)
Documentation=https://github.com/wangjia/pangolin
After=network-online.target pangolin-server.service
Wants=network-online.target
Requires=pangolin-server.service

[Service]
Type=simple
EnvironmentFile=/etc/pangolin-agent/agent.env
ExecStart=/usr/local/bin/pangolin-agent
Restart=on-failure
RestartSec=5
# The agent calls `systemctl restart sing-box` after rendering config;
# a polkit rule (49-pangolin-singbox.rules) lets the unprivileged pangolin
# user manage *only* sing-box.service.
User=pangolin

[Install]
WantedBy=multi-user.target
