mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-18 03:21:36 +02:00
Make gunicorn IPv6 conditional
Only listen on [::]:80 in case SUBNET6 is defined, otherwise do the normal :80
This commit is contained in:
parent
9f6848110a
commit
35331a4295
@ -52,10 +52,15 @@ def test_DNS():
|
||||
|
||||
test_DNS()
|
||||
|
||||
bind_addr = ":80"
|
||||
if os.environ.get("SUBNET6") is not None:
|
||||
# If SUBNET6 is defined, gunicorn must listen on IPv6 as well as IPv4
|
||||
bind_addr = "[::]:80"
|
||||
|
||||
start_command=" ".join([
|
||||
"gunicorn",
|
||||
f"--threads {str(os.cpu_count())}",
|
||||
"-b [::]:80",
|
||||
"-b", bind_addr,
|
||||
"--logger-class mailu.Logger",
|
||||
"--worker-tmp-dir /dev/shm",
|
||||
"--access-logfile -" if (log.root.level<=log.INFO) else "",
|
||||
|
Loading…
Reference in New Issue
Block a user