Skip to content

Commit

Permalink
Merge branch 'main' into mlss-bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbrq authored Sep 3, 2024
2 parents c8ea47e + 2aa0653 commit dd88c67
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
10 changes: 10 additions & 0 deletions WebHost.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import os
import multiprocessing
import logging
Expand Down Expand Up @@ -31,6 +32,15 @@ def get_app() -> "Flask":
import yaml
app.config.from_file(configpath, yaml.safe_load)
logging.info(f"Updated config from {configpath}")
# inside get_app() so it's usable in systems like gunicorn, which do not run WebHost.py, but import it.
parser = argparse.ArgumentParser()
parser.add_argument('--config_override', default=None,
help="Path to yaml config file that overrules config.yaml.")
args = parser.parse_known_args()[0]
if args.config_override:
import yaml
app.config.from_file(os.path.abspath(args.config_override), yaml.safe_load)
logging.info(f"Updated config from {args.config_override}")
if not app.config["HOST_ADDRESS"]:
logging.info("Getting public IP, as HOST_ADDRESS is empty.")
app.config["HOST_ADDRESS"] = Utils.get_public_ipv4()
Expand Down
9 changes: 5 additions & 4 deletions WebHostLib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
flask>=3.0.3
werkzeug>=3.0.3
pony>=0.7.18
werkzeug>=3.0.4
pony>=0.7.19
waitress>=3.0.0
Flask-Caching>=2.3.0
Flask-Compress>=1.15
Flask-Limiter>=3.7.0
Flask-Limiter>=3.8.0
bokeh>=3.1.1; python_version <= '3.8'
bokeh>=3.4.1; python_version >= '3.9'
bokeh>=3.4.3; python_version == '3.9'
bokeh>=3.5.2; python_version >= '3.10'
markupsafe>=2.1.5
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
colorama>=0.4.6
websockets>=12.0
PyYAML>=6.0.1
jellyfish>=1.0.3
websockets>=13.0.1
PyYAML>=6.0.2
jellyfish>=1.1.0
jinja2>=3.1.4
schema>=0.7.7
kivy>=2.3.0
bsdiff4>=1.2.4
platformdirs>=4.2.2
certifi>=2024.6.2
cython>=3.0.10
certifi>=2024.8.30
cython>=3.0.11
cymem>=2.0.8
orjson>=3.10.3
typing_extensions>=4.12.1
orjson>=3.10.7
typing_extensions>=4.12.2

0 comments on commit dd88c67

Please sign in to comment.