Update Readme
All checks were successful
Deploy to Server / deploy (push) Successful in 41s

This commit is contained in:
2025-10-25 18:30:12 -04:00
parent a0cff44fac
commit 7898501b15

View File

@@ -133,8 +133,16 @@ The repo includes `.gitea/workflows/deploy.yaml` which, on push to `main`, SSHes
If your service name or directory differ, update `SERVICE`/`APP_DIR` in the workflow accordingly.
```
apt update
apt install -y sudo
echo "deployuser ALL=(root) NOPASSWD: /bin/systemctl restart train-id.service" | sudo tee /etc/sudoers.d/train-id >/dev/null
sudo chmod 440 /etc/sudoers.d/train-id
sudo visudo -cf /etc/sudoers.d/train-id
SYSCTL_PATH=$(command -v systemctl) # usually /bin/systemctl or /usr/bin/systemctl
cat >/etc/sudoers.d/train-id <<EOF
deployuser ALL=(root) NOPASSWD: ${SYSCTL_PATH} restart train-id, ${SYSCTL_PATH} restart train-id.service
EOF
chmod 440 /etc/sudoers.d/train-id
visudo -cf /etc/sudoers.d/train-id
sudo -n systemctl restart train-id
```