From 7f4da826b1b05bc605025fd550c6abe41debdca8 Mon Sep 17 00:00:00 2001 From: Leif Date: Thu, 13 Feb 2025 23:04:27 -0900 Subject: [PATCH] Fix version checking don't just check for string differences, but compare the version numbering using packaging.version --- src/dashboard.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index d29ee9a..e7bb86a 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -15,6 +15,7 @@ from Utilities import ( ValidateIPAddressesWithRange, ValidateDNSAddress, GenerateWireguardPublicKey, GenerateWireguardPrivateKey ) +from packaging import version from modules.Email import EmailSender from modules.Log import Log from modules.DashboardLogger import DashboardLogger @@ -2821,7 +2822,7 @@ def API_getDashboardUpdate(): tagName = data.get('tag_name') htmlUrl = data.get('html_url') if tagName is not None and htmlUrl is not None: - if tagName != DASHBOARD_VERSION: + if version.parse(tagName) > version.parse(DASHBOARD_VERSION): return ResponseObject(message=f"{tagName} is now available for update!", data=htmlUrl) else: return ResponseObject(message="You're on the latest version") @@ -3079,4 +3080,4 @@ def startThreads(): if __name__ == "__main__": startThreads() - app.run(host=app_ip, debug=False, port=app_port) \ No newline at end of file + app.run(host=app_ip, debug=False, port=app_port)