ZeroConf Bookmarks in Epiphany

Yesterday I noticed that Epiphany in Ubuntu (and probably Debian too) is now build with Zeroconf support, which means it will detect any web sites exported over Zeroconf and add them to the bookmarks.

This totally rocks, as instead of having a number of bookmarks for various administration pages on my machines, the machines can export them over Zeroconf and when I am at home and those machines are on, they'll appear magically.

The first step to having Zeroconf enlightenment is to ensure avahi-daemon is installed on all machines. It doesn't matter if there are some machines that it cannot be installed on (i.e. router running embedded software), as other machines can publish their name and services on their behalf.

The first service I published is the web-based admin pages for my printer. The printer is connected to a small server called Melchett (a Buffalo LinkStation) which is running CUPS. By creating /etc/avahi/services/cups.service on Melchett with the following contents, the web site is published:

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name>Epson Stylus Photo R220 Admin</name>
  <service>
    <type>_http._tcp</type>
    <port>631</port>
    <txt-record>path=/printers/epson-stylus-photo-r220</txt-record>
  </service>
</service-group>

Each .service file in /etc/avahi/services defines a group of services. A group has a name, and a set of services. Each service has a number of properties:

Type
Specifies what the type of the service is (_http._tcp is HTTP over TCP). There is a canonical list of types available. This is a required element.
Port
What port the service is listening on. This is a required element, there is no default port 80 for _http._tcp services.
Text Record
This sets arbitary key-value pairs, which are interpreted on a per-service manner. For _http._tcp services the valid keys are u (username), p (password) and path.

There are also domain-name and host-name properties, but these are not used in this service description as the service is on the local machine.

In summary, you can see that I have specified that there is a web page accessible via HTTP on this machine, available on port 631 at the path /printers/epson-stylus-photo-r220. When other machines search the network for web pages they'll find this service entry (with the hostname properties filled in by Avahi), and generate the URL http://melchett.local:631/printers/epson-stylus-photo-r220 A quick pop into Epiphany shows that this is indeed the case, there is now a Local Sites category in the bookmarks containing Epson Stylus Photo R220 Admin.

There is one other thing I need to explain: how to publish services on behalf of other machines. Until this afternoon this required something to run avahi-publish-address to give the machine a Zeroconf name, but this afternnon Trent committed static name mapping to Avahi. When this is in a released version, I'll continue this article.

17:50 Saturday, 11 Feb 2006 [#] [computers] (7 comments)

Posted by Ryan at Sat Feb 11 19:12:29 2006:
Is there a management app for this? There should be.
Posted by Ross at Sat Feb 11 21:07:58 2006:
Not yet, but there is an API for the daemon and the configuration files are all XML, so it shouldn't be tricky.
Posted by Davyd at Sun Feb 12 03:40:29 2006:
A strange voice from the future tells you to put all of this into a GNOME Journal article.
Posted by sebest at Sun Feb 12 14:42:14 2006:
to fit with epiphany zeroconf bookmark, there is even an apache 2 module to publish http, https, webdav folder...

and the package is coming soon in ubuntu universe

http://revu.tauware.de/details.py?upid=1737
Posted by DataPath at Wed Mar 15 23:46:19 2006:
Someone has to get this onto those linksys routers that run linux.  Having them automatically export a bookmark for the administration page for them would be sweet.
Posted by Anders Jackson at Mon May 8 08:01:52 2006:
You can already have that! I has Debian running on my Linksys (yes, it is Linksys NSLU2, but then I have an external WLAN-usb-stick on it :-) It works realy good.  Thanks Ross for publish the information here!
Posted by Jon Cellini at Tue Jul 11 08:57:01 2006:
Thanks! Your writeup was exactly what I was looking for :)

Name:


E-mail:


URL:


Add 4 and 1 (required):


Comment: