hocus-dev / hocus

🪄 Spin up ready-to-code, disposable dev environments on your own servers. Self-hosted alternative to Gitpod and Github Codespaces.
https://hocus.dev
MIT License
3.24k stars 82 forks source link

Hocus fails to resolve DNS records hosted locally #5

Open szymex73 opened 1 year ago

szymex73 commented 1 year ago

🐛 Bug description

When using a self-hosted git and DNS, hocus fails on the prebuild stage for such a repo since it cannot resolve the local name with the hardcoded 8.8.8.8 DNS server.

In my setup, I host a DNS server locally in the network and provide local domain names that get resolved through it. The DNS server IP is given along with the DHCP lease so the host system knows which resolver to use, but Hocus does not inherit this and fails to resolve the name of the local git server.

Steps to reproduce

  1. Install Hocus
  2. Set up a git server in a local network as well as a DNS server with records pointing to that git server
  3. Add a repository to Hocus

Result

The prebuild status for branches stays pending perpetually as it fails to fetch the project since it cannot resolve the local git server with 8.8.8.8.

What should happen

Hocus should be able to resolve local DNS names and pull the repo.

Possible fixes

This issue could be fixed by providing the ability to configure DNS servers used internally instead of hardcoding 8.8.8.8, or by setting up a DNS forwarder that the VMs could use internally that would then forward the requests to the DNS used by the host system.

Environment

gorbak25 commented 1 year ago

Hi @szymex73! Thank you for reporting this bug :) We will add a DNS proxy to the Hocus Agent so the VM's will be able to use the DNS resolver inside the agent container.