ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
3.78k stars 464 forks source link

Starting wireguard-ui with state directory absent leads to login loops #530

Open vespian opened 5 months ago

vespian commented 5 months ago

I have wireguard-ui built from source (commit ecea82d172435), running behind nginx as a systemd service. The config file:

WGUI_USERNAME=mystifying_wozniak
WGUI_PASSWORD=some-password
WGUI_SERVER_INTERFACE_ADDRESSES=10.15.18.1/24
WGUI_DEFAULT_CLIENT_ALLOWED_IPS=10.15.16.0/22
WGUI_FORWARD_MARK=""
WGUI_DEFAULT_CLIENT_USE_SERVER_DNS=false
BIND_ADDRESS=127.0.0.1:5001
WGUI_SERVER_POST_UP_SCRIPT="/sbin/iptables -t filter -A FORWARD -i wg0 -o br-wg -j ACCEPT"
WGUI_SERVER_POST_DOWN_SCRIPT="/sbin/iptables -t filter -D FORWARD -i wg0 -o br-wg -j ACCEPT"

I have recently run into following issue:

The ui will redirect back to / instead of letting me in. Restarting wireguard-ui again fixes the issue. Issue is 100% reproducible. Let me know if there is any more info/context I can provide.

NextGenerationcloud commented 5 months ago

I have the same problem

https://url-link/wireguard/ <-- ENTER go to https://url-link/wireguard/login?next=/wireguard <---- ?? login ENTER go to https://url-link/wireguard <---- fault

BASE_PATH=/wireguard/ or BASE_PATH=wireguard/

Login is not possible with correct data

uforek commented 4 months ago

I am having a similar issue where the web UI is behind a reverse proxy. If I access the web UI via http://IP:PORT format, the login works fine. If I attempt to access it from the proxy side myproxy.com, it's redirected to https://myproxy.com/login?next=/. Any ideas?

I should mention that I am running the binary manually, and not in docker or with systemd.

parsavandy commented 2 weeks ago

same issue

parsavandy commented 1 week ago

any fix?