ngoduykhanh / wireguard-ui

Wireguard web interface
MIT License
4.22k stars 517 forks source link

UI doesn't load after WG change #584

Open StuartHaire opened 6 months ago

StuartHaire commented 6 months ago

Hi, the following is my docker-compose and it works fine with the wireguard image "wireguard:v1.0.20210914-ls7" but when I use anything newer than this or the latest tag the UI won't load.

There was a breaking change after this version which states the following:

_"Potentially Breaking Change: Support for multiple interfaces added. Wireguard confs moved to /config/wgconfs/. Any file with a .conf extension in that folder will be treated as a live tunnel config and will be attempted to start. If any of the tunnels fail, all tunnels will be stopped. Tunnels are started in alphabetical order. Managed server conf will continue to be hardcoded to wg0.conf."

I think the issue is that wireguard now uses this new "wg_confs" folder whereas wireguard-ui doesn't account for this and is still looking the wg0.conf file within the config folder and not the wg_confs folder?

I've tried several things but with no luck. Any help or update around this would be great!


services:
  wireguard:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
    volumes:
      - './config:/config'
    ports:
      - '5001:5000'
      - '51820:51820/udp'

  wireguard-ui:
    image: ngoduykhanh/wireguard-ui:latest
    container_name: wireguard-ui
    depends_on:
      - wireguard
    cap_add:
      - NET_ADMIN
    network_mode: service:wireguard
    environment:
      - SENDGRID_API_KEY
      - EMAIL_FROM_ADDRESS
      - EMAIL_FROM_NAME
      - SESSION_SECRET
      - WGUI_USERNAME=admin
      - WGUI_PASSWORD=password
      - WG_CONF_TEMPLATE
      - WGUI_MANAGE_START=true
      - WGUI_MANAGE_RESTART=true
    logging:
      driver: json-file
      options:
        max-size: 50m
    volumes:
      - './db:/app/db'
      - './config:/etc/wireguard'```
Wannabooo commented 6 months ago

I have the same problem

Yann39 commented 4 months ago

Simply change the volume to - './config:/etc/wireguard/wg_confs in your wireguard-ui service, so that the config is saved to the new _wgconfs directory. You may need to delete any existing empty wg0.conf from the bound volume, then restart the container.

mikes-bowden commented 3 months ago

Simply change the volume to - './config:/etc/wireguard/wg_confs in your wireguard-ui service, so that the config is saved to the new _wgconfs directory. You may need to delete any existing empty wg0.conf from the bound volume, then restart the container.

Thank you for this! If anyone else is not able to get the UI working on a fresh install, this is your issue.