Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variables for default port and bind address #342

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``

yurushao marked this conversation as resolved.
Show resolved Hide resolved
APIs
----

Expand Down
3 changes: 2 additions & 1 deletion snappass/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down