keystone
keystone copied to clipboard
`server.options.host` is sporadically used
TLDR
The server.options.hosts property should allow a user to provide a custom hostname for the server. If one is provided, like so:
server: {
options: {
host: 'my-special-app.local',
},
},
The host is properly set for the dev server at boot up, but the host is not properly handled across the rest of the stack.
Some observations:
- Many of the tests assume the host is always localhost
- The admin-ui seems to have localhost hardcoded because setting the
hostproperty breaks theadmin-ui - Many the logs assume host is always
localhost(see below)
https://github.com/keystonejs/keystone/blob/c2275621d7e96576acd59de7636095c432b3570e/packages/core/src/scripts/run/dev.ts#L297-L305
Thanks for reporting this @genu, please don't hesitate to open a pull request if you have the time :blue_heart:
Hi, Can I work on this issue. :)
I don't think this is well documented either.
Some environments (some containers for example) really need need the http and graphql servers to be bound to a network interface other than localhost.
Please add server option server.options.host to the documentation page: https://keystonejs.com/docs/config/config#server
Thank you!
@josemf pull requests are welcome! No doubt this is important to document, but we haven't had the opportunity to do this yet.
Added in https://github.com/keystonejs/keystone/pull/8212