-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
allow specifying network interface with "server-host" option #1280
Conversation
Beep boop! 🤖 Hey @nathanstitt, thanks for your PR! One of my human friends will review this PR and get back to you as soon as possible. 🕐 Stay awesome! 😎 |
Review app for commit 5e5c3a8 deployed to Heroku: https://hge-ci-pull-1280.herokuapp.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Just a few changes around how the host
value is stored in ServerOpts
.
server/src-lib/Hasura/Server/Init.hs
Outdated
@@ -33,6 +33,7 @@ type RawAuthHook = AuthHookG (Maybe T.Text) (Maybe AuthHookType) | |||
data RawServeOptions | |||
= RawServeOptions | |||
{ rsoPort :: !(Maybe Int) | |||
, rsoHost :: !(Maybe String) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of String
we can directly use HostPreference
(http://hackage.haskell.org/package/warp-3.2.25/docs/Network-Wai-Handler-Warp.html#t:HostPreference)
3c88c32
to
8b65ae4
Compare
Thanks for the review @0x777 - I've made the changes to store value as HostPreference as soon as it's read. Note that I also had to extend the |
Review app for commit 8b65ae4 deployed to Heroku: https://hge-ci-pull-1280.herokuapp.com |
This looks good! Can you document the cli flag and the environment variable here: https://github.com/hasura/graphql-engine/blob/master/docs/graphql/manual/deployment/graphql-engine-flags/reference.rst |
Oh neat! I had no idea those were documented. I only found the port option by grepping the code 😁 just pushed a update to docs, happy to reword if you'd like |
ca8763a
to
0c5bb8d
Compare
Review app for commit 0c5bb8d deployed to Heroku: https://hge-ci-pull-1280.herokuapp.com |
Review app https://hge-ci-pull-1280.herokuapp.com is deleted |
Beep boop! 🤖 Whoa! 🎉 🎉 💃 Awesome work @nathanstitt! 💪 🏆 All of us at Hasura ❤️ what you did. Thanks again 🤗 |
Very very good. |
Description
This adds an option to allow specifying the network address to bind to. Previously graphql-engine would bind to the wildcard interface, while I'd prefer it only listen to
localhost
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
Solution and Design
I'm very much a Haskel neophyte and pretty much just copied how
server-port
worked. I'm happy to rework if this could be accomplished in a better manner.Type
Checklist:
server-port
is not documented. If you'd like I can add a mention for both of these to the README