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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Radical-Egg
Copy link

Hi,

There is not an open issue for this but I ran into an issue where I could not change the default port or bind address for snappass. In my case I installed via pip and wanted to bind snappass to 127.0.0.1 as I am planning to use a reverse proxy to reach the app. Is it possible to add the following two environment variables?

BIND_ADDRESS = 127.0.0.1
PORT = 6000

I tested that with no environment variables set, the defaults of 0.0.0.0:5000 are set and working. Given the following variables

BIND_ADDRESS = 127.0.0.1
PORT = 6000
HOST_OVERIDE = example.com

I can reach the app and links are generated with the appropriate URL.

ps. This is my first time submitting a PR, I apologize if I am missing anything.

Thanks all!

``BIND_ADDRESS``: (optional) Used to override the default bind address of 0.0.0.0 for flask app Example: ``127.0.0.1``

``PORT``: (optional) Used to override the default port of 5000 Example: ``6000``

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we prefix them with SNAPPASS_?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, I just made those edits. Thanks for taking a look!

yurushao and others added 3 commits April 17, 2024 16:19
Prefix bind address and port with SNAPPASS_
update readme to prefix SNAPPASS_ to bind address and port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants