Skip to content

Use wildcard FQDN for ddev sites instead of manipulating /etc/hosts (most of the time) #175

Closed

Description

@rfay

What happened (or feature request):

Feature request: Our current way of specifying a ddev hostname for a site involves manipulating /etc/hosts, which requires root permissions. However, we can do what kalabox does and switch to using an actual resolvable domainame which has a wildcard on it. We can retain the ddev hostname command for uses when people are offline and give them explicit instructions on it.

Spinoff from Security: ddev can be used to sudo an arbitrary command

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else do we need to know:

Related source links or issues:

Activity

  1. rickmanelius commented on May 16, 2017

    @rickmanelius
    Contributor

    This was touched on today. @rfay Can you provide additional information what this would look like as well as what the fallback would be if an internet connection was not available?

  2. rfay commented on May 16, 2017

    @rfay
    MemberAuthor

    The way current versions of kalabox do this is they put a wildcard dns record for *.kbox.site, so that anythingyouwant.kbox.site will resolve to 127.0.0.1. We could do *.ddev.site or any such.

    When offline, a person would have to manually add a hosts file entry. On osx or linux, this could be done with sudo ddev hostname me.ddev.site 127.0.0.1. I would expect on windows we'd have to give instructions about how to run ddev with admin privs. (Or have them edit c:\windows\system32\drivers\etc\hosts)

    BTW, our current usage of .local isn't exactly correct, as it is in fact reserved for specific local mDNS operations.

  3. rickmanelius commented on May 16, 2017

    @rickmanelius
    Contributor

    Related issues:

    • Features similar to vagrant share.
    • Could this help us with local SSL.
  4. rfay commented on May 17, 2017

    @rfay
    MemberAuthor

    AFAIK it's impossible to get a real SSL cert that points to a non-internet IP address, so it probably wouldn't do that.

    I don't think it's related to the ideas in "vagrant share"

  5. rickmanelius commented on May 17, 2017

    @rickmanelius
    Contributor

    @rfay In my experience, the process of generating a CSR to obtain an SSL does not require providing the IP address or having the domain A record pointed at a server/IP address.

  6. rickmanelius commented on May 17, 2017

    @rickmanelius
    Contributor

    Now on the flip side, getting a real, non-self signed cert to work without connection to the internet, that's a separate item that I'm not sure would work/not work. So breaking this into two components: 1) getting an issued SSL cert and 2) getting said cert to work locally against 127.0.0.1 without connection to the internet.

  7. rfay commented on May 17, 2017

    @rfay
    MemberAuthor

    I might be having a brain fart. Easy to test. You're certainly right that the IP is a part of getting a cert. Either I'm just off in lala land or browsers no longer accept.

  8. rfay commented on May 17, 2017

    @rfay
    MemberAuthor

    On SSL: Sorry, I was just backwards confused. I was thinking about issuing a cert for an unregistrable domain (like .local or whatever). I was able to put junkssl.drud.com on my local machine at 127.0.0.1, and use our drud.com wildcard to access it, both firefox and chrome were fine with it.

    The one issue here is that we'd have to distribute a key/crt for the wildcard cert, which would mean that even a slightly ambitious person could use that in another context. But since we control the DNS, it doesn't seem like that big an issue, but worthy of thought.

    However... this doesn't really have anything to do with this issue, because DNS is unneeded for the use of SSL. Just having a name in the hosts file and a wildcard cert configured on the nginx container would do the job just fine.

    screenshot_5_17_17__10_59_am

  9. added this to the milestone on May 30, 2017
  10. rickmanelius commented on Jun 6, 2017

    @rickmanelius
    Contributor

    This is not a priority at the moment. Pulling out of this for now.

  11. removed this from the milestone on Jun 6, 2017
  12. rickmanelius commented on Oct 19, 2017

    @rickmanelius
    Contributor

    This will also be addressed in #416 and we will continue to use /etc/host as a fallback when access to a valid TLD is not achievable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions