Compare commits

..

7 Commits
v2.2 ... v2.2.1

Author SHA1 Message Date
Donald Zou
c32ccfc9ed Merge pull request #51 from donaldzou/v2.2.1
V2.2.1
2021-08-16 15:29:49 -04:00
Donald Cheng Hong Zou
ef818388c8 Update dashboard.py 2021-08-16 15:28:43 -04:00
Donald Cheng Hong Zou
f5aa45a3e1 Update README.md 2021-08-16 15:27:10 -04:00
Donald Cheng Hong Zou
b7a047a743 Bug fixed 2021-08-16 15:26:15 -04:00
Donald Zou
05ec985453 Update README.md 2021-08-16 12:23:56 -04:00
Donald Cheng Hong Zou
88ed9c3e79 Update README.md 2021-08-15 02:23:35 -04:00
Donald Zou
3fb03c8dfe Update README.md 2021-08-15 00:16:36 -04:00
3 changed files with 18 additions and 16 deletions

View File

@@ -62,6 +62,7 @@
## 💡 Features
- **No need to re-configure existing WireGuard configuration! It can search for existed configuration files.**
- Easy to use interface, provided username and password protection to the dashboard
- Add peers and edit (Allowed IPs, DNS, Private Key...)
- View peers and configuration real time details (Data Usage, Latest Handshakes...)
@@ -90,7 +91,9 @@
[Interface]
...
SaveConfig = true
# Need to include this line to allow WireGuard Tool to save your configuration
# Need to include this line to allow WireGuard Tool to save your configuration,
# or if you just want it to monitor your WireGuard Interface and don't need to
# make any changes with the dashboard, you can set it to false.
[Peer]
PublicKey = abcd1234
@@ -320,8 +323,8 @@ Endpoint = 0.0.0.0:51820
| `DNS` | The DNS server your peer will use | `1.1.1.1` - Cloud flare DNS, you can change it when you adding the peer or in the peer setting. | Yes |
| **`[Peer]`** | | | |
| `PublicKey` | The public key of your server | N/A | No |
| `AllowedIPs` | IP ranges for which a peer will route traffic | `0.0.0.0/0` - Indicated a default route to send all internet and VPN traffic through that peer. | No |
| `Endpoint` | Your wireguard server ip and port, the dashboard will search for your server's default interface's ip. | `<your server default interface ip>:<listen port>` | No |
| `AllowedIPs` | IP ranges for which a peer will route traffic | `0.0.0.0/0` - Indicated a default route to send all internet and VPN traffic through that peer. | Yes |
| `Endpoint` | Your wireguard server ip and port, the dashboard will search for your server's default interface's ip. | `<your server default interface ip>:<listen port>` | Yes |
## ❓ How to update the dashboard?
@@ -331,6 +334,7 @@ Endpoint = 0.0.0.0:51820
```
2. Get the newest version
```shell
sudo git stash
sudo git pull https://github.com/donaldzou/wireguard-dashboard.git v2.2 --force
```
3. Update and install all python dependencies
@@ -344,31 +348,22 @@ Endpoint = 0.0.0.0:51820
## 🔍 Screenshot
![Sign In Page](img/SignIn.png)
<p align=center>Sign In</p>
![Index Image](img/HomePage.png)
<p align=center>Home</p>
![Configuration](img/Configuration.png)
<p align=center>Configuration</p>
![Add Peer](img/AddPeer.png)
<p align=center>Add Peer</p>
![Edit Peer](img/EditPeer.png)
<p align=center>Edit Peer</p>
![Delete Peer](img/DeletePeer.png)
<p align=center>Delete Peer</p>
![Dashboard Setting](img/DashboardSetting.png)
<p align=center>Dashboard Setting</p>
![Ping](img/Ping.png)
<p align=center>Ping</p>
![Traceroute](img/Traceroute.png)
<p align=center>Traceroute</p>

View File

@@ -18,7 +18,7 @@ from tinydb import TinyDB, Query
from icmplib import ping, multiping, traceroute, resolve, Host, Hop
# Dashboard Version
dashboard_version = 'v2.2'
dashboard_version = 'v2.2.1'
# Dashboard Config Name
dashboard_conf = 'wg-dashboard.ini'
# Default Wireguard IP
@@ -107,7 +107,7 @@ def read_conf_file(config_name):
conf_peers = file[peers_start:]
peer = -1
for i in conf_peers:
if not is_match("^#(.*)", i):
if not is_match("#(.*)", i):
if i == "[Peer]":
peer += 1
conf_peer_data["Peers"].append({})
@@ -388,7 +388,8 @@ def cleanIpWithRange(ip):
def checkIpWithRange(ip):
return is_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}(0|8|16|24|32)(,|$)", ip)
return is_match("((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}(0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|"+
"18|19|20|21|22|23|24|25|26|27|28|29|30|31|32)(,|$)", ip)
def checkAllowedIPs(ip):
@@ -769,7 +770,6 @@ def add_peer(config_name):
return "Allowed IP already taken by another peer."
if not checkIp(DNS):
return "DNS formate is incorrect. Example: 1.1.1.1"
if not checkAllowedIPs(endpoint_allowed_ip):
return "Endpoint Allowed IPs format is incorrect."
else:
@@ -829,6 +829,9 @@ def save_peer_setting(config_name):
peers = Query()
if len(db.search(peers.id == id)) == 1:
check_ip = checkAllowedIP(id, allowed_ip, config_name)
if not checkIpWithRange(endpoint_allowed_ip):
return jsonify({"status": "failed", "msg": "Endpoint Allowed IPs format is incorrect."})
if private_key != "":
check_key = checkKeyMatch(private_key, id, config_name)
if check_key['status'] == "failed":

View File

@@ -96,6 +96,8 @@ $("#save_peer").click(function(){
}else{
$("#add_peer_alert").html("Please fill in all required box.");
$("#add_peer_alert").removeClass("d-none");
$(this).removeAttr("disabled")
$(this).html("Save")
}
})
var qrcodeModal = new bootstrap.Modal(document.getElementById('qrcode_modal'), {
@@ -249,6 +251,8 @@ $("#save_peer_setting").click(function (){
}else{
$("#setting_peer_alert").html("Please fill in all required box.");
$("#setting_peer_alert").removeClass("d-none");
$("#save_peer_setting").removeAttr("disabled")
$("#save_peer_setting").html("Save")
}