<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/1999/html" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Ross Burton</title><link>http://www.burtonini.com/blog</link><description>A potted account of Ross' life</description><language>en</language><ttl>60</ttl><dc:creator>Ross Burton</dc:creator><admin:generatorAgent rdf:resource="http://pyblosxom.sourceforge.net/"/><admin:errorReportsTo rdf:resource="mailto:ross@burtonini.com"/><item><title>ZeroConf Bookmarks in Epiphany</title><guid isPermaLink="false">computers/avahi-epiphany-2006-02-11-17-50</guid><link>http://www.burtonini.com/blog/computers/avahi-epiphany-2006-02-11-17-50</link><description>Yesterday I noticed that Epiphany in Ubuntu (and probably Debian too) is now build with Zeroconf support, which means it ...</description><content:encoded><![CDATA[    <p>
      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.
    </p>
    <p>
      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.
    </p>
    <p>
      The first step to having Zeroconf enlightenment is to ensure
      <tt>avahi-daemon</tt> 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.
    </p>
    <p>
      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
      <tt>/etc/avahi/services/cups.service</tt> on Melchett with the following
      contents, the web site is published:
    </p>
    <pre>
&lt;?xml version="1.0" standalone='no'?&gt;
&lt;!DOCTYPE service-group SYSTEM "avahi-service.dtd"&gt;
&lt;service-group&gt;
  &lt;name&gt;Epson Stylus Photo R220 Admin&lt;/name&gt;
  &lt;service&gt;
    &lt;type&gt;_http._tcp&lt;/type&gt;
    &lt;port&gt;631&lt;/port&gt;
    &lt;txt-record&gt;path=/printers/epson-stylus-photo-r220&lt;/txt-record&gt;
  &lt;/service&gt;
&lt;/service-group&gt;
</pre>
    <p>
      Each <tt>.service</tt> file in <tt>/etc/avahi/services</tt> defines a
      group of services.  A group has a name, and a set of services.  Each
      service has a number of properties:
    </p>
    <dl>
      <dt>Type</dt>
      <dd>
        Specifies what the type of the service is (<tt>_http._tcp</tt> is HTTP
        over TCP).  There is a <a
          href="http://www.dns-sd.org/ServiceTypes.html">canonical list of types
          available</a>.  This is a required element.
      </dd>
      <dt>Port</dt>
      <dd>
        What port the service is listening on.  This is a required element,
        there is no default port 80 for <tt>_http._tcp</tt> services.
      </dd>
      <dt>Text Record</dt>
      <dd>
        This sets arbitary key-value pairs, which are interpreted on a
        per-service manner.  For <tt>_http._tcp</tt> services the valid keys are
        <tt>u</tt> (username), <tt>p</tt> (password) and <tt>path</tt>.
    </dl>
    <p>
      There are also <tt>domain-name</tt> and <tt>host-name</tt> properties, but
      these are not used in this service description as the service is on the
      local machine.
    </p>
    <p>
      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
      <tt>/printers/epson-stylus-photo-r220</tt>.  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
      <tt>http://melchett.local:631/printers/epson-stylus-photo-r220</tt> A
      quick pop into Epiphany shows that this is indeed the case, there is now a
      <cite>Local Sites</cite> category in the bookmarks containing <cite>Epson
      Stylus Photo R220 Admin</cite>.
    </p>
    <p>
      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 <tt>avahi-publish-address</tt> to give the machine a Zeroconf name,
      but this afternnon Trent committed <a
        href="http://lathiat.livejournal.com/34943.html">static name mapping</a>
      to Avahi.  When this is in a released version, I'll continue this article.
    </p>
]]></content:encoded><category domain="http://www.burtonini.com">/computers</category><dc:date>2006-02-11T17:50:00Z</dc:date></item></channel></rss>