From 3d4153f941a5a6460abe18db178b1edfc7203ee8 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 16 Jan 2024 15:36:14 -0500 Subject: [PATCH 01/34] Add lockout user for forgot password Hide lockout user from users list --- app/classes/controllers/users_controller.py | 43 +++++++++++++++++++ app/classes/models/users.py | 4 +- app/classes/web/base_handler.py | 6 ++- app/classes/web/routes/api/api_handlers.py | 6 +++ .../routes/api/crafty/antilockout/index.py | 24 +++++++++++ app/frontend/templates/public/login.html | 21 ++++++++- main.py | 2 + 7 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 app/classes/web/routes/api/crafty/antilockout/index.py diff --git a/app/classes/controllers/users_controller.py b/app/classes/controllers/users_controller.py index 87cc513c..510c562e 100644 --- a/app/classes/controllers/users_controller.py +++ b/app/classes/controllers/users_controller.py @@ -1,5 +1,9 @@ import logging import typing as t +import datetime +import os +import json +from apscheduler.schedulers.background import BackgroundScheduler from app.classes.models.servers import HelperServers from app.classes.models.users import HelperUsers @@ -22,6 +26,7 @@ class UsersController: self.helper = helper self.users_helper = users_helper self.authentication = authentication + self.scheduler = BackgroundScheduler(timezone="Etc/UTC") _permissions_props = { "name": { @@ -353,3 +358,41 @@ class UsersController: def delete_user_api_key(self, key_id: str): return self.users_helper.delete_user_api_key(key_id) + + # ********************************************************************************** + # Lockout Methods + # ********************************************************************************** + def start_anti_lockout(self, app_dir): + lockout_pass = self.helper.create_pass() + self.users_helper.add_user( + "anti-lockout-user", + None, + password=lockout_pass, + email="", + enabled=True, + superuser=True, + theme="ronald", + ) + with open( + os.path.join(app_dir, "app", "config", "anti-lockout.txt"), + "w", + encoding="utf-8", + ) as cred_file: + cred_file.write( + json.dumps( + {"username": "anti-lockout-user", "password": lockout_pass}, + indent=4, + ) + ) + os.chmod(os.path.join(app_dir, "app", "config", "anti-lockout.txt"), 0o600) + self.scheduler.add_job( + self.stop_anti_lockout, + "interval", + hours=1, + id="anti-lockout-watcher", + start_date=datetime.datetime.now(), + ) + + def stop_anti_lockout(self): + self.scheduler.remove_all_jobs() + self.users_helper.remove_user(self.get_id_by_name("anti-lockout-user")) diff --git a/app/classes/models/users.py b/app/classes/models/users.py index ccd8f1b0..e44d06fb 100644 --- a/app/classes/models/users.py +++ b/app/classes/models/users.py @@ -103,7 +103,9 @@ class HelperUsers: @staticmethod def get_all_users(): - query = Users.select().where(Users.username != "system") + query = Users.select().where( + Users.username != "system", Users.username != "anti-lockout-user" + ) return query @staticmethod diff --git a/app/classes/web/base_handler.py b/app/classes/web/base_handler.py index d8181b94..ad490c2f 100644 --- a/app/classes/web/base_handler.py +++ b/app/classes/web/base_handler.py @@ -12,6 +12,7 @@ from app.classes.shared.file_helpers import FileHelpers from app.classes.shared.main_controller import Controller from app.classes.shared.translation import Translation from app.classes.shared.main_models import DatabaseShortcuts +from app.classes.models.users import DoesNotExist logger = logging.getLogger(__name__) auth_log = logging.getLogger("auth") @@ -91,7 +92,10 @@ class BaseHandler(tornado.web.RequestHandler): t.Dict[str, t.Any]: The token's payload. t.Dict[str, t.Any]: The user's data from the database. """ - return self.controller.authentication.check(self.get_cookie("token")) + try: + return self.controller.authentication.check(self.get_cookie("token")) + except DoesNotExist: + return None def autobleach(self, name, text): for r in self.redactables: diff --git a/app/classes/web/routes/api/api_handlers.py b/app/classes/web/routes/api/api_handlers.py index 706c346f..21c78c04 100644 --- a/app/classes/web/routes/api/api_handlers.py +++ b/app/classes/web/routes/api/api_handlers.py @@ -79,6 +79,7 @@ from app.classes.web.routes.api.crafty.stats.stats import ApiCraftyHostStatsHand from app.classes.web.routes.api.crafty.clogs.index import ApiCraftyLogIndexHandler from app.classes.web.routes.api.crafty.imports.index import ApiImportFilesIndexHandler from app.classes.web.routes.api.crafty.exe_cache import ApiCraftyJarCacheIndexHandler +from app.classes.web.routes.api.crafty.antilockout.index import ApiCraftyLockoutHandler def api_handlers(handler_args): @@ -94,6 +95,11 @@ def api_handlers(handler_args): ApiAuthInvalidateTokensHandler, handler_args, ), + ( + r"/api/v2/crafty/resetPass/?", + ApiCraftyLockoutHandler, + handler_args, + ), ( r"/api/v2/crafty/announcements/?", ApiAnnounceIndexHandler, diff --git a/app/classes/web/routes/api/crafty/antilockout/index.py b/app/classes/web/routes/api/crafty/antilockout/index.py new file mode 100644 index 00000000..099f5a47 --- /dev/null +++ b/app/classes/web/routes/api/crafty/antilockout/index.py @@ -0,0 +1,24 @@ +import logging +from app.classes.web.base_api_handler import BaseApiHandler + +logger = logging.getLogger(__name__) + + +class ApiCraftyLockoutHandler(BaseApiHandler): + def get(self): + if self.controller.users.get_id_by_name("anti-lockout-user"): + return self.finish_json( + 425, {"status": "error", "data": "Lockout recovery already in progress"} + ) + self.controller.users.start_anti_lockout(self.controller.project_root) + lockout_msg = ( + "Lockout account has been activated for 1 hour." + " Please find credentials in confg/anti-lockout.txt" + ) + return self.finish_json( + 200, + { + "status": "ok", + "data": lockout_msg, + }, + ) diff --git a/app/frontend/templates/public/login.html b/app/frontend/templates/public/login.html index f66b6c53..1b39d8c4 100644 --- a/app/frontend/templates/public/login.html +++ b/app/frontend/templates/public/login.html @@ -112,8 +112,8 @@
 
- {{ translate('login', 'forgotPassword', - data['lang']) }} +
@@ -146,6 +146,7 @@ + + \ No newline at end of file diff --git a/main.py b/main.py index 75997247..ebaf7806 100644 --- a/main.py +++ b/main.py @@ -388,6 +388,8 @@ if __name__ == "__main__": # Master config.json in helpers.py Console.info("Checking for remote changes to config.json") controller.get_config_diff() + # Delete anti-lockout-user + controller.users.stop_anti_lockout() Console.info("Remote change complete.") # startup the web server From d82ee0fa3160e0272b4f8b434b6a61f9aacf5719 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 16 Jan 2024 18:01:22 -0500 Subject: [PATCH 02/34] start schedule --- app/classes/controllers/users_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/classes/controllers/users_controller.py b/app/classes/controllers/users_controller.py index 510c562e..bc143c31 100644 --- a/app/classes/controllers/users_controller.py +++ b/app/classes/controllers/users_controller.py @@ -27,6 +27,7 @@ class UsersController: self.users_helper = users_helper self.authentication = authentication self.scheduler = BackgroundScheduler(timezone="Etc/UTC") + self.scheduler.start() _permissions_props = { "name": { From f800933799a04fd9f85ef8009b41e29cf5123843 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Tue, 16 Jan 2024 23:09:04 -0500 Subject: [PATCH 03/34] Fix typo --- app/classes/web/routes/api/crafty/antilockout/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classes/web/routes/api/crafty/antilockout/index.py b/app/classes/web/routes/api/crafty/antilockout/index.py index 099f5a47..41493f88 100644 --- a/app/classes/web/routes/api/crafty/antilockout/index.py +++ b/app/classes/web/routes/api/crafty/antilockout/index.py @@ -13,7 +13,7 @@ class ApiCraftyLockoutHandler(BaseApiHandler): self.controller.users.start_anti_lockout(self.controller.project_root) lockout_msg = ( "Lockout account has been activated for 1 hour." - " Please find credentials in confg/anti-lockout.txt" + " Please find credentials in config/anti-lockout.txt" ) return self.finish_json( 200, From 665997c34cb2a42f2e4654b79956e6720a32c309 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Mon, 22 Jan 2024 19:51:57 -0500 Subject: [PATCH 04/34] Print to terminal not file --- app/classes/controllers/users_controller.py | 26 ++++++++----------- .../routes/api/crafty/antilockout/index.py | 4 +-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/app/classes/controllers/users_controller.py b/app/classes/controllers/users_controller.py index bc143c31..eb74f15c 100644 --- a/app/classes/controllers/users_controller.py +++ b/app/classes/controllers/users_controller.py @@ -1,8 +1,6 @@ import logging import typing as t import datetime -import os -import json from apscheduler.schedulers.background import BackgroundScheduler from app.classes.models.servers import HelperServers @@ -12,6 +10,7 @@ from app.classes.models.crafty_permissions import ( PermissionsCrafty, EnumPermissionsCrafty, ) +from app.classes.shared.console import Console logger = logging.getLogger(__name__) @@ -363,7 +362,7 @@ class UsersController: # ********************************************************************************** # Lockout Methods # ********************************************************************************** - def start_anti_lockout(self, app_dir): + def start_anti_lockout(self): lockout_pass = self.helper.create_pass() self.users_helper.add_user( "anti-lockout-user", @@ -374,18 +373,15 @@ class UsersController: superuser=True, theme="ronald", ) - with open( - os.path.join(app_dir, "app", "config", "anti-lockout.txt"), - "w", - encoding="utf-8", - ) as cred_file: - cred_file.write( - json.dumps( - {"username": "anti-lockout-user", "password": lockout_pass}, - indent=4, - ) - ) - os.chmod(os.path.join(app_dir, "app", "config", "anti-lockout.txt"), 0o600) + + Console.yellow( + f""" + Anti-lockout recovery account enabled! + {'/' * 74} + Username: anti-lockout-user + Password: {lockout_pass} + {'/' * 74}""" + ) self.scheduler.add_job( self.stop_anti_lockout, "interval", diff --git a/app/classes/web/routes/api/crafty/antilockout/index.py b/app/classes/web/routes/api/crafty/antilockout/index.py index 41493f88..0a9ab03a 100644 --- a/app/classes/web/routes/api/crafty/antilockout/index.py +++ b/app/classes/web/routes/api/crafty/antilockout/index.py @@ -10,10 +10,10 @@ class ApiCraftyLockoutHandler(BaseApiHandler): return self.finish_json( 425, {"status": "error", "data": "Lockout recovery already in progress"} ) - self.controller.users.start_anti_lockout(self.controller.project_root) + self.controller.users.start_anti_lockout() lockout_msg = ( "Lockout account has been activated for 1 hour." - " Please find credentials in config/anti-lockout.txt" + " Please find temporary credentials in the terminal" ) return self.finish_json( 200, From 9fed45d147f33ce632b1c11ab8152a1491b6f8de Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Fri, 26 Jan 2024 15:29:12 -0500 Subject: [PATCH 05/34] Only allow access to panel config --- app/classes/web/panel_handler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 8ac827c3..52d85acf 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -286,6 +286,8 @@ class PanelHandler(BaseHandler): ) tz = "Europe/London" + page = "panel_config" + page_data: t.Dict[str, t.Any] = { # todo: make this actually pull and compare version data "update_available": self.helper.update_available, From bb18400b90dfbd8b9bb8769c29d22a082b8e827e Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Fri, 26 Jan 2024 15:29:25 -0500 Subject: [PATCH 06/34] Fix schedule firing too early --- app/classes/controllers/users_controller.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/classes/controllers/users_controller.py b/app/classes/controllers/users_controller.py index eb74f15c..80a431bf 100644 --- a/app/classes/controllers/users_controller.py +++ b/app/classes/controllers/users_controller.py @@ -1,6 +1,7 @@ import logging import typing as t import datetime +from datetime import timedelta from apscheduler.schedulers.background import BackgroundScheduler from app.classes.models.servers import HelperServers @@ -384,12 +385,12 @@ class UsersController: ) self.scheduler.add_job( self.stop_anti_lockout, - "interval", - hours=1, + "date", id="anti-lockout-watcher", - start_date=datetime.datetime.now(), + run_date=datetime.datetime.now() + timedelta(hours=1), ) def stop_anti_lockout(self): + print("IN STOP") self.scheduler.remove_all_jobs() self.users_helper.remove_user(self.get_id_by_name("anti-lockout-user")) From 6e776d638330a588b938585172b6d6721e2e7e1a Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 12:15:00 -0500 Subject: [PATCH 07/34] Allow http to be disabled by config.json --- app/classes/web/tornado_handler.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/classes/web/tornado_handler.py b/app/classes/web/tornado_handler.py index f5501d31..82ae081c 100644 --- a/app/classes/web/tornado_handler.py +++ b/app/classes/web/tornado_handler.py @@ -112,7 +112,7 @@ class Webserver: cookie_secret = self.helper.random_string_generator(32) HelpersManagement.set_cookie_secret(cookie_secret) - if not http_port: + if not http_port and http_port != 0: http_port = 8000 if not https_port: @@ -190,9 +190,12 @@ class Webserver: login_url="/login", serve_traceback=debug_errors, ) - - self.http_server = tornado.httpserver.HTTPServer(http_app) - self.http_server.listen(http_port) + print(http_port) + if http_port != 0: + self.http_server = tornado.httpserver.HTTPServer(http_app) + self.http_server.listen(http_port) + else: + logger.info("http port disabled by config") self.https_server = tornado.httpserver.HTTPServer(app, ssl_options=cert_objects) self.https_server.listen(https_port) From 0fa7b592cc789912271535bbe23dcdf4ad39fa3b Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 12:58:02 -0500 Subject: [PATCH 08/34] Burn retinas - add warning banner Make warning system more robust --- app/frontend/templates/base.html | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 48c6ee95..546502a2 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -1,5 +1,5 @@ - + @@ -256,8 +256,9 @@ const sendWssError = () => wsOpen || warn( 'WebSockets are required for Crafty to work. This websocket connection has been closed. Are you using a reverse proxy?', - 'https://docs.craftycontrol.com/pages/getting-started/proxies/', - 'wssError' + link='https://docs.craftycontrol.com/pages/getting-started/proxies/', + link_msg="See our documentation for details", + className='wssError' ) function startWebSocket() { @@ -459,7 +460,7 @@ } - function warn(message, link = null, className = null) { + function warn(message, link = null, link_msg=null, className = null, bg_color="#f7970f") { var closeEl = document.createElement('span'); var strongEL = document.createElement('strong'); var msgEl = document.createElement('div'); @@ -481,14 +482,14 @@ var parentEl = document.createElement('div'); parentEl.style.padding = '20px'; - parentEl.style.backgroundColor = '#f7970f'; + parentEl.style.backgroundColor = bg_color; parentEl.appendChild(closeEl); parentEl.appendChild(msgEl); if (link) { let linkEl = document.createElement('a') linkEl.href = link; - linkEl.innerHTML = "See our documentation for details."; + linkEl.innerHTML = link_msg; linkEl.style.color = 'white'; linkEl.style.textDecoration = 'underline'; linkEl.target = "_blank"; @@ -580,6 +581,15 @@ $(document).ready(function () { console.log('%c[Crafty Controller] %cReady for JS!', 'font-weight: 900; color: #800080;', 'font-weight: 900; color: #eee;'); + if ($(document.documentElement).data("username") === "anti-lockout-user"){ + warn( + '⚠️You are in a recovery account. Access is limited!', + link='/logout', + link_msg="Click here to log out after you change your password. ⚠️", + className='anti-lockout', + bg_color='#2090d6' + ) + } $('#support_logs').click(function () { var dialog = bootbox.dialog({ message: "

{{ translate('notify', 'preparingLogs', data['lang']) }}

", From 854a9643e5fa176c4b8f32c991df402404c5d1b7 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 12:58:18 -0500 Subject: [PATCH 09/34] Fix bug where panel_config would always be loaded --- app/classes/web/panel_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 52d85acf..3cc276f2 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -285,8 +285,8 @@ class PanelHandler(BaseHandler): "Could not capture time zone from system. Falling back to Europe/London" ) tz = "Europe/London" - - page = "panel_config" + if exec_user["username"] == "anti-lockout-user": + page = "panel_config" page_data: t.Dict[str, t.Any] = { # todo: make this actually pull and compare version data From 5422915335a7b3a1d5019f203377b3199385825b Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 13:44:44 -0500 Subject: [PATCH 10/34] Delete user on logout --- app/classes/web/public_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 57e6ddd8..7df88f68 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -61,7 +61,11 @@ class PublicHandler(BaseHandler): template = "public/offline.html" elif page == "logout": + exec_user = self.get_current_user() self.clear_cookie("token") + # Delete anti-lockout-user on lockout...it's one time use + if exec_user[2]["username"] == "anti-lockout-user": + self.controller.users.stop_anti_lockout() # self.clear_cookie("user") # self.clear_cookie("user_data") self.redirect("/login") From a112bc3e579ca6d0dab2d20bb5d722f613597534 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 28 Jan 2024 16:51:54 -0500 Subject: [PATCH 11/34] Set time to UTC for schedule remove prints --- app/classes/controllers/users_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/classes/controllers/users_controller.py b/app/classes/controllers/users_controller.py index 80a431bf..c478f887 100644 --- a/app/classes/controllers/users_controller.py +++ b/app/classes/controllers/users_controller.py @@ -2,6 +2,7 @@ import logging import typing as t import datetime from datetime import timedelta +from zoneinfo import ZoneInfo from apscheduler.schedulers.background import BackgroundScheduler from app.classes.models.servers import HelperServers @@ -387,10 +388,9 @@ class UsersController: self.stop_anti_lockout, "date", id="anti-lockout-watcher", - run_date=datetime.datetime.now() + timedelta(hours=1), + run_date=datetime.datetime.now(ZoneInfo("Etc/UTC")) + timedelta(hours=1), ) def stop_anti_lockout(self): - print("IN STOP") self.scheduler.remove_all_jobs() self.users_helper.remove_user(self.get_id_by_name("anti-lockout-user")) From 06f59110fe308cdc1b7e646029ced3ab23b6097f Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 17:57:05 -0500 Subject: [PATCH 12/34] Add warning to wizard for unsupported mc --- app/frontend/templates/server/wizard.html | 17 ++++++++++++++++- app/translations/en_EN.json | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/frontend/templates/server/wizard.html b/app/frontend/templates/server/wizard.html index bb5fc175..6187088c 100644 --- a/app/frontend/templates/server/wizard.html +++ b/app/frontend/templates/server/wizard.html @@ -107,7 +107,8 @@
- +
@@ -1233,6 +1234,20 @@ } }) } + $("#server").change(function (){ + console.log(); + if($("#server :selected").text().split(".")[1] === "7"){ + $('[data-toggle="popover"]').popover(); + if ($(window).width() < 1000) { + $('.version-hint').attr("data-placement", "top") + } else { + $('.version-hint').attr("data-placement", "right") + } + $('.version-hint').popover("show"); + }else{ + $('.version-hint').popover("hide"); + } + }); function serverJarChange(selectObj) { const type_select = document.getElementById('server_jar') diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index a717c929..df26b13d 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -578,6 +578,7 @@ "serverUpload": "Upload Zipped Server", "serverVersion": "Server Version", "sizeInGB": "Size in GB", + "unsupported": "Minecraft versions lower than 1.8 are not supported by Crafty. You may still install it. Results will vary.", "uploadButton": "Upload", "uploadZip": "Upload Zip File For Server Import", "zipPath": "Server Path" From fb32f64a1319df7383a68d0cb3b94a711974f31f Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 28 Jan 2024 18:22:41 -0500 Subject: [PATCH 13/34] Improve logic just in case minecraft 2.0 --- app/frontend/templates/server/wizard.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/frontend/templates/server/wizard.html b/app/frontend/templates/server/wizard.html index 6187088c..2d84e6aa 100644 --- a/app/frontend/templates/server/wizard.html +++ b/app/frontend/templates/server/wizard.html @@ -1235,8 +1235,8 @@ }) } $("#server").change(function (){ - console.log(); - if($("#server :selected").text().split(".")[1] === "7"){ + let selected_version = $("#server :selected").text().split("."); + if(parseInt(selected_version[0]) === 1 && parseInt(selected_version[1]) < 8 ){ $('[data-toggle="popover"]').popover(); if ($(window).width() < 1000) { $('.version-hint').attr("data-placement", "top") From e48a3cc9761f4e5313b158a689e08950602ae216 Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Tue, 30 Jan 2024 22:03:58 +0100 Subject: [PATCH 14/34] Improving Display for Buttons --- app/frontend/static/assets/css/crafty.css | 486 +++++++++++++++++++++- 1 file changed, 481 insertions(+), 5 deletions(-) diff --git a/app/frontend/static/assets/css/crafty.css b/app/frontend/static/assets/css/crafty.css index cc1a8b82..55efaeb6 100644 --- a/app/frontend/static/assets/css/crafty.css +++ b/app/frontend/static/assets/css/crafty.css @@ -37,16 +37,16 @@ nav.sidebar { width: 10px; height: 10px; border-radius: 100%; - border: 2px solid #fff; + border: 2px solid var(--white); display: block; } .toggle-handle { - background-color: white !important; + background-color: var(--white) !important; } .toggle-on { - color: black !important; + color: var(--dark) !important; } .toggle { @@ -61,7 +61,7 @@ nav.sidebar { width: 10px; height: 10px; border-radius: 100%; - border: 2px solid #fff; + border: 2px solid var(--white); display: block; } @@ -95,7 +95,7 @@ nav.sidebar { } .scrollable-element { - scrollbar-color: red yellow; + scrollbar-color: var(--red) var(--yellow); } .term-nav-item { @@ -140,6 +140,454 @@ body { text-align: center; } +/**************************************************************/ +/* CSS for Toggle Buttons */ +/**************************************************************/ +.btn-toggle { + margin: 0 4rem; + padding: 0; + position: relative; + border: none; + height: 1.5rem; + width: 3rem; + border-radius: 1.5rem; + color: #6b7381; + background: #bdc1c8; +} + +.btn-toggle:focus, +.btn-toggle.focus, +.btn-toggle:focus.active, +.btn-toggle.focus.active { + outline: none; +} + +.btn-toggle:before, +.btn-toggle:after { + line-height: 1.5rem; + width: 4rem; + text-align: center; + font-weight: 600; + font-size: 0.75rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle:before { + content: 'Off'; + left: -4rem; +} + +.btn-toggle:after { + content: 'On'; + right: -4rem; + opacity: 0.5; +} + +.btn-toggle>.handle { + position: absolute; + top: 0.1875rem; + left: 0.1875rem; + width: 1.125rem; + height: 1.125rem; + border-radius: 1.125rem; + background: var(--white); + transition: left 0.25s; +} + +.btn-toggle.active { + transition: background-color 0.25s; +} + +.btn-toggle.active>.handle { + left: 1.6875rem; + transition: left 0.25s; +} + +.btn-toggle.active:before { + opacity: 0.5; +} + +.btn-toggle.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm:before, +.btn-toggle.btn-sm:after { + line-height: -0.5rem; + color: var(--white); + letter-spacing: 0.75px; + left: 0.4125rem; + width: 2.325rem; +} + +.btn-toggle.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs:before, +.btn-toggle.btn-xs:after { + display: none; +} + +.btn-toggle:before, +.btn-toggle:after { + color: #6b7381; +} + +.btn-toggle.active { + background-color: #29b5a8; +} + +.btn-toggle.btn-lg { + margin: 0 5rem; + padding: 0; + position: relative; + border: none; + height: 2.5rem; + width: 5rem; + border-radius: 2.5rem; +} + +.btn-toggle.btn-lg:focus, +.btn-toggle.btn-lg.focus, +.btn-toggle.btn-lg:focus.active, +.btn-toggle.btn-lg.focus.active { + outline: none; +} + +.btn-toggle.btn-lg:before, +.btn-toggle.btn-lg:after { + line-height: 2.5rem; + width: 5rem; + text-align: center; + font-weight: 600; + font-size: 1rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-lg:before { + content: 'Off'; + left: -5rem; +} + +.btn-toggle.btn-lg:after { + content: 'On'; + right: -5rem; + opacity: 0.5; +} + +.btn-toggle.btn-lg>.handle { + position: absolute; + top: 0.3125rem; + left: 0.3125rem; + width: 1.875rem; + height: 1.875rem; + border-radius: 1.875rem; + background: var(--white); + transition: left 0.25s; +} + +.btn-toggle.btn-lg.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-lg.active>.handle { + left: 2.8125rem; + transition: left 0.25s; +} + +.btn-toggle.btn-lg.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-lg.active:after { + opacity: 1; +} + +.btn-toggle.btn-lg.btn-sm:before, +.btn-toggle.btn-lg.btn-sm:after { + line-height: 0.5rem; + color: var(--white); + letter-spacing: 0.75px; + left: 0.6875rem; + width: 3.875rem; +} + +.btn-toggle.btn-lg.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-lg.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-lg.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-lg.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-lg.btn-xs:before, +.btn-toggle.btn-lg.btn-xs:after { + display: none; +} + +.btn-toggle.btn-sm { + margin: 0 0.5rem; + padding: 0; + position: relative; + border: none; + height: 1.5rem; + width: 3rem; + border-radius: 1.5rem; +} + +.btn-toggle.btn-sm:focus, +.btn-toggle.btn-sm.focus, +.btn-toggle.btn-sm:focus.active, +.btn-toggle.btn-sm.focus.active { + outline: none; +} + +.btn-toggle.btn-sm:before, +.btn-toggle.btn-sm:after { + line-height: 1.5rem; + width: 0.5rem; + text-align: center; + font-weight: 600; + font-size: 0.55rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-sm:before { + content: 'Off'; + left: -0.5rem; +} + +.btn-toggle.btn-sm:after { + content: 'On'; + right: -0.5rem; + opacity: 0.5; +} + +.btn-toggle.btn-sm>.handle { + position: absolute; + top: 0.1875rem; + left: 0.1875rem; + width: 1.125rem; + height: 1.125rem; + border-radius: 1.125rem; + background: var(--white); + transition: left 0.25s; +} + +.btn-toggle.btn-sm.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-sm.active>.handle { + left: 1.6875rem; + transition: left 0.25s; +} + +.btn-toggle.btn-sm.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm.btn-sm:before, +.btn-toggle.btn-sm.btn-sm:after { + line-height: -0.5rem; + color: var(--white); + letter-spacing: 0.75px; + left: 0.4125rem; + width: 2.325rem; +} + +.btn-toggle.btn-sm.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-sm.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-sm.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-sm.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm.btn-xs:before, +.btn-toggle.btn-sm.btn-xs:after { + display: none; +} + +.btn-toggle.btn-xs { + margin: 0 0; + padding: 0; + position: relative; + border: none; + height: 1rem; + width: 2rem; + border-radius: 1rem; +} + +.btn-toggle.btn-xs:focus, +.btn-toggle.btn-xs.focus, +.btn-toggle.btn-xs:focus.active, +.btn-toggle.btn-xs.focus.active { + outline: none; +} + +.btn-toggle.btn-xs:before, +.btn-toggle.btn-xs:after { + line-height: 1rem; + width: 0; + text-align: center; + font-weight: 600; + font-size: 0.75rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-xs:before { + content: 'Off'; + left: 0; +} + +.btn-toggle.btn-xs:after { + content: 'On'; + right: 0; + opacity: 0.5; +} + +.btn-toggle.btn-xs>.handle { + position: absolute; + top: 0.125rem; + left: 0.125rem; + width: 0.75rem; + height: 0.75rem; + border-radius: 0.75rem; + background: var(--white); + transition: left 0.25s; +} + +.btn-toggle.btn-xs.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-xs.active>.handle { + left: 1.125rem; + transition: left 0.25s; +} + +.btn-toggle.btn-xs.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-xs.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs.btn-sm:before, +.btn-toggle.btn-xs.btn-sm:after { + line-height: -1rem; + color: var(--white); + letter-spacing: 0.75px; + left: 0.275rem; + width: 1.55rem; +} + +.btn-toggle.btn-xs.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-xs.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-xs.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-xs.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs.btn-xs:before, +.btn-toggle.btn-xs.btn-xs:after { + display: none; +} + +.btn-toggle.btn-info { + color: var(--white); + background: var(--gray); +} + +.btn-toggle.btn-info:before, +.btn-toggle.btn-info:after { + color: #6b7381; +} + +.btn-toggle.btn-info.active { + background-color: var(--info); +} + +.btn-toggle.btn-secondary { + color: #6b7381; + background: #bdc1c8; +} + +.btn-toggle.btn-secondary:before, +.btn-toggle.btn-secondary:after { + color: #6b7381; +} + +.btn-toggle.btn-secondary.active { + background-color: #ff8300; +} + +/**************************************************************/ + /**************************************************************/ /* CSS for Froms Displays */ /**************************************************************/ @@ -212,6 +660,14 @@ div>.input-group>.form-control { top: calc(-0.125rem + 1px); } +a.btn-primary { + color: var(--white); +} + +button.btn-primary { + color: var(--white); +} + /**************************************************************/ /**************************************************************/ @@ -233,4 +689,24 @@ td.action .btn { margin-bottom: 0.2rem; } +/**************************************************************/ + +/**************************************************************/ +/* CSS for warnings Displays */ +/**************************************************************/ +div.warnings div.wssError { + color: var(--white); +} + +div.warnings div.wssError a { + color: var(--white-smoke); +} + +/**************************************************************/ + +/**************************************************************/ +/* CSS for ----- Displays */ +/**************************************************************/ + + /**************************************************************/ \ No newline at end of file From 1c0190d0ab8c20aadb3210f20d54a6d47896e671 Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Tue, 30 Jan 2024 22:10:49 +0100 Subject: [PATCH 15/34] Impriove display for wssErrors --- app/frontend/static/assets/css/crafty.css | 452 +--------------------- app/frontend/templates/base.html | 6 +- 2 files changed, 7 insertions(+), 451 deletions(-) diff --git a/app/frontend/static/assets/css/crafty.css b/app/frontend/static/assets/css/crafty.css index 55efaeb6..4c55d7ae 100644 --- a/app/frontend/static/assets/css/crafty.css +++ b/app/frontend/static/assets/css/crafty.css @@ -140,454 +140,6 @@ body { text-align: center; } -/**************************************************************/ -/* CSS for Toggle Buttons */ -/**************************************************************/ -.btn-toggle { - margin: 0 4rem; - padding: 0; - position: relative; - border: none; - height: 1.5rem; - width: 3rem; - border-radius: 1.5rem; - color: #6b7381; - background: #bdc1c8; -} - -.btn-toggle:focus, -.btn-toggle.focus, -.btn-toggle:focus.active, -.btn-toggle.focus.active { - outline: none; -} - -.btn-toggle:before, -.btn-toggle:after { - line-height: 1.5rem; - width: 4rem; - text-align: center; - font-weight: 600; - font-size: 0.75rem; - text-transform: uppercase; - letter-spacing: 2px; - position: absolute; - bottom: 0; - transition: opacity 0.25s; -} - -.btn-toggle:before { - content: 'Off'; - left: -4rem; -} - -.btn-toggle:after { - content: 'On'; - right: -4rem; - opacity: 0.5; -} - -.btn-toggle>.handle { - position: absolute; - top: 0.1875rem; - left: 0.1875rem; - width: 1.125rem; - height: 1.125rem; - border-radius: 1.125rem; - background: var(--white); - transition: left 0.25s; -} - -.btn-toggle.active { - transition: background-color 0.25s; -} - -.btn-toggle.active>.handle { - left: 1.6875rem; - transition: left 0.25s; -} - -.btn-toggle.active:before { - opacity: 0.5; -} - -.btn-toggle.active:after { - opacity: 1; -} - -.btn-toggle.btn-sm:before, -.btn-toggle.btn-sm:after { - line-height: -0.5rem; - color: var(--white); - letter-spacing: 0.75px; - left: 0.4125rem; - width: 2.325rem; -} - -.btn-toggle.btn-sm:before { - text-align: right; -} - -.btn-toggle.btn-sm:after { - text-align: left; - opacity: 0; -} - -.btn-toggle.btn-sm.active:before { - opacity: 0; -} - -.btn-toggle.btn-sm.active:after { - opacity: 1; -} - -.btn-toggle.btn-xs:before, -.btn-toggle.btn-xs:after { - display: none; -} - -.btn-toggle:before, -.btn-toggle:after { - color: #6b7381; -} - -.btn-toggle.active { - background-color: #29b5a8; -} - -.btn-toggle.btn-lg { - margin: 0 5rem; - padding: 0; - position: relative; - border: none; - height: 2.5rem; - width: 5rem; - border-radius: 2.5rem; -} - -.btn-toggle.btn-lg:focus, -.btn-toggle.btn-lg.focus, -.btn-toggle.btn-lg:focus.active, -.btn-toggle.btn-lg.focus.active { - outline: none; -} - -.btn-toggle.btn-lg:before, -.btn-toggle.btn-lg:after { - line-height: 2.5rem; - width: 5rem; - text-align: center; - font-weight: 600; - font-size: 1rem; - text-transform: uppercase; - letter-spacing: 2px; - position: absolute; - bottom: 0; - transition: opacity 0.25s; -} - -.btn-toggle.btn-lg:before { - content: 'Off'; - left: -5rem; -} - -.btn-toggle.btn-lg:after { - content: 'On'; - right: -5rem; - opacity: 0.5; -} - -.btn-toggle.btn-lg>.handle { - position: absolute; - top: 0.3125rem; - left: 0.3125rem; - width: 1.875rem; - height: 1.875rem; - border-radius: 1.875rem; - background: var(--white); - transition: left 0.25s; -} - -.btn-toggle.btn-lg.active { - transition: background-color 0.25s; -} - -.btn-toggle.btn-lg.active>.handle { - left: 2.8125rem; - transition: left 0.25s; -} - -.btn-toggle.btn-lg.active:before { - opacity: 0.5; -} - -.btn-toggle.btn-lg.active:after { - opacity: 1; -} - -.btn-toggle.btn-lg.btn-sm:before, -.btn-toggle.btn-lg.btn-sm:after { - line-height: 0.5rem; - color: var(--white); - letter-spacing: 0.75px; - left: 0.6875rem; - width: 3.875rem; -} - -.btn-toggle.btn-lg.btn-sm:before { - text-align: right; -} - -.btn-toggle.btn-lg.btn-sm:after { - text-align: left; - opacity: 0; -} - -.btn-toggle.btn-lg.btn-sm.active:before { - opacity: 0; -} - -.btn-toggle.btn-lg.btn-sm.active:after { - opacity: 1; -} - -.btn-toggle.btn-lg.btn-xs:before, -.btn-toggle.btn-lg.btn-xs:after { - display: none; -} - -.btn-toggle.btn-sm { - margin: 0 0.5rem; - padding: 0; - position: relative; - border: none; - height: 1.5rem; - width: 3rem; - border-radius: 1.5rem; -} - -.btn-toggle.btn-sm:focus, -.btn-toggle.btn-sm.focus, -.btn-toggle.btn-sm:focus.active, -.btn-toggle.btn-sm.focus.active { - outline: none; -} - -.btn-toggle.btn-sm:before, -.btn-toggle.btn-sm:after { - line-height: 1.5rem; - width: 0.5rem; - text-align: center; - font-weight: 600; - font-size: 0.55rem; - text-transform: uppercase; - letter-spacing: 2px; - position: absolute; - bottom: 0; - transition: opacity 0.25s; -} - -.btn-toggle.btn-sm:before { - content: 'Off'; - left: -0.5rem; -} - -.btn-toggle.btn-sm:after { - content: 'On'; - right: -0.5rem; - opacity: 0.5; -} - -.btn-toggle.btn-sm>.handle { - position: absolute; - top: 0.1875rem; - left: 0.1875rem; - width: 1.125rem; - height: 1.125rem; - border-radius: 1.125rem; - background: var(--white); - transition: left 0.25s; -} - -.btn-toggle.btn-sm.active { - transition: background-color 0.25s; -} - -.btn-toggle.btn-sm.active>.handle { - left: 1.6875rem; - transition: left 0.25s; -} - -.btn-toggle.btn-sm.active:before { - opacity: 0.5; -} - -.btn-toggle.btn-sm.active:after { - opacity: 1; -} - -.btn-toggle.btn-sm.btn-sm:before, -.btn-toggle.btn-sm.btn-sm:after { - line-height: -0.5rem; - color: var(--white); - letter-spacing: 0.75px; - left: 0.4125rem; - width: 2.325rem; -} - -.btn-toggle.btn-sm.btn-sm:before { - text-align: right; -} - -.btn-toggle.btn-sm.btn-sm:after { - text-align: left; - opacity: 0; -} - -.btn-toggle.btn-sm.btn-sm.active:before { - opacity: 0; -} - -.btn-toggle.btn-sm.btn-sm.active:after { - opacity: 1; -} - -.btn-toggle.btn-sm.btn-xs:before, -.btn-toggle.btn-sm.btn-xs:after { - display: none; -} - -.btn-toggle.btn-xs { - margin: 0 0; - padding: 0; - position: relative; - border: none; - height: 1rem; - width: 2rem; - border-radius: 1rem; -} - -.btn-toggle.btn-xs:focus, -.btn-toggle.btn-xs.focus, -.btn-toggle.btn-xs:focus.active, -.btn-toggle.btn-xs.focus.active { - outline: none; -} - -.btn-toggle.btn-xs:before, -.btn-toggle.btn-xs:after { - line-height: 1rem; - width: 0; - text-align: center; - font-weight: 600; - font-size: 0.75rem; - text-transform: uppercase; - letter-spacing: 2px; - position: absolute; - bottom: 0; - transition: opacity 0.25s; -} - -.btn-toggle.btn-xs:before { - content: 'Off'; - left: 0; -} - -.btn-toggle.btn-xs:after { - content: 'On'; - right: 0; - opacity: 0.5; -} - -.btn-toggle.btn-xs>.handle { - position: absolute; - top: 0.125rem; - left: 0.125rem; - width: 0.75rem; - height: 0.75rem; - border-radius: 0.75rem; - background: var(--white); - transition: left 0.25s; -} - -.btn-toggle.btn-xs.active { - transition: background-color 0.25s; -} - -.btn-toggle.btn-xs.active>.handle { - left: 1.125rem; - transition: left 0.25s; -} - -.btn-toggle.btn-xs.active:before { - opacity: 0.5; -} - -.btn-toggle.btn-xs.active:after { - opacity: 1; -} - -.btn-toggle.btn-xs.btn-sm:before, -.btn-toggle.btn-xs.btn-sm:after { - line-height: -1rem; - color: var(--white); - letter-spacing: 0.75px; - left: 0.275rem; - width: 1.55rem; -} - -.btn-toggle.btn-xs.btn-sm:before { - text-align: right; -} - -.btn-toggle.btn-xs.btn-sm:after { - text-align: left; - opacity: 0; -} - -.btn-toggle.btn-xs.btn-sm.active:before { - opacity: 0; -} - -.btn-toggle.btn-xs.btn-sm.active:after { - opacity: 1; -} - -.btn-toggle.btn-xs.btn-xs:before, -.btn-toggle.btn-xs.btn-xs:after { - display: none; -} - -.btn-toggle.btn-info { - color: var(--white); - background: var(--gray); -} - -.btn-toggle.btn-info:before, -.btn-toggle.btn-info:after { - color: #6b7381; -} - -.btn-toggle.btn-info.active { - background-color: var(--info); -} - -.btn-toggle.btn-secondary { - color: #6b7381; - background: #bdc1c8; -} - -.btn-toggle.btn-secondary:before, -.btn-toggle.btn-secondary:after { - color: #6b7381; -} - -.btn-toggle.btn-secondary.active { - background-color: #ff8300; -} - -/**************************************************************/ - /**************************************************************/ /* CSS for Froms Displays */ /**************************************************************/ @@ -699,6 +251,10 @@ div.warnings div.wssError { } div.warnings div.wssError a { + color: var(--outline); +} + +div.warnings div.wssError a:hover { color: var(--white-smoke); } diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 48c6ee95..9f1a4111 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -394,7 +394,7 @@ } }, callback: function (result) { - if (result){ + if (result) { location.href = "/panel/download_support_package"; } else { bootbox.close(); @@ -489,7 +489,7 @@ let linkEl = document.createElement('a') linkEl.href = link; linkEl.innerHTML = "See our documentation for details."; - linkEl.style.color = 'white'; + //linkEl.style.color = 'white'; linkEl.style.textDecoration = 'underline'; linkEl.target = "_blank"; @@ -608,4 +608,4 @@ - + \ No newline at end of file From 856caf4a9a71ac2c87b47538bb74e1c155998dce Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Tue, 30 Jan 2024 22:44:00 +0100 Subject: [PATCH 16/34] trying to improve display for th-TH lang --- app/frontend/static/assets/css/crafty.css | 6 +++++- app/frontend/templates/base.html | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/frontend/static/assets/css/crafty.css b/app/frontend/static/assets/css/crafty.css index 4c55d7ae..1bf03471 100644 --- a/app/frontend/static/assets/css/crafty.css +++ b/app/frontend/static/assets/css/crafty.css @@ -261,8 +261,12 @@ div.warnings div.wssError a:hover { /**************************************************************/ /**************************************************************/ -/* CSS for ----- Displays */ +/* CSS for Fonts Displays */ /**************************************************************/ +*:lang(th-TH) :not(.fas) { + font-family: 'Sarabun', 'roboto', sans-serif; + font-size: medium; +} /**************************************************************/ \ No newline at end of file diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 9f1a4111..a954859f 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -14,6 +14,7 @@ + @@ -53,7 +54,6 @@ - From 98bbf880d0e9dd8c65afefba96d1fc68a88d922d Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Tue, 30 Jan 2024 22:58:19 +0100 Subject: [PATCH 17/34] Fixing Fonts for th-TH --- app/frontend/static/assets/css/crafty.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/frontend/static/assets/css/crafty.css b/app/frontend/static/assets/css/crafty.css index 1bf03471..286155ab 100644 --- a/app/frontend/static/assets/css/crafty.css +++ b/app/frontend/static/assets/css/crafty.css @@ -263,10 +263,9 @@ div.warnings div.wssError a:hover { /**************************************************************/ /* CSS for Fonts Displays */ /**************************************************************/ -*:lang(th-TH) :not(.fas) { +*:lang(th-TH) :not(.fa, .fas, .fab, .fa-solid) { font-family: 'Sarabun', 'roboto', sans-serif; font-size: medium; } - /**************************************************************/ \ No newline at end of file From a26159f510d42308fd405f06c031bb1dfa32ca55 Mon Sep 17 00:00:00 2001 From: computergeek125 Date: Wed, 31 Jan 2024 01:33:39 -0600 Subject: [PATCH 18/34] Added timeout to http calls, switched get to head --- app/classes/web/http_handler.py | 4 ++-- app/classes/web/http_handler_page.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/classes/web/http_handler.py b/app/classes/web/http_handler.py index ca340c66..32676d59 100644 --- a/app/classes/web/http_handler.py +++ b/app/classes/web/http_handler.py @@ -17,7 +17,7 @@ class HTTPHandler(BaseHandler): url = "https://" + url db_port = self.helper.get_setting("https_port") try: - resp = requests.get(url + ":" + str(port)) + resp = requests.head(url + ":" + str(port), timeout=(0.5, 5)) resp.raise_for_status() except Exception: port = db_port @@ -35,7 +35,7 @@ class HTTPHandlerPage(BaseHandler): url = "https://" + url db_port = self.helper.get_setting("https_port") try: - resp = requests.get(url + ":" + str(port)) + resp = requests.head(url + ":" + str(port), timeout=(0.5, 5)) resp.raise_for_status() except Exception: port = db_port diff --git a/app/classes/web/http_handler_page.py b/app/classes/web/http_handler_page.py index 30a8aaa1..77161577 100644 --- a/app/classes/web/http_handler_page.py +++ b/app/classes/web/http_handler_page.py @@ -25,7 +25,7 @@ class HTTPHandlerPage(BaseHandler): backup_url = url + str(self.helper.get_setting("https_port")) try: - resp = requests.get(primary_url) + resp = requests.head(primary_url, timeout=(0.5, 5)) resp.raise_for_status() url = primary_url except Exception: From ccf67002cd76bb95c1e4fede47a9d94b22ff243f Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 31 Jan 2024 19:17:13 -0500 Subject: [PATCH 19/34] Remove print statement --- app/classes/web/tornado_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/classes/web/tornado_handler.py b/app/classes/web/tornado_handler.py index 82ae081c..fbcf970f 100644 --- a/app/classes/web/tornado_handler.py +++ b/app/classes/web/tornado_handler.py @@ -190,7 +190,7 @@ class Webserver: login_url="/login", serve_traceback=debug_errors, ) - print(http_port) + if http_port != 0: self.http_server = tornado.httpserver.HTTPServer(http_app) self.http_server.listen(http_port) From 729f854a670c89a3396d3ddd7f8767e2d3104bf9 Mon Sep 17 00:00:00 2001 From: Analicia Abernathy Date: Wed, 31 Jan 2024 19:47:14 -0600 Subject: [PATCH 20/34] Added required translations for branch --- app/translations/de_DE.json | 1 + app/translations/fr_FR.json | 1 + app/translations/he_IL.json | 1 + app/translations/lol_EN.json | 1 + app/translations/lv_LV.json | 1 + app/translations/nl_BE.json | 1 + app/translations/pl_PL.json | 1 + app/translations/th_TH.json | 1 + app/translations/tr_TR.json | 1 + app/translations/uk_UA.json | 1 + app/translations/zh_CN.json | 1 + 11 files changed, 11 insertions(+) diff --git a/app/translations/de_DE.json b/app/translations/de_DE.json index 1a7f8995..22bf6a57 100644 --- a/app/translations/de_DE.json +++ b/app/translations/de_DE.json @@ -579,6 +579,7 @@ "serverUpload": "Als Zip-Datei Gepackten Server hochladen", "serverVersion": "Server Version", "sizeInGB": "Größe in GB", + "unsupported": "Minecraft-Versionen vor 1.8 sind nicht vollständig auf Kompatibilität getestet. Bei einer Installation verhalten diese sich möglicherweise nicht wie erwartet.", "uploadButton": "Hochladen", "uploadZip": "Zip-Datei für Serverimport hochladen", "zipPath": "Server Pfad" diff --git a/app/translations/fr_FR.json b/app/translations/fr_FR.json index aa45a69b..4a0b88b1 100644 --- a/app/translations/fr_FR.json +++ b/app/translations/fr_FR.json @@ -579,6 +579,7 @@ "serverUpload": "Charger le fichier Zippé", "serverVersion": "Version du Serveur", "sizeInGB": "Taille en GB", + "unsupported": "Les versions Minecraft inférieures à 1.8 ne sont pas supportées par Crafty. Elles peuvent être installées, mais leur fonctionnement peut varier.", "uploadButton": "Chargement", "uploadZip": "Charger le fichier pour l'importation du Serveur", "zipPath": "Chemin du Serveur" diff --git a/app/translations/he_IL.json b/app/translations/he_IL.json index cff35559..3b6fa3ec 100644 --- a/app/translations/he_IL.json +++ b/app/translations/he_IL.json @@ -579,6 +579,7 @@ "serverUpload": "העלה שרת מכווץ", "serverVersion": "גרסת השרת", "sizeInGB": "גודל ב-GB", + "unsupported": "גרסאות מיינקראפט מתחת ל1.8 לא נתמכות על ידי קראפטי. אפשר להתקין אותם אבל הביצועים לא יהיו עקביים.", "uploadButton": "העלה", "uploadZip": "העלה קובץ Zip לייבוא שרת", "zipPath": "נתיב שרת" diff --git a/app/translations/lol_EN.json b/app/translations/lol_EN.json index 4836501b..8e51e4cb 100644 --- a/app/translations/lol_EN.json +++ b/app/translations/lol_EN.json @@ -579,6 +579,7 @@ "serverUpload": "UPLOADZ ZIPPED SERVR", "serverVersion": "SERVR VERZHUN", "sizeInGB": "SIEZ IN GIGABITEZ", + "unsupported": "MINECRAFTZ OLDR THAN 1.8 NOT FRENDS WIF CWAFTY. U CAN STILL TRY INSTALLIN'. IT MIGHT WORKS, MIGHT NOT.", "uploadButton": "UPLOADZ", "uploadZip": "UPLOADZ ZIP FISH FOR SERVR BRING IN", "zipPath": "WER IZ ZIP FISH (PETH)" diff --git a/app/translations/lv_LV.json b/app/translations/lv_LV.json index 354a0e54..09dec926 100644 --- a/app/translations/lv_LV.json +++ b/app/translations/lv_LV.json @@ -580,6 +580,7 @@ "serverUpload": "Augšupielādē Saspiestu (Zipotu) Serveri", "serverVersion": "Servera Versija", "sizeInGB": "lielums, GB", + "unsupported": "Minecraft versijas zem 1.8 netiek atbalstītas iekš Crafty. Jūs tāpat variet tās instalēt, bet rezultāti atškirsies.", "uploadButton": "Augšupielādēt", "uploadZip": "Augšupielādē Zip Failu Priekš Serveru Importa", "zipPath": "Servera Ceļš" diff --git a/app/translations/nl_BE.json b/app/translations/nl_BE.json index c9414bbe..f81f8bf5 100644 --- a/app/translations/nl_BE.json +++ b/app/translations/nl_BE.json @@ -579,6 +579,7 @@ "serverUpload": "Gezipt bestand uploaden", "serverVersion": "Serverversie", "sizeInGB": "Grootte in GB", + "unsupported": "Minecraft-versies lager dan 1.8 worden niet ondersteund door Crafty. Je kunt het nog steeds installeren. De resultaten kunnen variëren.", "uploadButton": "Uploaden", "uploadZip": "Upload zip-bestand voor serverimport", "zipPath": "Serverpad" diff --git a/app/translations/pl_PL.json b/app/translations/pl_PL.json index 86f8f9cb..e2a2d203 100644 --- a/app/translations/pl_PL.json +++ b/app/translations/pl_PL.json @@ -578,6 +578,7 @@ "serverUpload": "Wgraj ZIP Serwera", "serverVersion": "Wersja serwera", "sizeInGB": "Wielkość w GB", + "unsupported": "Wersje Minecrafta poniżej 1.8 nie są wspierane przez Crafty. Mimo to możesz je zainstalować - jednakże nie jesteśmy w stanie zagwarantować ich działanie.", "uploadButton": "Wgraj", "uploadZip": "Wgraj plik Zip dla imprtowania serwera", "zipPath": "Server Path" diff --git a/app/translations/th_TH.json b/app/translations/th_TH.json index a833cf1c..ce377492 100644 --- a/app/translations/th_TH.json +++ b/app/translations/th_TH.json @@ -578,6 +578,7 @@ "serverUpload": "อัปโหลดเซิร์ฟเวอร์ซิป", "serverVersion": "เวอร์ชันเซิร์ฟเวอร์", "sizeInGB": "ขนาดเป็นกิกะไบต์", + "unsupported": "Crafty ไม่รองรับ Minecraft เวอร์ชั่นต่ำกว่า 1.8 คุณยังสามารถติดตั้งได้ ผลลัพธ์จะแตกต่างกันออกไป", "uploadButton": "อัปโหลด", "uploadZip": "อัปโหลดไฟล์ซิปสำหรับการนำเข้าเซิร์ฟเวอร์", "zipPath": "เส้นทางเซิร์ฟเวอร์" diff --git a/app/translations/tr_TR.json b/app/translations/tr_TR.json index 9ab3a6c8..cf96f2b3 100644 --- a/app/translations/tr_TR.json +++ b/app/translations/tr_TR.json @@ -578,6 +578,7 @@ "serverUpload": "Sıkıştırılmış Sunucu Yükle", "serverVersion": "Sunucu Sürümü", "sizeInGB": "GB cinsinden boyut", + "unsupported": "Minecraft'ın 1.8'den eski sürümleri Crafty tarafından desteklenmemektedir. Yine de yükleyebilirsiniz. Sonuçlar değişkenlik gösterecektir.", "uploadButton": "Dosya Yükle", "uploadZip": "Sunucu İçe Aktarımı İçin Zip Dosyası Yükle", "zipPath": "Sunucu Konumu" diff --git a/app/translations/uk_UA.json b/app/translations/uk_UA.json index a7018a5f..a22c1de9 100644 --- a/app/translations/uk_UA.json +++ b/app/translations/uk_UA.json @@ -578,6 +578,7 @@ "serverUpload": "Вивантажити архівований сервер", "serverVersion": "Версія сервера", "sizeInGB": "Об'єм пам'яті в ГБ", + "unsupported": "Minecraft версії старіші ніж 1.8, не підтримуються Crafty. Ви все ще можете встановити їх, але результат буде непередбачуваний.", "uploadButton": "Вивантажити", "uploadZip": "Вивантажити архів(.zip) для імпорту сервера", "zipPath": "Шлях архіву сервера" diff --git a/app/translations/zh_CN.json b/app/translations/zh_CN.json index ffac7b3b..4ffa844b 100644 --- a/app/translations/zh_CN.json +++ b/app/translations/zh_CN.json @@ -579,6 +579,7 @@ "serverUpload": "上传打包为 Zip 文件的服务器", "serverVersion": "服务器版本", "sizeInGB": "大小(以 GB 为单位)", + "unsupported": "Crafty 不支持低于 1.8 的 Minecraft 版本。你仍可以安装,但结果无法保证。", "uploadButton": "上传", "uploadZip": "上传 Zip 文件以导入服务器", "zipPath": "服务器路径" From 68b0e611be8273844cba44c32348bc580e2159ba Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 31 Jan 2024 22:00:45 -0500 Subject: [PATCH 21/34] Add new theme for lockout user --- app/frontend/static/assets/css/dark/style.css | 45 ++++++++++++++++++- app/frontend/templates/base.html | 2 +- .../templates/panel/panel_config.html | 2 +- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/app/frontend/static/assets/css/dark/style.css b/app/frontend/static/assets/css/dark/style.css index 12320636..cae93650 100755 --- a/app/frontend/static/assets/css/dark/style.css +++ b/app/frontend/static/assets/css/dark/style.css @@ -55,6 +55,49 @@ root, --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; } +:root.anti-lockout { + /*CHANGE THESE FOR THEMES*/ + --tooltip-bg: rgb(215, 82, 0); + --select-bg: #b8772c; + --ram-bg: #4d4d4e; + --base-text: white; + --outline: #c73929; + --card-banner-bg: #de7c26; + --deep-bg: #912f2f; + --dropdown-bg: #c83b3b; + /*END THEME VARIATION*/ + --blue: #00aeef; + --indigo: #6610f2; + --purple: #ab8ce4; + --pink: #E91E63; + --red: #ff0017; + --orange: #fb9678; + --yellow: #ffd500; + --green: #3bd949; + --teal: #58d8a3; + --cyan: #57c7d4; + --white: #ffffff; + --white-smoke: #f3f5f6; + --gray: #6c757d; + --gray-light: #8ba2b5; + --gray-lightest: #f7f7f9; + --primary: #dbc900; + --secondary: #dde4eb; + --success: #adff84; + --info: #dbc900; + --warning: #ffaf00; + --danger: #ff6258; + --light: #fbfbfb; + --dark: #252C46; + --breakpoint-xs: 0; + --breakpoint-sm: 576px; + --breakpoint-md: 768px; + --breakpoint-lg: 992px; + --breakpoint-xl: 1200px; + --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + :root.light { /*CHANGE THESE FOR THEMES*/ --tooltip-bg: white; @@ -322,7 +365,7 @@ sup { } a { - color: #007bff; + color: var(--primary); text-decoration: none; background-color: transparent; } diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 546502a2..8d72ece6 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -587,7 +587,7 @@ link='/logout', link_msg="Click here to log out after you change your password. ⚠️", className='anti-lockout', - bg_color='#2090d6' + bg_color='#6887dc' ) } $('#support_logs').click(function () { diff --git a/app/frontend/templates/panel/panel_config.html b/app/frontend/templates/panel/panel_config.html index 5e9623b1..fee5c65d 100644 --- a/app/frontend/templates/panel/panel_config.html +++ b/app/frontend/templates/panel/panel_config.html @@ -281,7 +281,7 @@