Slowly releasing bits of code

Sunday, 29 June 2014

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

[gravitar] Paul Mellors

Submitted at 12:04:08 on 1 july 2014

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

On the page, if you hover over the home link, the url it's going back to is shouldn't it be ?

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


[author] Steve Kemp

Submitted at 12:08:28 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!

[gravitar] Steve Weinreich

Submitted at 10:04:51 on 6 july 2014

Hi Steve,

There is a typo in the link to the sample repo on it points to /dogs/git instead of /docs/git.

BTW: I have also tried 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, fill the remaining fields with dummy data and get your IP updated on reconnect.

Very nice, many thanks for this!

cheerio Steve

[author] Steve Kemp

Submitted at 10:13:11 on 6 july 2014

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

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


Comments are closed on posts which are more than ten days old.

Recent Posts

Recent Tags