Environment variables for default port and bind address (#342)
* Add env vars to override default bind address and port * Update main.py Prefix bind address and port with SNAPPASS_ * Update README.rst update readme to prefix SNAPPASS_ to bind address and port --------- Co-authored-by: Yuru Shao <yshao@pinterest.com>
This commit is contained in:
parent
4e5fc2ef1f
commit
9e435787c6
2 changed files with 6 additions and 1 deletions
|
@ -96,6 +96,10 @@ need to change this.
|
|||
|
||||
``HOST_OVERRIDE``: (optional) Used to override the base URL if the app is unaware. Useful when running behind reverse proxies like an identity-aware SSO. Example: ``sub.domain.com``
|
||||
|
||||
``SNAPPASS_BIND_ADDRESS``: (optional) Used to override the default bind address of 0.0.0.0 for flask app Example: ``127.0.0.1``
|
||||
|
||||
``SNAPPASS_PORT``: (optional) Used to override the default port of 5000 Example: ``6000``
|
||||
|
||||
APIs
|
||||
----
|
||||
|
||||
|
|
|
@ -353,7 +353,8 @@ def health_check():
|
|||
|
||||
@check_redis_alive
|
||||
def main():
|
||||
app.run(host='0.0.0.0')
|
||||
app.run(host=os.environ.get('SNAPPASS_BIND_ADDRESS', '0.0.0.0'),
|
||||
port=os.environ.get('SNAPPASS_PORT', 5000))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in a new issue