mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Add an option to allow users to choose to what IP address the web server must bind to. Default to 0.0.0.0 (all IP addresses). (#826)
This commit is contained in:
parent
29e3dd404d
commit
88726773f1
@ -24,6 +24,9 @@ manager.add_command('db', MigrateCommand)
|
|||||||
@manager.option(
|
@manager.option(
|
||||||
'-d', '--debug', action='store_true',
|
'-d', '--debug', action='store_true',
|
||||||
help="Start the web server in debug mode")
|
help="Start the web server in debug mode")
|
||||||
|
@manager.option(
|
||||||
|
'-a', '--address', default=config.get("CARAVEL_WEBSERVER_ADDRESS"),
|
||||||
|
help="Specify the address to which to bind the web server")
|
||||||
@manager.option(
|
@manager.option(
|
||||||
'-p', '--port', default=config.get("CARAVEL_WEBSERVER_PORT"),
|
'-p', '--port', default=config.get("CARAVEL_WEBSERVER_PORT"),
|
||||||
help="Specify the port on which to run the web server")
|
help="Specify the port on which to run the web server")
|
||||||
@ -33,7 +36,7 @@ manager.add_command('db', MigrateCommand)
|
|||||||
@manager.option(
|
@manager.option(
|
||||||
'-t', '--timeout', default=config.get("CARAVEL_WEBSERVER_TIMEOUT"),
|
'-t', '--timeout', default=config.get("CARAVEL_WEBSERVER_TIMEOUT"),
|
||||||
help="Specify the timeout (seconds) for the gunicorn web server")
|
help="Specify the timeout (seconds) for the gunicorn web server")
|
||||||
def runserver(debug, port, timeout, workers):
|
def runserver(debug, address, port, timeout, workers):
|
||||||
"""Starts a Caravel web server"""
|
"""Starts a Caravel web server"""
|
||||||
debug = debug or config.get("DEBUG")
|
debug = debug or config.get("DEBUG")
|
||||||
if debug:
|
if debug:
|
||||||
@ -46,7 +49,7 @@ def runserver(debug, port, timeout, workers):
|
|||||||
"gunicorn "
|
"gunicorn "
|
||||||
"-w {workers} "
|
"-w {workers} "
|
||||||
"--timeout {timeout} "
|
"--timeout {timeout} "
|
||||||
"-b 0.0.0.0:{port} "
|
"-b {address}:{port} "
|
||||||
"--limit-request-line 0 "
|
"--limit-request-line 0 "
|
||||||
"--limit-request-field_size 0 "
|
"--limit-request-field_size 0 "
|
||||||
"caravel:app").format(**locals())
|
"caravel:app").format(**locals())
|
||||||
|
@ -23,6 +23,7 @@ BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
|||||||
ROW_LIMIT = 50000
|
ROW_LIMIT = 50000
|
||||||
CARAVEL_WORKERS = 16
|
CARAVEL_WORKERS = 16
|
||||||
|
|
||||||
|
CARAVEL_WEBSERVER_ADDRESS = '0.0.0.0'
|
||||||
CARAVEL_WEBSERVER_PORT = 8088
|
CARAVEL_WEBSERVER_PORT = 8088
|
||||||
CARAVEL_WEBSERVER_TIMEOUT = 60
|
CARAVEL_WEBSERVER_TIMEOUT = 60
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user