mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-09-20 07:16:25 +08:00
Compare commits
7 commits
4313d66061
...
ce5f3c4e8a
Author | SHA1 | Date | |
---|---|---|---|
ce5f3c4e8a | |||
891990b2f1 | |||
e9ab7029c9 | |||
6f681dba09 | |||
b3edff947d | |||
fa5b28e2ee | |||
32a6678378 |
|
@ -33,7 +33,7 @@ import threading
|
|||
|
||||
from flask.json.provider import DefaultJSONProvider
|
||||
|
||||
DASHBOARD_VERSION = 'v4.0.2'
|
||||
DASHBOARD_VERSION = 'v4.0.3'
|
||||
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
||||
DB_PATH = os.path.join(CONFIGURATION_PATH, 'db')
|
||||
if not os.path.isdir(DB_PATH):
|
||||
|
|
|
@ -7,6 +7,9 @@ CHAIN_NAME="WIREGUARD_$WIREGUARD_INTERFACE"
|
|||
|
||||
iptables -t nat -D POSTROUTING -o $MASQUERADE_INTERFACE -j MASQUERADE -s $WIREGUARD_LAN
|
||||
|
||||
# Remove the drop rules between the peers
|
||||
iptables -D FORWARD -i $WIREGUARD_INTERFACE -o $WIREGUARD_INTERFACE -j DROP
|
||||
|
||||
# Remove and delete the WIREGUARD_wg0 chain
|
||||
iptables -D FORWARD -j $CHAIN_NAME
|
||||
iptables -F $CHAIN_NAME
|
||||
|
|
|
@ -22,5 +22,8 @@ iptables -A $CHAIN_NAME -o lo -j ACCEPT
|
|||
# Drop everything else coming through the Wireguard interface
|
||||
iptables -A $CHAIN_NAME -i $WIREGUARD_INTERFACE -j DROP
|
||||
|
||||
# Drop traffic between the peers
|
||||
iptables -I FORWARD -i $WIREGUARD_INTERFACE -o $WIREGUARD_INTERFACE -j DROP
|
||||
|
||||
# Return to FORWARD chain
|
||||
iptables -A $CHAIN_NAME -j RETURN
|
BIN
src/static/app/dist/assets/bootstrap-icons.woff
vendored
BIN
src/static/app/dist/assets/bootstrap-icons.woff
vendored
Binary file not shown.
BIN
src/static/app/dist/assets/bootstrap-icons.woff2
vendored
BIN
src/static/app/dist/assets/bootstrap-icons.woff2
vendored
Binary file not shown.
6
src/static/app/dist/assets/index.css
vendored
6
src/static/app/dist/assets/index.css
vendored
File diff suppressed because one or more lines are too long
40
src/static/app/dist/assets/index.js
vendored
40
src/static/app/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -30,12 +30,24 @@ export default {
|
|||
this.data.private_key = this.keypair.privateKey;
|
||||
this.data.public_key = this.keypair.publicKey;
|
||||
},
|
||||
testKey(key){
|
||||
const reg = /^[A-Za-z0-9+/]{43}=?=?$/;
|
||||
return reg.test(key)
|
||||
},
|
||||
checkMatching(){
|
||||
try{
|
||||
if (window.wireguard.generatePublicKey(this.keypair.privateKey)
|
||||
!== this.keypair.publicKey){
|
||||
this.error = true;
|
||||
this.dashboardStore.newMessage("WGDashboard", "Private Key and Public Key does not match.", "danger");
|
||||
if(this.keypair.privateKey){
|
||||
if(this.testKey(this.keypair.privateKey)){
|
||||
this.keypair.publicKey = window.wireguard.generatePublicKey(this.keypair.privateKey)
|
||||
if (window.wireguard.generatePublicKey(this.keypair.privateKey)
|
||||
!== this.keypair.publicKey){
|
||||
this.error = true;
|
||||
this.dashboardStore.newMessage("WGDashboard", "Private Key and Public Key does not match.", "danger");
|
||||
}else{
|
||||
this.data.private_key = this.keypair.privateKey
|
||||
this.data.public_key = this.keypair.publicKey
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (e){
|
||||
this.error = true;
|
||||
|
|
Loading…
Reference in a new issue