xitation / protonvpn-deluge-gluetun-portforward

A docker-compose and script to setup Deluge and Gluetun with Wireguard via ProtonVPN with Port Forwarding
7 stars 1 forks source link

Use custom-services instead of cron #3

Open RogueOneEcho opened 1 month ago

RogueOneEcho commented 1 month ago

First, thanks for putting together this guide its been incredibly useful. While getting it setup myself I came some alternative approaches that other users may want to consider.

In setup.sh you're configuring cron to call configure_port.sh every minute forever.

https://github.com/xitation/protonvpn-deluge-gluetun-portforward/blob/aeb287cef2a2fb03df55f2c86884f9759324116b/scripts/setup.sh#L19-L37

Instead of this you can run configure_port.sh as a custom-service. Custom services are restarted every time they exit so my approach has been to sleep 2s if the script fails and needs to run again or sleep infinity if it's successful https://docs.linuxserver.io/general/container-customization/#custom-services

xitation commented 1 month ago

Hi @RogueOneEcho,

Appreciate the effort of improving the solution, I'll take a look at your suggestion.

Feel free to raise a PR too if you like?

Always open to anyone coming up with better ways to do things, this was a pretty dirty hack to solve an issue and I must admit I've not looked at it too closely since it started working. Noting it does have a few quirks that should be fixed. e.g. docker container updates with Watchman need manual intervention to make it all work again most times, etc.

Probably won't have time to do much on this until next week.