Add documentation for updown

This commit is contained in:
Owen 2025-03-08 21:11:36 -05:00
parent 6f1d4752f0
commit 437d8b67a4
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD

View file

@ -36,7 +36,8 @@ When Newt receives WireGuard control messages, it will use the information encod
- `secret`: A unique secret (not shared and kept private) used to authenticate the client ID with the websocket in order to receive commands.
- `dns`: DNS server to use to resolve the endpoint
- `log-level` (optional): The log level to use. Default: INFO
- `updown` (optional): A script to be called when targets are added or removed.
Example:
```bash
@ -92,6 +93,18 @@ WantedBy=multi-user.target
Make sure to `mv ./newt /usr/local/bin/newt`!
### Updown
You can pass in a updown script for Newt to call when it is adding or removing a target:
`--updown "python3 test.py"`
It will get called with args when a target is added:
`python3 test.py add tcp localhost:8556`
`python3 test.py remove tcp localhost:8556`
Returning a string from the script in the format of a target (`ip:dst` so `10.0.0.1:8080`) it will override the target and use this value instead to proxy.
## Build
### Container