[Unit] Description=NAS Caddy/dnsmasq web configurator After=network-online.target caddy.service dnsmasq.service Wants=network-online.target [Service] Type=simple User=root Group=root WorkingDirectory=/opt/web-proxy-config EnvironmentFile=/etc/web-proxy-config.env ExecStart=/opt/web-proxy-config/.venv/bin/gunicorn --workers 1 --bind 127.0.0.1:8090 --access-logfile - --error-logfile - app:app Restart=on-failure RestartSec=3 # The process intentionally needs root because it atomically replaces files in # /etc and invokes systemctl. Keep it bound to loopback and protect it with Caddy. NoNewPrivileges=true PrivateTmp=true ProtectHome=true [Install] WantedBy=multi-user.target