-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request/Question: Multiple wireguard config files ? #2373
Comments
@qdm12 is more or less the only maintainer of this project and works on it in his free time.
|
I found a hacky way to do this by symlinking a different .conf file to Suppose you have #!/bin/sh
WGCONF=/gluetun/wireguard/wg0.conf
# Unlinking the old wg0.conf
unlink $WGCONF
# Randomly choosing a new conf file from the wireguard* list
# For me this is enough
NEWCONF=$(ls /gluetun/wireguard/wireguard-*.conf | shuf -n 1)
# Make that the new wg0.conf
ln -T $NEWCONF $WGCONF
# Executing the binary
/gluetun-entrypoint Then execute it on gluetun startup with the following docker-compose options: services:
gluetun:
...
healthcheck:
# If network is unreachable, exit 1 to indicate unhealthy container
test: wget -O- https://ipinfo.io || exit 1
# Tune these as needed
interval: 20s
timeout: 5s
retries: 2
# Run the shell script as the entrypoint
entrypoint: '/bin/sh'
command: '/gluetun/startup.sh' AFAIK Docker doesn't natively restart unhealthy containers, so feel free to use one of the following methods. For me a cron job would do. |
That's a clever way i'll be happy to try, thanks ! |
Oops, it doesn't work...
I sure have the wireguard folder and glutun volume mounted, when manually edited the wg0.conf is read by gluetun. edit : newbie mistake, file was created on windows with CR+LF, the carriage return was the issue. |
What's the feature 🧐
Currently gluetun is able to switch between openvpn servers on unhealthy states (right now I use SERVER_HOSTNAMES setting to achieve this with cherry picked servers. Would it be possible to do the same with wireguard config files like wg0.conf, wg1.conf etc..
Or maybe there's already a way to do this I'm unaware of ?
Extra information and references
No response
The text was updated successfully, but these errors were encountered: