WGDashboard/src/gunicorn.conf.py

27 lines
791 B
Python
Raw Normal View History

2021-10-17 23:24:09 +00:00
import dashboard
2024-08-04 23:45:28 +00:00
from datetime import datetime
2024-08-05 19:39:11 +00:00
2024-08-03 01:48:42 +00:00
global sqldb, cursor, DashboardConfig, WireguardConfigurations, AllPeerJobs, JobLogger
2024-06-17 19:40:25 +00:00
app_host, app_port = dashboard.gunicornConfig()
2024-08-04 23:45:28 +00:00
date = datetime.today().strftime('%Y_%m_%d_%H_%M_%S')
2024-08-05 19:39:11 +00:00
def post_worker_init(worker):
dashboard.startThreads()
worker_class = 'gthread'
2024-08-03 17:25:57 +00:00
workers = 1
threads = 1
2021-10-17 23:24:09 +00:00
bind = f"{app_host}:{app_port}"
daemon = True
2024-08-04 22:59:45 +00:00
pidfile = './gunicorn.pid'
2024-08-04 23:32:16 +00:00
wsgi_app = "dashboard:app"
2024-08-05 00:23:41 +00:00
accesslog = f"./log/access_{date}.log"
2024-08-04 23:35:59 +00:00
log_level = "debug"
capture_output = True
2024-08-05 00:23:41 +00:00
errorlog = f"./log/error_{date}.log"
2024-08-05 00:13:17 +00:00
print(f"[WGDashboard] WGDashboard w/ Gunicorn will be running on {bind}", flush=True)
2024-08-05 00:24:31 +00:00
print(f"[WGDashboard] Access log file is at {accesslog}", flush=True)
print(f"[WGDashboard] Error log file is at {errorlog}", flush=True)