mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-09-20 07:16:25 +08:00
Compare commits
6 commits
ec70d9dd46
...
bb91e68983
Author | SHA1 | Date | |
---|---|---|---|
bb91e68983 | |||
891990b2f1 | |||
e9ab7029c9 | |||
6f681dba09 | |||
b3edff947d | |||
e35f942964 |
|
@ -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):
|
||||
|
@ -1297,7 +1297,9 @@ def _regexMatch(regex, text):
|
|||
|
||||
def _getConfigurationList():
|
||||
# configurations = {}
|
||||
for i in os.listdir(WG_CONF_PATH):
|
||||
items = os.listdir(WG_CONF_PATH)
|
||||
items.sort()
|
||||
for i in items:
|
||||
if _regexMatch("^(.{1,}).(conf)$", i):
|
||||
i = i.replace('.conf', '')
|
||||
try:
|
||||
|
|
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