FreedomBen / dory

Your development proxy for docker
MIT License
156 stars 24 forks source link

Issues with setting up resolv on Kubuntu 17.04 #9

Closed markiewitch closed 7 years ago

markiewitch commented 7 years ago

Hello, I have some problems starting dory. Output of dory start

Successfully started nginx proxy
Successfully started dnsmasq
Requesting sudo to write to /etc/resolv.conf
--status to see details about the actual nameserver 127.0.0.1  # added by dory
nameservers.
nameserver 127.0.0.53' | sudo tee /etc/resolv.conf >/dev/null: -c: line 0: unexpected EOF while looking for matching `''
--status to see details about the actual nameserver 127.0.0.1  # added by dory
nameservers.
nameserver 127.0.0.53' | sudo tee /etc/resolv.conf >/dev/null: -c: line 4: syntax error: unexpected end of file
Error configuring local resolver

I'm running an almost fresh Kubuntu 17.04. ruby -v prints ruby 2.3.3p222 and I got it from rvm. dory -v yields Dory - Version: 0.5.2

.dory.yml:

---
dory:
  dnsmasq:
    enabled: true
    domains:               # array of domains that will be resolved to the specified address
      - domain: docker     # you can set '#' for a wilcard
        address: 127.0.0.1 # return for queries against the domain
      - domain: dev
        address: 127.0.0.1
    container_name: dory_dnsmasq
    port: 53  # port to listen for dns requests on.  must be 53 on linux. can be anything that's open on macos
    kill_others: yes
  nginx_proxy:
    enabled: true
    container_name: dory_dinghy_http_proxy
    https_enabled: true
    ssl_certs_dir: ''  # leave as empty string to use default certs
  resolv:
    enabled: true
    nameserver: 127.0.0.1
    port: 53  # port where the nameserver listens. On linux it must be 53

I'd love this proxy on my desktop (I use dinghy on Mac) but I've ran out of possible ideas :disappointed:

FreedomBen commented 7 years ago

Confirmed issue. I'll try to get a fix soon. Until then, you can workaround this by adding:

nameserver 127.0.0.1
tierra commented 7 years ago

This seems to just be triggered by your resolve.conf containing quotes (") given the new comment left in there about systemd-resolved.

FreedomBen commented 7 years ago

Oh man, not sure how I missed your comment @tierra

Thanks man! I'll try to get this patched.

tierra commented 7 years ago

Excellent, thanks. Yeah, systemd-resolved leaves a new comment in the file, and that's what Dory is tripping up on during parsing:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 127.0.0.53

Specifically, it's that comment about "systemd-resolve --status" that's tripping it.

FreedomBen commented 7 years ago

Ok, I released the latest version v0.6.1 that contains this fix, and also backported to a new version v0.5.3. The 0.6.x contains an updated dory-http-proxy (which you may not care about so would rather just upgrade to a patch version).