keystone icon indicating copy to clipboard operation
keystone copied to clipboard

`server.options.host` is sporadically used

Open genu opened this issue 3 years ago • 2 comments

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 host property breaks the admin-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

genu avatar Aug 26 '22 18:08 genu

Thanks for reporting this @genu, please don't hesitate to open a pull request if you have the time :blue_heart:

dcousens avatar Aug 28 '22 02:08 dcousens

Hi, Can I work on this issue. :)

vikasvmads avatar Sep 07 '22 03:09 vikasvmads

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 avatar Nov 17 '22 18:11 josemf

@josemf pull requests are welcome! No doubt this is important to document, but we haven't had the opportunity to do this yet.

dcousens avatar Nov 18 '22 05:11 dcousens

Added in https://github.com/keystonejs/keystone/pull/8212

dcousens avatar Jan 16 '23 23:01 dcousens