Skip to content
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

Need to manually restart the container's wireguard-ui when Apply Config #633

Open
HJ12366 opened this issue Oct 6, 2024 · 4 comments
Open

Comments

@HJ12366
Copy link

HJ12366 commented Oct 6, 2024

This project has been used quite well.

However, I am currently facing a problem where I may often need to add or remove peers in the Wireguard Clients web management interface. Every modification requires Apply Config, which is not a big deal. But after doing this, I need to go to the Wireguard server to restart the Wireguard ui container before I can enter the Wireguard ui web management interface again, and I also need to log in again, which is very troublesome.
Is my configuration or method incorrect.
image

I added environment variables in docker-compose.yml,as shown in the following figure,but only restarted the Wireguard container.
image

@nirajkumar999
Copy link

I am also facing the same issue. Even a simple save action inside setting tab, i get apply config button. Once i apply the config, my UI crashes. I dont see any log and everything freezes. I am not able to navigate to other tab. Please let me know if you have any solution.

@HJ12366
Copy link
Author

HJ12366 commented Oct 9, 2024

I am also facing the same issue. Even a simple save action inside setting tab, i get apply config button. Once i apply the config, my UI crashes. I dont see any log and everything freezes. I am not able to navigate to other tab. Please let me know if you have any solution.

The following two environment variables are used by default. This is how I solved them@nirajkumar999
image

@nirajkumar999
Copy link

nirajkumar999 commented Oct 11, 2024

Hii...

I have resolved the issue. I kept both the env variable true. Also set these two env variable in wireguard-ui

  • WGUI_SERVER_POST_UP_SCRIPT=iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
    - WGUI_SERVER_POST_DOWN_SCRIPT=iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth+ -j MASQUERADE

Along with this set - WGUI_CONFIG_FILE_PATH=/etc/wireguard/wg_confs/wg0.conf

The config file path needs to be changed because the latest version of wireguard has changed directory, but that is not updated in our wireguard-ui latest image.

But this would not solve the issue. U need to start the ui container then stop it and then again start it so that all ur env changes r loaded properly. Then apply config will surely restart the wireguard.

This is bug in the latest image. Best way is to make ur own ui image from dockerfile by chaging a bit in UI code

@nirajkumar999
Copy link

nirajkumar999 commented Oct 11, 2024

Let me know if u need further help. I would suggest to change the code for wireguard-ui and build ur own docker image from docker file.

Because the provided ui docker image has some issues with wgui config file location.

If u try to build ur own image also make a change into init.sh.
Change the below line to read config from correct path.

conf="$(jq -r .config_file_path db/server/global_settings.json || echo /etc/wireguard/wg_confs/wg0.conf)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants