Changed dashboard naming to WGDashboard

This commit is contained in:
Donald Cheng Hong Zou 2021-09-08 21:56:31 -04:00
parent 53118cf660
commit 03a4acd72b
6 changed files with 37 additions and 39 deletions

View file

@ -4,9 +4,10 @@
<p align="center">
<img alt="Wireguard Dashboard Logo" src="img/logo.png" width="128">
<img alt="WGDashboard" src="img/logo.png" width="128">
</p>
<h1 align="center">Wireguard Dashboard</h1>
<h1 align="center">WGDashboard</h1>
<p align="center"><small>Originally: Wireguard Dashboard</small></p>
<p align="center">
<img src="http://ForTheBadge.com/images/badges/made-with-python.svg">
@ -16,11 +17,10 @@
</p>
<p align="center">Monitoring WireGuard is not convinient, need to login into server and type <code>wg show</code>. That's why this platform is being created, to view all configurations and manage them in a easier way.</p>
## 📣 What's New: v2.3
- 🎉 **New Features**
- **Update directly from `wgd.sh`:** Now you can update Wireguard Dashboard directly from the bash script.
- **Update directly from `wgd.sh`:** Now you can update WGDashboard directly from the bash script.
- **Displaying Peers:** You can switch the display mode between list and table in the configuration page.
- 🪚 **Bug Fixed**
- [Peer DNS Validation Fails #67](https://github.com/donaldzou/wireguard-dashboard/issues/67): Added DNS format check. [❤️ @realfian]
@ -42,8 +42,8 @@
- [📝 Requirement](#-requirement)
- [🛠 Install](#-install)
- [🪜 Usage](#-usage)
- [Start/Stop/Restart Wireguard Dashboard](#startstoprestart-wireguard-dashboard)
- [Autostart Wireguard Dashboard on boot](#autostart-wireguard-dashboard-on-boot)
- [Start/Stop/Restart WGDashboard](#startstoprestart-wireguard-dashboard)
- [Autostart WGDashboard on boot](#autostart-wireguard-dashboard-on-boot)
- [✂️ Dashboard Configuration](#%EF%B8%8F-dashboard-configuration)
- [Dashboard Configuration file](#dashboard-configuration-file)
- [Generating QR code and peer configuration file (.conf)](#generating-qr-code-and-peer-configuration-file-conf)
@ -74,7 +74,7 @@
> **If you have tested on other OS and it works perfectly please provide it to me in [#31](https://github.com/donaldzou/wireguard-dashboard/issues/31). Thank you!**
- **WireGuard** and **Wireguard-Tools (`wg-quick`)** are installed.
- **WireGuard** and **WireGuard-Tools (`wg-quick`)** are installed.
> Don't know how? Check this <a href="https://www.wireguard.com/install/">official documentation</a>
@ -97,18 +97,18 @@
- Python 3.7+ & Pip3
## 🛠 Install
1. **Download Wireguard Dashboard**
1. Download WGDashboard
```shell
git clone -b v2.3 https://github.com/donaldzou/wireguard-dashboard.git
2. Open the Wireguard Dashboard folder
2. Open the WGDashboard folder
```shell
cd wireguard-dashboard/src
```
3. Install Wireguard Dashboard
3. Install WGDashboard
```shell
sudo chmod u+x wgd.sh
@ -121,7 +121,7 @@
sudo chmod -R 755 /etc/wireguard
```
5. Run Wireguard Dashboard
5. Run WGDashboard
```shell
./wgd.sh start
@ -137,7 +137,7 @@
## 🪜 Usage
#### Start/Stop/Restart Wireguard Dashboard
#### Start/Stop/Restart WGDashboard
```shell
@ -152,7 +152,7 @@ cd Wireguard-Dashboard/src
./wgd.sh restart # Restart the dasboard
```
#### Autostart Wireguard Dashboard on boot (>= v2.2)
#### Autostart WGDashboard on boot (>= v2.2)
In the `src` folder, it contained a file called `wg-dashboard.service`, we can use this file to let our system to autostart the dashboard after reboot. The following guide has tested on **Ubuntu**, most **Debian** based OS might be the same, but some might not. Please don't hesitate to provide your system if you have tested the autostart on another system.
@ -247,7 +247,7 @@ In the `src` folder, it contained a file called `wg-dashboard.service`, we can u
└─6602 /usr/bin/python3 /root/wireguard-dashboard/src/dashboard.py
Aug 03 22:31:26 ubuntu-wg systemd[1]: Started wg-dashboard.service.
Aug 03 22:31:27 ubuntu-wg python3[6602]: * Serving Flask app "Wireguard Dashboard" (lazy loading)
Aug 03 22:31:27 ubuntu-wg python3[6602]: * Serving Flask app "WGDashboard" (lazy loading)
Aug 03 22:31:27 ubuntu-wg python3[6602]: * Environment: production
Aug 03 22:31:27 ubuntu-wg python3[6602]: WARNING: This is a development server. Do not use it in a production deployment.
Aug 03 22:31:27 ubuntu-wg python3[6602]: Use a production WSGI server instead.
@ -273,7 +273,7 @@ In the `src` folder, it contained a file called `wg-dashboard.service`, we can u
#### Dashboard Configuration file
Since version 2.0, Wireguard Dashboard will be using a configuration file called `wg-dashboard.ini`, (It will generate automatically after first time running the dashboard). More options will include in future versions, and for now it included the following config:
Since version 2.0, WGDashboard will be using a configuration file called `wg-dashboard.ini`, (It will generate automatically after first time running the dashboard). More options will include in future versions, and for now it included the following config:
| | Description | Default | Available in Setting |
| --------------- | ------------------------------------------------------------ | ------------------------ | -------------------- |
@ -288,8 +288,6 @@ Since version 2.0, Wireguard Dashboard will be using a configuration file called
| | If `auth_req = false` , user will not be access the **Setting** tab due to security consideration. **User can only edit the file directly in system**. | | |
| `version` | Dashboard Version | `v2.2` | No |
<p align=center>Latest Version: v2.2</p>
**Except `auth_req` due to security consideration.**
#### Generating QR code and peer configuration file (.conf)

View file

@ -1,5 +1,5 @@
"""
< Wireguard Dashbaord > - by Donald Zou [https://github.com/donaldzou]
< WGDashboard > - by Donald Zou [https://github.com/donaldzou]
Under Apache-2.0 License
"""
@ -28,7 +28,7 @@ dashboard_conf = 'wg-dashboard.ini'
# Upgrade Required
update = ""
# Flask App Configuration
app = Flask("Wireguard Dashboard")
app = Flask("WGDashboard")
app.secret_key = secrets.token_urlsafe(16)
app.config['TEMPLATES_AUTO_RELOAD'] = True
# Enable QR Code Generator

View file

@ -1,7 +1,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Wireguard Dashboard | {{ title }}</title>
<title>WGDashboard | {{ title }}</title>
<link rel="icon" href="{{ url_for('static',filename='img/logo.png') }}"/>
<link rel="stylesheet" href="{{ url_for('static',filename='css/bootstrap.min.css') }}">
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='css/dashboard.css') }}">

View file

@ -1,5 +1,5 @@
<nav class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
<a class="navbar-brand col-md-3 col-lg-2 mr-0 px-3" href="/">Wireguard Dashboard</a>
<a class="navbar-brand col-md-3 col-lg-2 mr-0 px-3" href="/">WGDashboard</a>
<button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-toggle="collapse"
data-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>

View file

@ -2,7 +2,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Wireguard Dashboard | Login</title>
<title>WGDashboard | Login</title>
<link rel="icon" href="{{ url_for('static',filename='logo.png') }}"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='css/dashboard.css') }}">

View file

@ -1,21 +1,21 @@
#!/bin/bash
app_name="dashboard.py"
app_official_name="Wireguard Dashboard"
app_official_name="WGDashboard"
dashes='------------------------------------------------------------'
equals='============================================================'
help () {
printf "=================================================================================\n"
printf "+ <Wireguard Dashboard> by Donald Zou - https://github.com/donaldzou +\n"
printf "+ <WGDashboard> by Donald Zou - https://github.com/donaldzou +\n"
printf "=================================================================================\n"
printf "| Usage: ./wgd.sh <option> |\n"
printf "| |\n"
printf "| Available options: |\n"
printf "| start: To start Wireguard Dashboard |\n"
printf "| stop: To stop Wireguard Dashboard. |\n"
printf "| debug: To start Wireguard Dashboard in debug mode (i.e run in foreground). |\n"
printf "| update: To update Wireguard Dashboard to the newest version from GitHub. |\n"
printf "| install: To install Wireguard Dashboard. |\n"
printf "| start: To start WGDashboard. |\n"
printf "| stop: To stop WGDashboard. |\n"
printf "| debug: To start WGDashboard in debug mode (i.e run in foreground). |\n"
printf "| update: To update WGDashboard to the newest version from GitHub. |\n"
printf "| install: To install WGDashboard. |\n"
printf "| Thank you for using! Your support is my motivation ;) |\n"
printf "=================================================================================\n"
}
@ -24,7 +24,7 @@ install_wgd(){
# Check Python3 version
version_pass=$(python3 -c 'import sys; print("1") if (sys.version_info.major == 3 and sys.version_info.minor >= 7) else print("0");')
if [ $version_pass == "0" ]
then printf "| Wireguard Dashboard required Python3.7+ |\n"
then printf "| WGDashboard required Python3.7+ |\n"
printf "%s\n" "$dashes"
exit 1
fi
@ -34,7 +34,7 @@ install_wgd(){
fi
printf "| Installing latest Python dependencies |\n"
python3 -m pip install -r requirements.txt > /dev/null 2>&1
printf "| Wireguard Dashboard installed successfully! |\n"
printf "| WGDashboard installed successfully! |\n"
printf "| Starting Dashboard |\n"
start_wgd
}
@ -51,7 +51,7 @@ check_wgd_status(){
start_wgd () {
printf "%s\n" "$dashes"
printf "| Starting Wireguard Dashboard in the background. |\n"
printf "| Starting WGDashboard in the background. |\n"
if [ ! -d "log" ]
then mkdir "log"
fi
@ -67,7 +67,7 @@ stop_wgd() {
start_wgd_debug() {
printf "%s\n" "$dashes"
printf "| Starting Wireguard Dashboard in the foreground. |\n"
printf "| Starting WGDashboard in the foreground. |\n"
python3 "$app_name"
printf "%s\n" "$dashes"
}
@ -78,7 +78,7 @@ update_wgd() {
printf "| Are you sure you want to update to the %s? (Y/N): " "$new_ver"
read up
if [ "$up" = "Y" ]; then
printf "| Shutting down Wireguard Dashboard... |\n"
printf "| Shutting down WGDashboard... |\n"
kill "$(ps aux | grep "[p]ython3 $app_name" | awk '{print $2}')"
printf "| Downloading %s from GitHub... |\n" "$new_ver"
git stash > /dev/null 2>&1
@ -102,7 +102,7 @@ if [ "$#" != 1 ];
if [ "$1" = "start" ]; then
if check_wgd_status; then
printf "%s\n" "$dashes"
printf "| Wireguard Dashboard is already running. |\n"
printf "| WGDashboard is already running. |\n"
printf "%s\n" "$dashes"
else
start_wgd
@ -111,11 +111,11 @@ if [ "$#" != 1 ];
if check_wgd_status; then
printf "%s\n" "$dashes"
stop_wgd
printf "| Wireguard Dashboard is stopped. |\n"
printf "| WGDashboard is stopped. |\n"
printf "%s\n" "$dashes"
else
printf "%s\n" "$dashes"
printf "| Wireguard Dashboard is not running. |\n"
printf "| WGDashboard is not running. |\n"
printf "%s\n" "$dashes"
fi
elif [ "$1" = "update" ]; then
@ -126,7 +126,7 @@ if [ "$#" != 1 ];
if check_wgd_status; then
printf "%s\n" "$dashes"
stop_wgd
printf "| Wireguard Dashboard is stopped. |\n"
printf "| WGDashboard is stopped. |\n"
sleep 2
start_wgd
else
@ -134,7 +134,7 @@ if [ "$#" != 1 ];
fi
elif [ "$1" = "debug" ]; then
if check_wgd_status; then
printf "| Wireguard Dashboard is already running. |\n"
printf "| WGDashboard is already running. |\n"
else
start_wgd_debug
fi