docs: run as systemd service

master
Shengjing Zhu 2022-07-14 01:49:14 +08:00
parent 0d2424bd77
commit b9e7014635
2 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,14 @@
[Unit]
Description=wghttp
[Service]
Type=simple
Environment=PRIVATE_KEY=FIXME
Environment=PEER_KEY=FIXME
Environment=PEER_ENDPOINT=FIXME
Environment=CLIENT_IP=FIXME
ExecStart=%h/go/bin/wghttp --listen 127.0.0.1:1080
Restart=on-failure
[Install]
WantedBy=default.target

13
docs/usage.md Normal file
View File

@ -0,0 +1,13 @@
# Usage
## Running as systemd service
Since wghttp doesn't need any privilege, it's preferred to run as systemd user service.
Copy [wghttp.service](./systemd/wghttp.service) to `~/.config/systemd/user/wghttp.service`.
After setting the environment options in `wghttp.service`, run:
```bash
systemctl --user daemon-reload
systemctl --user enable --now wghttp
```