dependabot / cli

A tool for testing and debugging Dependabot update jobs.
MIT License
251 stars 38 forks source link

fix WSL "connection refused" to the fake API #311

Closed jakecoffman closed 1 month ago

jakecoffman commented 7 months ago

By default the CLI starts a fake API server which intercepts calls to a real API which allows the CLI to print output to stdout or a file.

Unfortunately on Linux, Docker won't allow a container to communicate with a server running on the host on 127.0.0.1, so we had to set it to 0.0.0.0.

Even more unfortunate, is on WSL which is a Linux variant, 0.0.0.0 doesn't work at all so we have to set it back to 127.0.0.1.

Using the info in https://github.com/microsoft/WSL/issues/423#issuecomment-221627364 to detect WSL.

jakecoffman commented 6 months ago

@RobJellinghaus if you have a free moment, could you verify that this works in WSL without having to use the FAKE_API_HOST environment variable?