mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-21 23:01:39 +01:00
Update dashboard.py
This commit is contained in:
parent
3c50e4768a
commit
9312e168cb
@ -592,7 +592,8 @@ class WireguardConfiguration:
|
||||
def __getPeers(self):
|
||||
|
||||
mt = os.path.getmtime(os.path.join(WG_CONF_PATH, f'{self.Name}.conf'))
|
||||
# if self.__configFileModifiedTime is None or self.__configFileModifiedTime != mt:
|
||||
if self.__configFileModifiedTime is None or self.__configFileModifiedTime != mt:
|
||||
print(f"[WGDashboard] WireGuard configuration file modified. Reading {self.Name}.conf now")
|
||||
self.Peers = []
|
||||
with open(os.path.join(WG_CONF_PATH, f'{self.Name}.conf'), 'r') as configFile:
|
||||
p = []
|
||||
@ -1368,7 +1369,10 @@ def _getWireguardConfigurationAvailableIP(configName: str) -> tuple[bool, list[s
|
||||
add = p.allowed_ip.split(',')
|
||||
for i in add:
|
||||
a, c = i.split('/')
|
||||
try:
|
||||
existedAddress.append(ipaddress.ip_address(a.replace(" ", "")))
|
||||
except ValueError as e:
|
||||
print("[WGDashboard] Error: " + str(e))
|
||||
|
||||
for p in configuration.getRestrictedPeersList():
|
||||
if len(p.allowed_ip) > 0:
|
||||
@ -2127,8 +2131,6 @@ def API_Welcome_Finish():
|
||||
"repeatNewPassword": data["repeatNewPassword"],
|
||||
"currentPassword": "admin"
|
||||
})
|
||||
# updateEnableTotp, updateEnableTotpErr = DashboardConfig.SetConfig("Account", "enable_totp", data["enable_totp"])
|
||||
|
||||
if not updateUsername or not updatePassword:
|
||||
return ResponseObject(False, f"{updateUsernameErr},{updatePasswordErr}".strip(","))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user