mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Merge pull request #389 from donaldzou/v4.0.3-fix
Merge new changes to v4.1
This commit is contained in:
commit
d74a76dee3
@ -1,7 +1,3 @@
|
||||
> [!WARNING]
|
||||
> For users who installed the Docker solution under `./docker`, please view this important message: https://github.com/donaldzou/WGDashboard/issues/333
|
||||
<hr>
|
||||
|
||||
<p align="center">
|
||||
<img alt="WGDashboard" src="./src/static/img/logo.png" width="128">
|
||||
</p>
|
||||
|
@ -33,6 +33,7 @@ import threading
|
||||
|
||||
from flask.json.provider import DefaultJSONProvider
|
||||
|
||||
|
||||
DASHBOARD_VERSION = 'v4.1'
|
||||
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
|
||||
DB_PATH = os.path.join(CONFIGURATION_PATH, 'db')
|
||||
@ -1111,7 +1112,7 @@ class DashboardConfig:
|
||||
"peer_global_DNS": "1.1.1.1",
|
||||
"peer_endpoint_allowed_ip": "0.0.0.0/0",
|
||||
"peer_display_mode": "grid",
|
||||
"remote_endpoint": ifcfg.default_interface()['inet'],
|
||||
"remote_endpoint": ifcfg.default_interface()['inet'] if ifcfg.default_interface() else '',
|
||||
"peer_MTU": "1420",
|
||||
"peer_keep_alive": "21"
|
||||
},
|
||||
|
2
src/static/app/dist/assets/index.css
vendored
2
src/static/app/dist/assets/index.css
vendored
File diff suppressed because one or more lines are too long
8
src/static/app/dist/assets/index.js
vendored
8
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 New Issue
Block a user