bigfatbrowncat / gatekeeper

A server for a small home data center supporting multiple dockers with mDNS-propagated hostnames

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avahi/mDNS CNAME publisher

This service publishes CNAME records pointing to the local host over multicast DNS using the Avahi daemon found in all major Linux distributions. Useful as a poor-man's service discovery or as a helper for named virtual-hosts in development environments.

Since Avahi is compatible with Apple's Bonjour, these names are usable from MacOS X and Windows too.

Running

Pass (one or more) CNAMEs as command-line arguments to publish-cname.py:

$ ./publish-cname.py name01.local name02.local

Names are restricted to the .local domain, but can have arbitrary sub-domains of your choosing:

$ ./publish-cname.py name01.local name02.local name03.mysubdomain.local

If the server running publish-cname.py is being announced over mDNS as myserver.local, all of these names will be answered by Avahi as CNAMEs for myserver.local, regardless of any sub-domains they might have. They remain available as long as publish-cname.py is running.

Run publish-cname.py with no arguments to find out about the available options.

Integrating

The AvahiPublisher class as contained in mpublisher.py can be integrated into your application to have it publish its own CNAMEs.

Dependencies

Besides a working Avahi daemon, this service requires the Python bindings for both Avahi and D-BUS (eg. as provided by the python-avahi and python-dbus packages in Debian).

Installing the system-provided Python bindings for Avahi is optional but recommended. As a fallback, this package provides a copy for Linux distributions where they are not readily available (eg. CentOS 6 and 7).

About

A server for a small home data center supporting multiple dockers with mDNS-propagated hostnames

License:MIT License


Languages

Language:Python 99.4%Language:Makefile 0.6%