|
@@ -19,6 +19,7 @@ from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import os
|
|
import os
|
|
|
import sys
|
|
import sys
|
|
|
|
|
+import ssl
|
|
|
import multiprocessing
|
|
import multiprocessing
|
|
|
|
|
|
|
|
import gunicorn.app.base
|
|
import gunicorn.app.base
|
|
@@ -39,7 +40,6 @@ GUNICORN_SERVER_HELP = r"""
|
|
|
Run Hue using the Gunicorn WSGI server in asynchronous mode.
|
|
Run Hue using the Gunicorn WSGI server in asynchronous mode.
|
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
-
|
|
|
|
|
class Command(BaseCommand):
|
|
class Command(BaseCommand):
|
|
|
help = _("Gunicorn Web server for Hue.")
|
|
help = _("Gunicorn Web server for Hue.")
|
|
|
|
|
|
|
@@ -88,17 +88,15 @@ class StandaloneApplication(gunicorn.app.base.BaseApplication):
|
|
|
def load(self):
|
|
def load(self):
|
|
|
return self.load_wsgiapp()
|
|
return self.load_wsgiapp()
|
|
|
|
|
|
|
|
-
|
|
|
|
|
def rungunicornserver():
|
|
def rungunicornserver():
|
|
|
bind_addr = conf.HTTP_HOST.get() + ":" + str(conf.HTTP_PORT.get())
|
|
bind_addr = conf.HTTP_HOST.get() + ":" + str(conf.HTTP_PORT.get())
|
|
|
|
|
|
|
|
options = {
|
|
options = {
|
|
|
- 'access_log_format': None,
|
|
|
|
|
- 'accesslog': '-',
|
|
|
|
|
|
|
+ 'accesslog': "-",
|
|
|
'backlog': None,
|
|
'backlog': None,
|
|
|
'bind': [bind_addr],
|
|
'bind': [bind_addr],
|
|
|
'ca_certs': conf.SSL_CACERTS.get(), # CA certificates file
|
|
'ca_certs': conf.SSL_CACERTS.get(), # CA certificates file
|
|
|
- 'capture_output': None,
|
|
|
|
|
|
|
+ 'capture_output': True,
|
|
|
'cert_reqs': None, # Whether client certificate is required (see stdlib ssl module)
|
|
'cert_reqs': None, # Whether client certificate is required (see stdlib ssl module)
|
|
|
'certfile': conf.SSL_CERTIFICATE.get(), # SSL certificate file
|
|
'certfile': conf.SSL_CERTIFICATE.get(), # SSL certificate file
|
|
|
'chdir': None,
|
|
'chdir': None,
|
|
@@ -108,7 +106,7 @@ def rungunicornserver():
|
|
|
'daemon': None,
|
|
'daemon': None,
|
|
|
'do_handshake_on_connect': None, # Whether to perform SSL handshake on socket connect (see stdlib ssl module)
|
|
'do_handshake_on_connect': None, # Whether to perform SSL handshake on socket connect (see stdlib ssl module)
|
|
|
'enable_stdio_inheritance': None,
|
|
'enable_stdio_inheritance': None,
|
|
|
- 'errorlog': '-',
|
|
|
|
|
|
|
+ 'errorlog': "-",
|
|
|
'forwarded_allow_ips': None,
|
|
'forwarded_allow_ips': None,
|
|
|
'graceful_timeout': None,
|
|
'graceful_timeout': None,
|
|
|
'group': None,
|
|
'group': None,
|
|
@@ -119,14 +117,13 @@ def rungunicornserver():
|
|
|
'limit_request_fields': None,
|
|
'limit_request_fields': None,
|
|
|
'limit_request_line': None,
|
|
'limit_request_line': None,
|
|
|
'logconfig': None,
|
|
'logconfig': None,
|
|
|
- 'logger_class': None,
|
|
|
|
|
- 'loglevel': 'debug',
|
|
|
|
|
|
|
+ 'loglevel': 'info',
|
|
|
'max_requests': None,
|
|
'max_requests': None,
|
|
|
'max_requests_jitter': None,
|
|
'max_requests_jitter': None,
|
|
|
'paste': None,
|
|
'paste': None,
|
|
|
'pidfile': None,
|
|
'pidfile': None,
|
|
|
'preload_app': None,
|
|
'preload_app': None,
|
|
|
- 'proc_name': None,
|
|
|
|
|
|
|
+ 'proc_name': "hue",
|
|
|
'proxy_allow_ips': None,
|
|
'proxy_allow_ips': None,
|
|
|
'proxy_protocol': None,
|
|
'proxy_protocol': None,
|
|
|
'pythonpath': None,
|
|
'pythonpath': None,
|
|
@@ -136,7 +133,7 @@ def rungunicornserver():
|
|
|
'reload_engine': None,
|
|
'reload_engine': None,
|
|
|
'sendfile': None,
|
|
'sendfile': None,
|
|
|
'spew': None,
|
|
'spew': None,
|
|
|
- 'ssl_version': None, # SSL version to use (see stdlib ssl module) [ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1]
|
|
|
|
|
|
|
+ 'ssl_version': ssl.PROTOCOL_TLSv1_2, # SSL version to use (see stdlib ssl module) [ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1]
|
|
|
'statsd_host': None,
|
|
'statsd_host': None,
|
|
|
'statsd_prefix': None,
|
|
'statsd_prefix': None,
|
|
|
'suppress_ragged_eofs': None, # Suppress ragged EOFs (see stdlib ssl module)
|
|
'suppress_ragged_eofs': None, # Suppress ragged EOFs (see stdlib ssl module)
|
|
@@ -156,4 +153,4 @@ def rungunicornserver():
|
|
|
StandaloneApplication(handler_app, options).run()
|
|
StandaloneApplication(handler_app, options).run()
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
- rungunicornserver()
|
|
|
|
|
|
|
+ rungunicornserver()
|