From 2689a579a73dbbef721775973c505fe196109521 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 14 Jan 2022 16:06:02 -0500 Subject: [PATCH 1/2] fix bug where transveral would be true every delete file due to typo --- app/classes/shared/server.py | 1 + app/classes/web/ajax_handler.py | 2 +- app/classes/web/panel_handler.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index e445bef9..ea4af70a 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -14,6 +14,7 @@ import zlib import html import apscheduler from apscheduler.schedulers.background import BackgroundScheduler +#TZLocal is set as a hidden import on win pipeline from tzlocal import get_localzone diff --git a/app/classes/web/ajax_handler.py b/app/classes/web/ajax_handler.py index d8f472aa..f05bba3b 100644 --- a/app/classes/web/ajax_handler.py +++ b/app/classes/web/ajax_handler.py @@ -371,7 +371,7 @@ class AjaxHandler(BaseHandler): return # Delete the file - if helper.validate_traversal(helper.get_os_understandable_path(server_info['path']), file_path): + if helper.validate_traversal(helper.get_os_understandable_path(server_info['backup_path']), file_path): os.remove(file_path) elif page == "del_dir": diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 9a90836f..07eb96c9 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -12,6 +12,8 @@ import shutil import tempfile import threading from cron_validator import CronValidator +#TZLocal is set as a hidden import on win pipeline +from tzlocal import get_localzone from tornado import locale from tornado import iostream @@ -81,7 +83,7 @@ class PanelHandler(BaseHandler): page_data = { # todo: make this actually pull and compare version data 'update_available': False, - 'serverTZ': time.tzname, + 'serverTZ':get_localzone(), 'version_data': helper.get_version_string(), 'user_data': exec_user_data, 'user_role' : exec_user_role, From a9b4c215823bcf2c5508dca9706e4365517adde0 Mon Sep 17 00:00:00 2001 From: Iain Powrie Date: Fri, 14 Jan 2022 21:43:41 +0000 Subject: [PATCH 2/2] Change apscheduler to hidden-import in pipeline Diagnose module not found windows pyinstaller error --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db0c1639..83e7283e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -117,9 +117,9 @@ win-dev-build: --paths .venv\Lib\site-packages --hidden-import cryptography --hidden-import cffi + --hidden-import apscheduler --collect-all tzlocal --collect-all tzdata - --collect-all apscheduler artifacts: name: "crafty-${CI_RUNNER_TAGS}-${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}" paths: @@ -155,9 +155,9 @@ win-prod-build: --paths .venv\Lib\site-packages --hidden-import cryptography --hidden-import cffi + --hidden-import apscheduler --collect-all tzlocal --collect-all tzdata - --collect-all apscheduler artifacts: name: "crafty-${CI_RUNNER_TAGS}-${CI_COMMIT_BRANCH}_${CI_COMMIT_SHORT_SHA}" paths: