donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python w/ Flask

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Looking for other OS that can run the dashboard perfectly!

donaldzou opened this issue · comments

Since I've only tested this on Ubuntu, I would like you to provide the OS name and version if you ran the dashboard on other than Ubuntu. Thank you!

Still Ubuntu based but on a Raspberry Pi.

cat /sys/firmware/devicetree/base/model
Raspberry Pi 3 Model B Rev 1.2

uname -a
Linux DietPi 5.10.17-v8+ #1421 SMP PREEMPT Thu May 27 14:01:37 BST 2021 aarch64 GNU/Linux

cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian

Running successfully on AlmaLinux 8.4 Virtual Machine. Alma is a binary compatible RHEL rebuild.

[root@vpn sites-enabled]# cat /etc/os-release
NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"

Kernel Version

Linux vpn 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Thu Jul 1 02:25:14 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

Hello, I try to run on CentOS 7. Everything looks OK with installation but it wont work. I change port because Wg Gen Web works on port 8080 but also fails. It looks like running. I have already wireguard installed and conf files for few devices generated with wireguard-install script https://github.com/angristan/wireguard-install

[przem@vpn ~]$ git clone -b v2.1 https://github.com/donaldzou/Wireguard-Dashboard.git
Cloning into 'Wireguard-Dashboard'...
remote: Enumerating objects: 512, done.
remote: Counting objects: 100% (182/182), done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 512 (delta 125), reused 91 (delta 67), pack-reused 330
Receiving objects: 100% (512/512), 1.85 MiB | 0 bytes/s, done.
Resolving deltas: 100% (270/270), done.
Note: checking out '9b2c59d5298aed28f34b50345b9ddb21bcb486d4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

[przem@vpn src]$ sudo python3 -m pip install -r requirements.txt
WARNING: Running pip install with root privileges is generally not a good idea. Try `__main__.py install --user` instead.
Collecting Flask==1.1.2 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB)
    100% |████████████████████████████████| 102kB 7.0MB/s 
Collecting tinydb==4.3.0 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/e5/7e/85ee672ee60affd5b4461efa19f260cf7575f36b94fbd1f0825742639910/tinydb-4.3.0-py3-none-any.whl
Collecting ifcfg==0.21 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/31/86/e673dbd280e6744dfa85291f2c78cb59a05559206e8662d6f258d4a8b3f0/ifcfg-0.21-py2.py3-none-any.whl
Collecting icmplib==2.1.1 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/1a/81/fdaa49eb03949877c6905439320bb84b7935f46f897549ab116aceec2f17/icmplib-2.1.1-py3-none-any.whl
Collecting itsdangerous>=0.24 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/9c/96/26f935afba9cd6140216da5add223a0c465b99d0f112b68a4ca426441019/itsdangerous-2.0.1-py3-none-any.whl
Collecting Jinja2>=2.10.1 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/80/21/ae597efc7ed8caaa43fb35062288baaf99a7d43ff0cf66452ddf47604ee6/Jinja2-3.0.1-py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 7.5MB/s 
Collecting Werkzeug>=0.15 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/bd/24/11c3ea5a7e866bf2d97f0501d0b4b1c9bbeade102bb4b588f0d2919a5212/Werkzeug-2.0.1-py3-none-any.whl (288kB)
    100% |████████████████████████████████| 296kB 1.9MB/s 
Collecting click>=5.1 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl (97kB)
    100% |████████████████████████████████| 102kB 7.9MB/s 
