37 lines
1014 B
Python
37 lines
1014 B
Python
# Gunicorn configuration for Seahub (Django)
|
|
# Used by supervisord program `seahub`
|
|
# Note: Logs go to /data/logs/seahub; supervisord also captures stdout/stderr
|
|
|
|
import multiprocessing
|
|
import os
|
|
|
|
# Bind to localhost; nginx proxies to this
|
|
bind = "127.0.0.1:8000"
|
|
|
|
# Workers/threads
|
|
workers = max(multiprocessing.cpu_count(), 2)
|
|
worker_class = "gthread"
|
|
threads = 4
|
|
preload_app = True
|
|
|
|
# Timeouts: uploads can be long-running
|
|
timeout = 1200
|
|
graceful_timeout = 60
|
|
keepalive = 5
|
|
|
|
# Logging
|
|
accesslog = "/data/logs/seahub/gunicorn.access.log"
|
|
errorlog = "/data/logs/seahub/gunicorn.error.log"
|
|
loglevel = "info"
|
|
|
|
# Security / proxy
|
|
forwarded_allow_ips = "*"
|
|
proxy_allow_ips = "*"
|
|
|
|
# Env vars (supervisord sets DJANGO_SETTINGS_MODULE, PYTHONPATH, etc.)
|
|
raw_env = [
|
|
f"SEAFILE_CONF_DIR={os.environ.get('SEAFILE_CONF_DIR', '/data/conf')}",
|
|
f"SEAFILE_CENTRAL_CONF_DIR={os.environ.get('SEAFILE_CENTRAL_CONF_DIR', '/data/conf')}",
|
|
f"SEAFILE_DATA_DIR={os.environ.get('SEAFILE_DATA_DIR', '/data/seafile-data')}",
|
|
]
|