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

Listen on 127.0.0.1 rather than 0.0.0.0 #35

Closed
alecthomas opened this issue May 14, 2022 · 10 comments
Closed

Listen on 127.0.0.1 rather than 0.0.0.0 #35

alecthomas opened this issue May 14, 2022 · 10 comments

Comments

@alecthomas
Copy link

OSX throws up a security prompt every time bud starts because it's binding to 0.0.0.0. Binding to 127.0.0.1 instead will rectify this.

image

@alecthomas
Copy link
Author

Ah I see by digging into the code that this is actually possible to override:

bud run --port 127.0.0.1:3000

I didn't expected that to work because the flag is named --port, rather than eg. --bind.

@syke99
Copy link
Contributor

syke99 commented May 14, 2022

@alecthomas not yet a contributor (though I plan to once my other projects calm down just a bit) but how do y’all feel about removing the need to pass in a —port flag, adding in a check run to determine to user’s OS and bind to 0.0.0.0 if anything but OSX?

@alecthomas
Copy link
Author

IMO it's fine to bind development servers to 127.0.0.1 by default. As long as there's a way to change it, there's no real downside.

@syke99
Copy link
Contributor

syke99 commented May 14, 2022

I don’t either, but was unaware of the team’s view and wanted to toss out an option for if defaulting to 127.0.0.1 was shot down. Thanks!!

@amandamcg
Copy link

OSX throws up a security prompt every time bud starts because it's binding to 0.0.0.0. Binding to 127.0.0.1 instead will rectify this.

image

On my machine I didn't even get a warning, it just wouldn't load. Loading as http://localhost:3000/ worked fine in case it helps anyone else.

@quaintdev
Copy link

I agree we should default to 127.0.0.1. But I think while building for production it should default to 0.0.0.0. I am not sure if bud is aware of dev/prod environments though. I guess passing the IP seems easiest solution for now.

I don't like the fact that --port 127.0.0.1:3000 can change binding address too. Probably we should change '--portto--bind`.

@syke99
Copy link
Contributor

syke99 commented May 15, 2022

Is there a reason that there’s not separate functionality for changing the binding address and port separately with —bind and —port, respectively? Seems doing so could possibly open up a solution for determining dev vs. prod. Especially in the context of CI/CD

@matthewmueller
Copy link
Contributor

matthewmueller commented May 15, 2022

PR up to change the default to 127.0.0.1.

I've created a discussion for changing --port to something better. Please share your thoughts there!

@alecthomas
Copy link
Author

🙏

@matthewmueller
Copy link
Contributor

FYI. This is available in v0.1.1. To upgrade, run:

curl -sf curl https://raw.githubusercontent.com/livebud/bud/main/install.sh | sh

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

No branches or pull requests

5 participants