Collecting MarkupSafe>=2.0 (from Jinja2>=2.10.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/fc/d6/57f9a97e56447a1e340f8574836d3b636e2c14de304943836bd645fa9c7e/MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting dataclasses; python_version < "3.7" (from Werkzeug>=0.15->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl
Collecting importlib-metadata; python_version < "3.8" (from click>=5.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/07/76/c4674c460f5ff4b5f7a962214e46295e20504dfde9fcba78fd728dfe2ac9/importlib_metadata-4.6.3-py3-none-any.whl
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata; python_version < "3.8"->click>=5.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/2e/35/6c4fff5ab443b57116cb1aad46421fb719bed2825664e8fe77d66d99bcbc/typing_extensions-3.10.0.0-py3-none-any.whl
  GNU nano 2.3.1                                                        Plik: wg-dashboard.ini                                                                                                                          

[Account]
username = admin
password = 8c6976e5b5..........

[Server]
wg_conf_path = /etc/wireguard
app_ip = 0.0.0.0
app_port = 8080 
auth_req = true
version = v2.1
dashboard_refresh_interval = 15000

[przem@vpn src]$ ./wgd.sh start
Wireguard Dashboard is already running. 
[przem@vpn src]$ ./wgd.sh stop
Wireguard Dashboard is stopped. 
[przem@vpn src]$ ./wgd.sh start
Starting Wireguard Dashboard in the background. 
Log file: log/20210802025639.txt
[przem@vpn src]$ ls
dashboard.py  db  log  requirements.txt  static  templates  wg-dashboard.ini  wgd.sh
[przem@vpn src]$ ./wgd.sh restart
Wireguard Dashboard is stopped. 
Starting Wireguard Dashboard in the foreground. 
 * Serving Flask app "Wireguard Dashboard" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://5.185.212.12:8080/ (Press CTRL+C to quit)

Regards.

Hello, I try to run on CentOS 7. Everything looks OK with installation but it wont work. I change port because Wg Gen Web works on port 8080 but also fails. It looks like running. I have already wireguard installed and conf files for few devices generated with wireguard-install script https://github.com/angristan/wireguard-install

[przem@vpn ~]$ git clone -b v2.1 https://github.com/donaldzou/Wireguard-Dashboard.git
Cloning into 'Wireguard-Dashboard'...
remote: Enumerating objects: 512, done.
remote: Counting objects: 100% (182/182), done.
remote: Compressing objects: 100% (114/114), done.
remote: Total 512 (delta 125), reused 91 (delta 67), pack-reused 330
Receiving objects: 100% (512/512), 1.85 MiB | 0 bytes/s, done.
Resolving deltas: 100% (270/270), done.
Note: checking out '9b2c59d5298aed28f34b50345b9ddb21bcb486d4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

[przem@vpn src]$ sudo python3 -m pip install -r requirements.txt
WARNING: Running pip install with root privileges is generally not a good idea. Try `__main__.py install --user` instead.
Collecting Flask==1.1.2 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/f2/28/2a03252dfb9ebf377f40fba6a7841b47083260bf8bd8e737b0c6952df83f/Flask-1.1.2-py2.py3-none-any.whl (94kB)
    100% |████████████████████████████████| 102kB 7.0MB/s 
Collecting tinydb==4.3.0 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/e5/7e/85ee672ee60affd5b4461efa19f260cf7575f36b94fbd1f0825742639910/tinydb-4.3.0-py3-none-any.whl
Collecting ifcfg==0.21 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/31/86/e673dbd280e6744dfa85291f2c78cb59a05559206e8662d6f258d4a8b3f0/ifcfg-0.21-py2.py3-none-any.whl
Collecting icmplib==2.1.1 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/1a/81/fdaa49eb03949877c6905439320bb84b7935f46f897549ab116aceec2f17/icmplib-2.1.1-py3-none-any.whl
Collecting itsdangerous>=0.24 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/9c/96/26f935afba9cd6140216da5add223a0c465b99d0f112b68a4ca426441019/itsdangerous-2.0.1-py3-none-any.whl
Collecting Jinja2>=2.10.1 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/80/21/ae597efc7ed8caaa43fb35062288baaf99a7d43ff0cf66452ddf47604ee6/Jinja2-3.0.1-py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 7.5MB/s 
Collecting Werkzeug>=0.15 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/bd/24/11c3ea5a7e866bf2d97f0501d0b4b1c9bbeade102bb4b588f0d2919a5212/Werkzeug-2.0.1-py3-none-any.whl (288kB)
    100% |████████████████████████████████| 296kB 1.9MB/s 
Collecting click>=5.1 (from Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl (97kB)
    100% |████████████████████████████████| 102kB 7.9MB/s 
Collecting MarkupSafe>=2.0 (from Jinja2>=2.10.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/fc/d6/57f9a97e56447a1e340f8574836d3b636e2c14de304943836bd645fa9c7e/MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting dataclasses; python_version < "3.7" (from Werkzeug>=0.15->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl
Collecting importlib-metadata; python_version < "3.8" (from click>=5.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/07/76/c4674c460f5ff4b5f7a962214e46295e20504dfde9fcba78fd728dfe2ac9/importlib_metadata-4.6.3-py3-none-any.whl
Collecting typing-extensions>=3.6.4; python_version < "3.8" (from importlib-metadata; python_version < "3.8"->click>=5.1->Flask==1.1.2->-r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/2e/35/6c4fff5ab443b57116cb1aad46421fb719bed2825664e8fe77d66d99bcbc/typing_extensions-3.10.0.0-py3-none-any.whl
  GNU nano 2.3.1                                                        Plik: wg-dashboard.ini                                                                                                                          

[Account]
username = admin
password = 8c6976e5b5..........

[Server]
wg_conf_path = /etc/wireguard
app_ip = 0.0.0.0
app_port = 8080 
auth_req = true
version = v2.1
dashboard_refresh_interval = 15000

[przem@vpn src]$ ./wgd.sh start
Wireguard Dashboard is already running. 
[przem@vpn src]$ ./wgd.sh stop
Wireguard Dashboard is stopped. 
[przem@vpn src]$ ./wgd.sh start
Starting Wireguard Dashboard in the background. 
Log file: log/20210802025639.txt
[przem@vpn src]$ ls
dashboard.py  db  log  requirements.txt  static  templates  wg-dashboard.ini  wgd.sh
[przem@vpn src]$ ./wgd.sh restart
Wireguard Dashboard is stopped. 
Starting Wireguard Dashboard in the foreground. 
 * Serving Flask app "Wireguard Dashboard" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://5.185.212.12:8080/ (Press CTRL+C to quit)

Regards.

Hi, could you elaborate your problem plz? Thanks!

Hi, @donaldzou I don't understand what do You mean?
Regards.

Hi, @donaldzou I don't understand what do You mean?
Regards.

Hi, I will move this to a new issue.

Works perfect on CentOS 7.
Regards.

commented

Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-17-cloud-amd64

Works fine :)

Works great on ARM64 Armbian, based on Ubuntu 20.04 LTS:

uname -a
Linux odroidn2 5.10.57-meson64 #21.05.8 SMP PREEMPT Mon Aug 9 12:44:31 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

cat /etc/os-release
NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Armbian 21.05.8 Focal" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

Works Great on Debian. ......Just a few packages were needed to make happy.

Started with Linux 4.19.0-17-amd64 Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux
but got it happy with
Linux 5.10.0-8-amd64 Debian 5.10.46-4 (2021-08-03) x86_64
by adding

"deb http://deb.debian.org/debian sid main" | sudo tee /etc/apt/sources.list
apt update
apt upgrade
apt install python3-pip
apt install python-setuptools
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
apt install wireguard

Works Great on Centos 8 and Centos Stream and also in the container too.

NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"

Hello all, I have managed to install this WGDashboard on Raspberry Pi4 vB running Ubuntu server 20.04TLS.
WireGuard VPN works just fine, WGDashboard is not so well, got it UP and running but getting weird behavior, please see the screenshots.

WG peers listed

Then when the dashboard refreshes this is what I get, even hosts are still connected.
Oops! No peers found ‘︿’

If I refresh or click on wg0 interface, I can see connected peers again for a while.
Any idea what could be causing this, please?

Thank you
MG

UPDATE:
It seems to be an issue with the latest Firefox 96.0, tried only on the MAC OS version, Safari works fine, will try Win version and Chrome too, but I know it's not a WGDasboard issue.

BTW this project is the best one for me, easy to install and run, etc.....

Thank you!
MG

UPDATE: It seems to be an issue with the latest Firefox 96.0, tried only on the MAC OS version, Safari works fine, will try Win version and Chrome too, but I know it's not a WGDasboard issue.

BTW this project is the best one for me, easy to install and run, etc.....

Thank you! MG

Hi! I'm so glad that you like this project, thanks you! I've noticed that Firefox would act weird sometimes and tried to fix it in the next release (coming soon!).

UPDATE2:
Hello all, only Firefox browser on Windows, MacOS, Linux is having issues as described above. Chrome, Safari, Internet Explorer and Edge are working properly.
Kind Regards
MG

Got it working on Raspbian.

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian

Needed to add a few things:
apt install libopenjp2-7
apt install libtiff5

Once I added these, worked like a charm.

Just tried it out on a (still in beta) Ubuntu 20.04 Jammy Jellyfish qemu VM - was able to log in, add a peer and download config.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu Jammy Jellyfish (development branch)"

Running on bullseye!
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Running on Arch, btw

NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling

works ok on Ubuntu 22.04

just need to install pip and tools before:
apt install python3-pip net-tools

Centos Stream 9

Running successfully no errors. 👍

  • Kernel: 5.14.0-407.el9.x86_64

cat /etc/os-release

NAME="CentOS Stream"
VERSION="9"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="9"
PLATFORM_ID="platform:el9"
PRETTY_NAME="CentOS Stream 9"
ANSI_COLOR="0;31"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:centos:centos:9"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

systemctl status wg-dashboard

● wg-dashboard.service
     Loaded: loaded (/etc/systemd/system/wg-dashboard.service; enabled; preset: disabled)
     Active: active (running) since Mon 2024-01-22 00:42:06 EST; 35min ago
   Main PID: 4499 (python3)
      Tasks: 1 (limit: 22727)
     Memory: 35.9M
        CPU: 8.512s
     CGroup: /system.slice/wg-dashboard.service
             └─4499 /usr/bin/python3 /opt/wgdashboard/src/dashboard.py