Wrote irkerd usage
[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><application>irkerd</application> is a socket server that
38 listens on for UDP or TCP packets on port 6659 for textual request
39 lines containing JSON objects and terminated by a newline. Each JSON
40 object must have two members: "to" specifying a destination or
41 destination list, and "privmsg" specifying the message text.
42 Examples:
43
44 <programlisting>
45 {"to":"irc://chat.freenode.net/git-ciabot", "privmsg":"Hello, world!"}
46 {"to":["irc://chat.freenode.net/#git-ciabot","irc://chat.freenode.net/#gpsd"],"privmsg":"Multichannel test"}
47 {"to":"irc://chat.hypothetical.net:6668/git-ciabot", "privmsg":"Hello, world!"}
48 </programlisting></para>
49
50 <para>If the channel part of the URL does not have one of the prefix
51 characters <quote>#</quote>, <quote>&amp;</quote>, or
52 <quote>+</quote>, a <quote>#</quote> will be prepended to it before
53 shipping - <emphasis>unless</emphasis>the channel part has the suffix
54 ",isnick" (which is unconditionally removed).</para>
55
56 <para>The host part of the URL may have a port-number suffix separated by a
57 colon, as shown in the third example; otherwise
58 <application>irkerd</application> sends messages to the the default 6667 IRC
59 port of each server.</para>
60
61 <para>An empty message is legal and will cause
62 <application>irkerd</application> to join the target channels without
63 actually emitting a message.  This may be useful for advertising that
64 an instance is up and running, or for joining a channel to log its
65 traffic.</para>
66 </refsect1>
67
68 <refsect1 id='options'><title>OPTIONS</title>
69
70 <para><application>irkerd</application> takes the following options:</para>
71
72 <variablelist>
73 <varlistentry>
74 <term>-d</term>
75 <listitem><para>Takes a following value, setting the debugging level from
76 it. This option will generally only be of interest to developers;
77 consult the source code for details.</para></listitem>
78 </varlistentry>
79 <varlistentry>
80 <term>-l</term>
81 <listitem><para>Takes a following filename, logs traffic to that file.
82 Each log line consists of three |-separated fields; a numeric
83 timestamp in Unix time, the FQDN of the sending server, and the
84 message data.</para></listitem>
85 </varlistentry>
86 <varlistentry>
87 <term>-n</term>
88 <listitem><para>Takes a following value, setting the nick
89 to be used. If the nick contains a numeric format element
90 (such as %03d) it is used to generate suffixed fallback names
91 in the event of a nick collision.</para></listitem>
92 </varlistentry>
93 <varlistentry>
94 <term>-p</term>
95 <listitem><para>Takes a following value, setting a nickserv
96 password to be used. If given, this password is shipped to
97 authenticate the nick on receipt of a welcom message.</para></listitem>
98 </varlistentry>
99 <varlistentry>
100 <term>-V</term>
101 <listitem><para>Write the program version to stdout and
102 terminate.</para></listitem>
103 </varlistentry>
104 <varlistentry>
105 <term>-h</term>
106 <listitem><para>Print usage instructions and
107 terminate.</para></listitem>
108 </varlistentry>
109 </variablelist>
110
111 </refsect1>
112
113 <refsect1 id='limitations'><title>LIMITATIONS</title>
114 <para>Requests via UDP optimizes for lowest latency and network load
115 by avoiding TCP connection setup time; the cost is that delivery is
116 not reliable in the face of packet loss.</para>
117
118 <para>An <application>irkerd</application> instance with a
119 publicly-accessible request socket could complicate blocking of IRC
120 spam by making it easy for spammers to submit while hiding their IP
121 addresses; the better way to deploy, then, is on places like
122 project-hosting sites where the <application>irkerd</application>
123 socket can be visible from commit-hook code but not exposed to the
124 outside world. Priming your firewall with blocklists of IP addresses
125 known to spew spam is always a good idea.</para>
126
127 <para>The absence of any option to set the service port is deliberate.
128 If you think you need to do that, you have a problem better solved at
129 your firewall.</para>
130
131 <para>IRC has a message length limit of 510 bytes; generate your
132 privmsg attribute values with appropriate care.</para>
133
134 <para>IRC ignores any text after an embedded newline. Be aware that
135 <application>irkerd</application> will turn payload strings with
136 embedded newlines into multiple IRC sends to avoid having message data
137 discarded. </para>
138 </refsect1>
139
140 <refsect1 id='see_also'><title>SEE ALSO</title>
141 <para>
142 <citerefentry><refentrytitle>irkerhook</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
143 </para>
144 </refsect1>
145
146 <refsect1 id='authors'><title>AUTHOR</title>
147 <para>Eric S. Raymond <email>esr@snark.thyrsus.com</email>.  See the
148 project page at <ulink
149 url='http://www.catb.org/~esr/irker'>http://www.catb.org/~esr/irker</ulink>
150 for updates and other resources, including an installable repository
151 hook script. The implementation uses the Python IRC library by Joe
152 Rosdahl and Jason R. Coombs.</para>
153 </refsect1>
154 </refentry>
155