mystmd
mystmd copied to clipboard
myst start --keep-host is not serving/building with HOST env variable
$ myst -v v1.1.46
According to the --keep-host docs this should use the $HOST env variable rather than localhost. This appears not to be the case.
- Whether it's started with
$ myst startor when started with$ HOST=10.0.0.1 myst start --keep-hostit displays that the server is started on localhost and actually binds to external IPs (verified with netstat and tried via a browser). Either way it is reachable by the fqdn or http://10.0.0.1:3000. - However, either way it also builds the html pages with internal links and image tags to http://localhost:3000 so they are not accessible remotely and display as broken image links to the remote user.
The project is simply the unedited myst quickstart.
Am I doing something wrong or is this unexpected behavior?
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
It seems that the express server in book-theme does not specify the interface in app.listen() so express will, by default, bind to all interfaces. So that's one mystery solved (using HOST and --keep-host does not preclude binding to localhost as well. And when it says it's serving on localhost, it is also serving on all interfaces.)
It seems like the html pages are being built with links to localhost. I'm not sure if that happens in book-theme or mystmd.
I think I found where localhost is hardcoded and it is not using the HOST env variable.
Here is a PR where I suggest a fix. https://github.com/executablebooks/mystmd/pull/994