About Archive Tags RSS Feed


Slowly releasing bits of code

29 June 2014 21:50

As previously mentioned I've been working on git-based DNS hosting for a while now.

The site was launched for real last Sunday, and since that time I've received enough paying customers to cover all the costs, which is nice.

Today the site was "relaunched", by which I mean almost nothing has changed, except the site looks completely different - since the templates/pages/content is all wrapped up in Bootstrap now, rather than my ropy home-made table-based layout.

This week coming I'll be slowly making some of the implementation available as free-software, having made a start by publishing CGI::Application::Plugin::AB - a module designed for very simple A/B testing.

I don't think there will be too much interest in most of the code, but one piece I'm reasonably happy with is my webhook-receiver.

Webhooks are at the core of how my service is implemented:

  • You create a repository to host your DNS records.
  • You configure a webhook to be invoked when pushing to that repository.
  • The webhook will then receive updates, and magically update your DNS.

Because the webhook must respond quickly, otherwise github/bitbucket/whatever will believe you've timed out and report an error, you can't do much work on the back-end.

Instead I've written a component that listens for incoming HTTP POSTS, parses the body to determine which repository that came from, and then enqueues the data for later processing.

A different process will be constantly polling the job-queue (which in my case is Redis, but could be beanstalkd, or similar. Hell even use MySQL if you're a masochist) and actually do the necessary magic.

Most of the webhook processor is trivial, but handling different services (github, bitbucket, etc) while pretending they're all the same is hard. So my little toy-service will be released next week and might be useful to others.

ObRandom: New pricing unveiled for users of a single zone - which is a case I never imagined I'd need to cover. Yay for A/B testing :)



Comments on this entry

icon Paul Mellors at 12:04 on 1 July 2014

Hi Steve, I read your work on planet debian, so I had a look at the site

On the https://dns-api.com/docs/pricing/ page, if you hover over the home link, the url it's going back to is https://dns-api.com/docs/pricing/ shouldn't it be https://dns-api.com/ ?

I'll stop interfering now, thanks for making my days more interesting :D


icon Steve Kemp at 12:08 on 1 July 2014

Thanks for the bug report - Yes, the home-link was broken for some pages unless you were signed in to your account.

I've committed the fix now, and deployed. A nice subtle catch, thanks very much!

icon Steve Weinreich at 10:04 on 6 July 2014

Hi Steve,

There is a typo in the link to the sample repo on
https://dns-api.com/docs/zone/ it points to /dogs/git instead of /docs/git.

BTW: I have also tried dhcp.io and I was even able to let my fritz-box to the update. Turn the setting to user defined, enter the complete update url from dhcp.io, fill the remaining fields with dummy data and get your IP updated on reconnect.

Very nice, many thanks for this!

cheerio Steve

icon Steve Kemp at 10:13 on 6 July 2014

Thanks for the link-correction, I've updated now.

I'm pleased the dhcp.io site/service works for you - I've been using cron on my personal systems, but whatever works is good :)