Compare commits

...

6 commits

Author SHA1 Message Date
Martin bb91e68983
Merge e35f942964 into 891990b2f1 2024-09-14 15:44:53 +08:00
Donald Zou 891990b2f1
Merge pull request #387 from donaldzou/v4.0.3-fix
Ready for v4.0.3
2024-09-14 15:44:26 +08:00
Donald Zou e9ab7029c9 Ready for v4.0.3 2024-09-14 15:21:10 +08:00
Donald Zou 6f681dba09
Merge pull request #386 from donaldzou/v4.0.3-fix
Update privatePublicKeyInput.vue
2024-09-14 15:14:50 +08:00
Donald Zou b3edff947d Update privatePublicKeyInput.vue
Fixed issue mentioned in #375
2024-09-14 15:13:47 +08:00
Martin e35f942964
Update dashboard.py - sort WG configurations
Sort WG configurations alphabetically
2024-09-04 14:40:04 +02:00
6 changed files with 43 additions and 29 deletions

View file

@ -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:

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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;