1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-23 07:30:11 +01:00

Fixed issues with dashboard version missing from config

This commit is contained in:
theonlynexus 2022-07-21 06:36:07 +00:00
parent b16c7f24ff
commit 4ed3b36254
2 changed files with 8 additions and 15 deletions

View File

@ -618,12 +618,11 @@ def check_update(config):
for i in output:
if not i["prerelease"]:
release.append(i)
if config.get("Server", "version") == release[0]["tag_name"]:
result = "false"
else:
result = "true"
return result
if config["Server"]["version"] > release[0]["tag_name"]:
return "true"
return "false"
except urllib.error.HTTPError:
return "false"
@ -635,7 +634,7 @@ Configure DashBoard before start web-server
def run_dashboard():
global UPDATE
config = util.read_dashboard_conf(DASHBOARD_CONF_FILE)
config = read_and_update_config_file()
UPDATE = check_update(config)
# global app_ip
app_ip = config.get("Server", "app_ip")
@ -661,13 +660,4 @@ def get_host_bind():
if __name__ == "__main__":
# UPDATE = check_update()
# config = util.read_dashboard_conf(DASHBOARD_CONF_FILE)
# # global app_ip
# app_ip = config.get("Server", "app_ip")
# # global app_port
# app_port = config.get("Server", "app_port")
# WG_CONF_PATH = config.get("Server", "wg_conf_path")
# config.clear()
# app.run(host=app_ip, debug=False, port=app_port)
run_dashboard()

View File

@ -1,9 +1,12 @@
from dashboard import DASHBOARD_VERSION
dash_config = {
"Account": {
"username": "admin",
"password": "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918",
},
"Server": {
"version": DASHBOARD_VERSION,
"wg_conf_path": "/etc/wireguard",
"auth_req": True,
"dashboard_refresh_interval": 60000,