Explain why relaying through this is a good idea!
[irker.git] / irkerd.xml
1 <!DOCTYPE refentry PUBLIC 
2    "-//OASIS//DTD DocBook XML V4.1.2//EN"
3    "docbook/docbookx.dtd">
4 <refentry id='irkerd.8'>
5 <refmeta>
6 <refentrytitle>irkerd</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class='date'>Aug 27 2012</refmiscinfo>
9 <refmiscinfo class='source'>irker</refmiscinfo>
10 <refmiscinfo class='product'>irker</refmiscinfo>
11 <refmiscinfo class='manual'>Commands</refmiscinfo>
12 </refmeta>
13 <refnamediv id='name'>
14 <refname>irkerd</refname>
15 <refpurpose>relay for shipping notifications to IRC servers</refpurpose>
16 </refnamediv>
17 <refsynopsisdiv id='synopsis'>
18
19 <cmdsynopsis>
20   <command>irkerd</command>
21      <arg>-d <replaceable>debuglevel</replaceable></arg>
22      <arg>-l <replaceable>logfile</replaceable></arg>
23      <arg>-n <replaceable>nick</replaceable></arg>
24      <arg>-p <replaceable>password</replaceable></arg>
25      <arg>-V</arg>
26          <arg>-h</arg>
27 </cmdsynopsis>
28 </refsynopsisdiv>
29
30 <refsect1 id='description'><title>DESCRIPTION</title>
31
32 <para><application>irkerd</application> is a specialized write-only IRC
33 client intended to be used for shipping notification messages to IRC
34 channels. The use case in mind when it was designed was broadcasting
35 notifications from commit hooks in version-control systems.</para>
36
37 <para>The main advantage of relaying through this daemon over
38 individual scripted sends from applications is that it can maintain
39 connection state for multiple channels, rather than producing obnoxious
40 join/leave channel spam on every message.</para>
41
42 <para><application>irkerd</application> is a socket server that
43 listens on for UDP or TCP packets on port 6659 for textual request
44 lines containing JSON objects and terminated by a newline. Each JSON
45 object must have two members: "to" specifying a destination or
46 destination list, and "privmsg" specifying the message text.
47 Examples:
48
49 <programlisting>
50 {"to":"irc://chat.freenode.net/git-ciabot", "privmsg":"Hello, world!"}
51 {"to":["irc://chat.freenode.net/#git-ciabot","irc://chat.freenode.net/#gpsd"],"privmsg":"Multichannel test"}
52 {"to":"irc://chat.hypothetical.net:6668/git-ciabot", "privmsg":"Hello, world!"}
53 {"to":"irc://chat.hypothetical.net:6668/git-private?key=topsecret", "privmsg":"Keyed channel test"}
54 </programlisting></para>
55
56 <para>If the channel part of the URL does not have one of the prefix
57 characters <quote>#</quote>, <quote>&amp;</quote>, or
58 <quote>+</quote>, a <quote>#</quote> will be prepended to it before
59 shipping - <emphasis>unless</emphasis>the channel part has the suffix
60 ",isnick" (which is unconditionally removed).</para>
61
62 <para>The host part of the URL may have a port-number suffix separated by a
63 colon, as shown in the third example; otherwise
64 <application>irkerd</application> sends messages to the the default 6667 IRC
65 port of each server.</para>
66
67 <para>To join password-protected (mode +k) channels, the channel part of the
68 URL may be followed with a query-string indicating the channel key, of the
69 form <quote>?secret</quote> or <quote>?key=secret</quote>, where
70 <quote>secret</quote> is the channel key.</para>
71
72 <para>An empty message is legal and will cause
73 <application>irkerd</application> to join the target channels without
74 actually emitting a message.  This may be useful for advertising that
75 an instance is up and running, or for joining a channel to log its
76 traffic.</para>
77 </refsect1>
78
79 <refsect1 id='options'><title>OPTIONS</title>
80
81 <para><application>irkerd</application> takes the following options:</para>
82
83 <variablelist>
84 <varlistentry>
85 <term>-d</term>
86 <listitem><para>Takes a following value, setting the debugging level from
87 it. This option will generally only be of interest to developers;
88 consult the source code for details.</para></listitem>
89 </varlistentry>
90 <varlistentry>
91 <term>-l</term>
92 <listitem><para>Takes a following filename, logs traffic to that file.
93 Each log line consists of three |-separated fields; a numeric
94 timestamp in Unix time, the FQDN of the sending server, and the
95 message data.</para></listitem>
96 </varlistentry>
97 <varlistentry>
98 <term>-n</term>
99 <listitem><para>Takes a following value, setting the nick
100 to be used. If the nick contains a numeric format element
101 (such as %03d) it is used to generate suffixed fallback names
102 in the event of a nick collision.</para></listitem>
103 </varlistentry>
104 <varlistentry>
105 <term>-p</term>
106 <listitem><para>Takes a following value, setting a nickserv
107 password to be used. If given, this password is shipped to
108 authenticate the nick on receipt of a welcome message.</para></listitem>
109 </varlistentry>
110 <varlistentry>
111 <term>-V</term>
112 <listitem><para>Write the program version to stdout and
113 terminate.</para></listitem>
114 </varlistentry>
115 <varlistentry>
116 <term>-h</term>
117 <listitem><para>Print usage instructions and terminate.</para></listitem>
118 </varlistentry>
119 </variablelist>
120
121 </refsect1>
122
123 <refsect1 id='limitations'><title>LIMITATIONS</title>
124 <para>Requests via UDP optimizes for lowest latency and network load
125 by avoiding TCP connection setup time; the cost is that delivery is
126 not reliable in the face of packet loss.</para>
127
128 <para>An <application>irkerd</application> instance with a
129 publicly-accessible request socket could complicate blocking of IRC
130 spam by making it easy for spammers to submit while hiding their IP
131 addresses; the better way to deploy, then, is on places like
132 project-hosting sites where the <application>irkerd</application>
133 socket can be visible from commit-hook code but not exposed to the
134 outside world. Priming your firewall with blocklists of IP addresses
135 known to spew spam is always a good idea.</para>
136
137 <para>The absence of any option to set the service port is deliberate.
138 If you think you need to do that, you have a problem better solved at
139 your firewall.</para>
140
141 <para>IRC has a message length limit of 510 bytes; generate your
142 privmsg attribute values with appropriate care.</para>
143
144 <para>IRC ignores any text after an embedded newline. Be aware that
145 <application>irkerd</application> will turn payload strings with
146 embedded newlines into multiple IRC sends to avoid having message data
147 discarded. </para>
148 </refsect1>
149
150 <refsect1 id='see_also'><title>SEE ALSO</title>
151 <para>
152 <citerefentry><refentrytitle>irkerhook</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
153 </para>
154 </refsect1>
155
156 <refsect1 id='authors'><title>AUTHOR</title>
157 <para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>.  See the
158 project page at <ulink
159 url='http://www.catb.org/~esr/irker'>http://www.catb.org/~esr/irker</ulink>
160 for updates and other resources, including an installable repository
161 hook script.</para>
162 </refsect1>
163 </refentry>
164