donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.58k stars 236 forks source link

Toggling peers on Ubiquiti Edgerouter fails #16

Closed bmikol closed 2 years ago

bmikol commented 3 years ago

Describe The Problem The good news is that with some slight tweaks to the dashboard.py file (as the default conf_location is not in /etc/wireguard), I was able to bring up the dashboard on a Ubiquiti Edgerouter running Wireguard. The bad news is that the toggles are not working – which appears due to the fact that the wg-quick script is not installed in this flavor of Wireguard.

I realize this this is more of an issue with the implementation of Wireguard on the EdgeOS of Ubiquiti's routers, but wanted to call attention to the issue in case others are trying to get it running.

Expected Error / Traceback

[…]
10.10.10.10 - - [24/Apr/2021 20:01:52] "GET / HTTP/1.1" 200 -
/bin/sh: wg-quick: command not found
10.10.10.10 - - [24/Apr/2021 20:01:55] "GET /switch/iPhone HTTP/1.1" 302 -
[…]

To Reproduce

  1. Download the appropriate EdgeOS release of Wireguard from Github.
  2. Follow instructions to install on Edgerouter.
  3. Set up Wireguard as usual.
  4. Download & install wireguard-dashboard.
  5. Update dashboard.py lines 8 & 51 to point to the folder containing the Wireguard config file (or, create /etc/wireguard and move the Wireguard config file there).
  6. Start wireguard-dashboard and navigate to dashboard in browser.
  7. Try toggling a peer on.

OS Information:

donaldzou commented 3 years ago

Hi! Thank you so much for bringing this problem to my attention, I will implement a function into the future version where could resolve this problem!

donaldzou commented 3 years ago

Hi! I'm wondering did you end-up getting wg-quick on EdgeOS?

bmikol commented 3 years ago

Hi @donaldzou,

No, honestly I haven't been able to get wg-quick compiled on the router; I tried doing that before filing this issue but kept running into various issues. Unfortunately, I haven't had the time to try again – not sure when that'll be, as I expect it might take some fighting.

donaldzou commented 3 years ago

Hi @bmikol,

I've tried to dig into how wireguard work in the router. But since i don't own a router so is kinda hard for me to test. I'm gonna mark this problem is "help wanted", to see if anyone have a solution ;)

kylerove commented 3 years ago

WireGuard on edgerouter is maintained and configured through the vyatta configuration system. Changes must be pushed to that (removing or adding peers) and committed. Interfacing with it is reasonably straightforward. Here is an example: https://github.com/whiskerz007/ubnt_get_wireguard/blob/master/get_wireguard.sh

donaldzou commented 3 years ago

WireGuard on edgerouter is maintained and configured through the vyatta configuration system. Changes must be pushed to that (removing or adding peers) and committed. Interfacing with it is reasonably straightforward. Here is an example: https://github.com/whiskerz007/ubnt_get_wireguard/blob/master/get_wireguard.sh

Thank you for providing this, since I don't own an edgerouter so I can't do any testing on the OS. I will keep open this issue and hope come across this issue and could solve this issue :)