ngoduykhanh / wireguard-ui

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

Wireguard confs moved to /config/wg_confs/ #456

Open Dirk-- opened 8 months ago

Dirk-- commented 8 months ago

https://github.com/linuxserver/docker-wireguard/releases/tag/v1.0.20210914-ls8

tom666-debug commented 8 months ago

I also noticed this change already. So for me wireguard-ui stopped working after updating to the latest wireguard (docker) release. A simple adjustment of the path variables within docker-compose.yml didnt work. So, whats the trick to get it working again? Do I need to patch the database as well?

capdeveloping commented 8 months ago

workaround for me is doing a softlink inside the container. "/etc/wireguard/wg0.conf -> /config/wg0.conf". And /config/wg_confs/wg0.conf -> /config/wg0.conf

tom666-debug commented 8 months ago

@capdeveloping thx for your feedback. I will give it a try.

Mindless999 commented 8 months ago

For me what I did to get it running (for now) is to delete the '/config/wg0.conf' since that one was empty, and '/config/wg_confs/wg0.conf' had all the information and since then it did work. Every time starting the docker it will re-create the '/config/wg0.conf' and I need to use sudo / root to delete this.

Mindless999 commented 7 months ago

Just a bit of an update. Note this is a WORKAROUND; this will not start the docker at boot, unless you specifically delete the file before starting the docker!

I changed my docker compose file to the following. I run the docker on its own user, so make sure you change the userid to what you're using:

version: "3"

services:

  # WireGuard VPN service
  wireguard:
    image: linuxserver/wireguard:latest
    container_name: wireguard
    environment:
      - PUID=1001
      - PGID=1001
      - PEERS=1
    cap_add:
      - NET_ADMIN
    volumes:
      - ./config:/config
    restart: always
    ports:
      # Port for WireGuard-UI
      - "5000:5000"
      # Port of the WireGuard VPN server
      - "51820:51820/udp"

  # WireGuard-UI service
  wireguard-ui:
    image: ngoduykhanh/wireguard-ui:latest
    container_name: wireguard-ui
    depends_on:
      - wireguard
    cap_add:
      - NET_ADMIN
    # Use the network of the 'wireguard' service
    # This enables to show active clients in the status page
    network_mode: service:wireguard
    environment:
      - SENDGRID_API_KEY
      - EMAIL_FROM_ADDRESS
      - EMAIL_FROM_NAME
      - SESSION_SECRET
      - WGUI_USERNAME=<SUPERSECRETUSER>
      - WGUI_PASSWORD=<SUPERSECRETPASSWORD>
      - WG_CONF_TEMPLATE
      - WGUI_MANAGE_START=true
      - WGUI_MANAGE_RESTART=true
      - PUID=1001
      - PGID=1001
      - PEERS=1
    restart: always
    logging:
      driver: json-file
      options:
        max-size: 50m
    volumes:
      - ./db:/app/db
      - ./config:/etc/wireguard

Afer this, to also update the docker which will remove the file on every step (just in case) when updating, for that I use the following scrip called update.sh

#/bin/bash
rm -f ~/config/wg0.conf
docker compose pull
docker compose down
rm -f ~/config/wg0.conf
docker compose up -d
rm -f ~/config/wg0.conf
Mindless999 commented 3 months ago

Is there any update on this? I currently need to delete the file and re-apply the configuration after every reboot for some reason, I would've assumed it would be fixed, but it doesn't seem to be fixed (unless I missed something with the changes and need a configuration change)

avoidik commented 6 days ago
services:
  wireguard-ui:
    environment:
      - WGUI_CONFIG_FILE_PATH=/etc/wireguard/wg_confs/wg0.conf