From 5ad1e3260aafb26a4b643b110ad8b381a0a1b6ca Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:06:54 +0200 Subject: [PATCH 1/2] fix envirables with true/false not working properly --- models/globals.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/models/globals.py b/models/globals.py index 6a8a761..5fea6dd 100644 --- a/models/globals.py +++ b/models/globals.py @@ -9,18 +9,25 @@ ## Enviroment variables new_user = False migratetechnic = False +api_only = False +management_only = False debug = False host = os.getenv("APP_URL") port = os.getenv("APP_PORT") -new_user = os.getenv("NEW_USER") -migratetechnic = os.getenv("TECHNIC_MIGRATION") +if os.getenv("NEW_USER"): + new_user = os.getenv("NEW_USER").lower() in ["true", "t", "1", "yes", "y"] +if os.getenv("TECHNIC_MIGRATION"): + migratetechnic = os.getenv("TECHNIC_MIGRATION").lower() in ["true", "t", "1", "yes", "y"] -api_only = os.getenv("API_ONLY") -management_only = os.getenv("MANAGEMENT_ONLY") +if os.getenv("API_ONLY"): + api_only = os.getenv("API_ONLY").lower() in ["true", "t", "1", "yes", "y"] +if os.getenv("MANAGEMENT_ONLY"): + management_only = os.getenv("MANAGEMENT_ONLY").lower() in ["true", "t", "1", "yes", "y"] -debug = os.getenv("APP_DEBUG").lower() in ["true", "t", "1", "yes", "y"] +if os.getenv("APP_DEBUG"): + debug = os.getenv("APP_DEBUG").lower() in ["true", "t", "1", "yes", "y"] mirror_url = os.getenv("SOLDER_MIRROR_URL") repo_url = os.getenv("SOLDER_REPO_LOCATION") From e1ae8e2a742c5d134031366da7763a2b6d026f0a Mon Sep 17 00:00:00 2001 From: maggi373 <40539743+maggi373@users.noreply.github.com> Date: Sat, 17 Aug 2024 01:27:25 +0200 Subject: [PATCH 2/2] add example docker --- README.md | 18 ++++++++++++++++++ models/globals.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ff0de5..4927c65 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,24 @@ solder.py will run everything except api part of solder, quite rare usecase. -e MANAGEMENT_ONLY=True ``` +#### Example + +```bash +docker run -d \ + --name solderpy \ + -e DB_HOST=192.168.1.1 \ + -e DB_PORT=3306 \ + -e DB_USER=solderpy \ + -e DB_PASSWORD=solderpy \ + -e DB_DATABASE=solderpy \ + -e SOLDER_MIRROR_URL=https://example.com/mods/ \ + -e SOLDER_REPO_LOCATION=http://localhost/mods/ \ + -p 80:5000 \ + -v /solderpy/mods:/app/mods \ + --restart unless-stopped \ + thorfusion/solderpy:latest +``` + NOTE: The docker image does not and will not support https, therefore it is required to run an reverse proxy ### docker container installed, setup on website diff --git a/models/globals.py b/models/globals.py index 5fea6dd..57f8fb1 100644 --- a/models/globals.py +++ b/models/globals.py @@ -2,7 +2,7 @@ from dotenv import load_dotenv ## Solderpy version -solderpy_version = "1.4.2" +solderpy_version = "1.4.3" load_dotenv(".env")