Add debug mode for gunicorn and update iso-prod files

This commit is contained in:
Théophile Diot 2024-04-26 15:49:54 +02:00
parent 27f9977f72
commit b26d072fc7
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
7 changed files with 14 additions and 7 deletions

View file

@ -91,7 +91,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug
depends_on:
- bw-docker
volumes:
@ -105,6 +104,7 @@ services:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -88,7 +88,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug
depends_on:
- bw-docker
volumes:
@ -102,6 +101,7 @@ services:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -88,7 +88,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug
depends_on:
- bw-docker
volumes:
@ -100,6 +99,7 @@ services:
- ../../src/ui/utils.py:/usr/share/bunkerweb/ui/utils.py:ro
environment:
<<: *env
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -81,7 +81,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug
depends_on:
- bw-docker
volumes:
@ -95,6 +94,7 @@ services:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -77,7 +77,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug
depends_on:
- bw-docker
volumes:
@ -91,6 +90,7 @@ services:
<<: *env
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "P@ssw0rd"
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -72,7 +72,6 @@ services:
build:
context: ../..
dockerfile: ./src/ui/Dockerfile
command: python3 -m gunicorn --config gunicorn.conf.py --user ui --group ui --bind 0.0.0.0:7000 --reload --log-level debug main:app
depends_on:
- bw-docker
volumes:
@ -84,6 +83,7 @@ services:
- ../../src/ui/utils.py:/usr/share/bunkerweb/ui/utils.py:ro
environment:
<<: *env
DEBUG: "1"
networks:
bw-universe:
aliases:

View file

@ -28,7 +28,6 @@ proc_name = "bunkerweb-ui"
accesslog = "/var/log/bunkerweb/ui-access.log"
access_log_format = '%({x-forwarded-for}i)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
errorlog = "/var/log/bunkerweb/ui.log"
loglevel = LOG_LEVEL.lower()
reuse_port = True
worker_tmp_dir = join(sep, "dev", "shm")
tmp_upload_dir = join(sep, "var", "tmp", "bunkerweb", "ui")
@ -39,6 +38,14 @@ threads = int(getenv("MAX_THREADS", MAX_WORKERS * 2))
max_requests_jitter = min(8, MAX_WORKERS)
graceful_timeout = 5
DEBUG = getenv("DEBUG", False)
loglevel = "debug" if DEBUG else LOG_LEVEL.lower()
if DEBUG:
reload = True
reload_extra_files = [file.as_posix() for file in Path(sep, "usr", "share", "bunkerweb", "ui", "templates").iterdir()]
def on_starting(server):
if not getenv("FLASK_SECRET") and not TMP_DIR.joinpath(".flask_secret").is_file():