feat(publicip): PUBLICIP_ENABLED replaces PUBLICIP_PERIOD

- No point periodically fetch the public IP address. Could not find anything mentioning why this was added.
- Simplification of the publicip loop code
- `PUBLICIP_ENABLED` (on, off) can be set to enable or not public ip data fetching on VPN connection
- `PUBLICIP_PERIOD=0` still works to indicate to disable public ip fetching
- `PUBLICIP_PERIOD` != 0 means to enable public ip fetching
- Warnings logged when using `PUBLICIP_PERIOD`
This commit is contained in:
Quentin McGaw
2024-10-07 19:49:25 +00:00
parent cbdd1a933c
commit 03deb9aed0
8 changed files with 59 additions and 109 deletions

View File

@@ -204,7 +204,7 @@ ENV VPN_SERVICE_PROVIDER=pia \
UPDATER_VPN_SERVICE_PROVIDERS= \
# Public IP
PUBLICIP_FILE="/tmp/gluetun/ip" \
PUBLICIP_PERIOD=12h \
PUBLICIP_ENABLED=on \
PUBLICIP_API=ipinfo \
PUBLICIP_API_TOKEN= \
# Storage