YuMS / gitlab-ce-pages

Unofficial GitLab Pages for GitLab CE
MIT License
64 stars 11 forks source link

added initial support for dynamic dns #12

Closed morph027 closed 8 years ago

morph027 commented 8 years ago

We can use a simple DNS server (dnsmasq) to create a fake internal .gitlab.io domain. Outside .gitlab.io names will still work.

$ cat /srv/gitlab-ce-pages/cname/cname.txt
morph027/foo foobar.gitlab.io
$ nslookup pages.gitlab.io
Server:     my.internal.dns.server
Address:    my.internal.dns.server#53

Non-authoritative answer:
Name:   pages.gitlab.io
Address: 104.208.235.32

$ nslookup foobar.gitlab.io
Server:     my.internal.dns.server
Address:    my.internal.dns.server#53

Name:   foobar.gitlab.io
Address: gcp.server.ip.address

Looking forward to read your thoughts ;)

morph027 commented 8 years ago

Ok, i've made the behaviour much more similiar to gitlab, the project name now will be the domain (no multiple domain support) and get rid of the watcher nodemon (and therefore the zombie problem in #13) by adding tini.

Essential:

Now, the Docker container will serve DNS for the "mine.gitlab.io".

YuMS commented 8 years ago

I'm working on #9 to make nginx support *.gitlab.io with syntax like https://github.com/YuMS/gitlab-ce-pages/issues/9#issuecomment-250108494. This doesn't need an external DNS server.

I think tini related changes are great, but it should go with another PR.

morph027 commented 8 years ago

Ah, great. Then i'm going to prepare a clean PR without dnsmasq.

morph027 commented 8 years ago

Again, thought about it ;)

WIth custoom nginx configs, someone still needs to add the info where to find things into DNS. So users just can't deploy pages without begging for DNS entries.

YuMS commented 8 years ago

Yes, I can see how much it could benefits from your embedded DNS. But I think such feature could be covered with wildcard server name lookup in NGINX.

What's more, for most of our users, they could simply understand what is DNS and how to use their domain name provider's panel to handle their domain name, rather than to understand how an external DNS works, to use GCP.

morph027 commented 8 years ago

Right. This is why i made it optional :)

So it scales for normal usage with just provider panels and for integrated usage in small networks with already existing dns infrastructure. However, if we can find a simpler solution, i'm totally fine.

In past, i've been investigating different methods for updating entries on existing bind dns servers and it was pita, thats why i always deal with the tiny dnsmasq.

YuMS commented 8 years ago

Thank you for your and #9 's enlightening. 1.3.0 will be out in hour, try it then.

YuMS commented 8 years ago

@morph027 Don't know why, docker hub fails to build 1.3.0 twice. It's out now.