summary refs log tree commit diff
path: root/litterbox.1
blob: 3a179ae945898b711d9dce3bf1bae518dcc41e40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
.Dd January 12, 2020
.Dt LITTERBOX 1
.Os
.
.Sh NAME
.Nm litterbox
.Nd IRC logger
.
.Sh SYNOPSIS
.Nm
.Op Fl Qqv
.Op Fl N Ar network
.Op Fl c Ar cert
.Op Fl d Ar path
.Op Fl h Ar host
.Op Fl j Ar join
.Op Fl k Ar priv
.Op Fl l Ar limit
.Op Fl n Ar nick
.Op Fl p Ar port
.Op Fl u Ar user
.Op Fl w Ar pass
.Op Ar config ...
.
.Nm
.Op Fl d Ar path
.Fl i | m
.
.Sh DESCRIPTION
The
.Nm
daemon logs IRC activity to a database
which may be queried with
.Xr scoop 1 .
It connects to IRC over TLS.
Messages, notices, joins, parts, quits, kicks,
nick changes and topic changes
are recorded in the database.
The contents of messages are indexed for full-text search.
.
.Pp
The database must first be initialized with
.Fl i .
If the database format has changed,
an existing database can be migrated with
.Fl m .
.
.Pp
Options can be loaded from
files listed on the command line.
Files are searched for in
.Pa $XDG_CONFIG_DIRS/litterbox
unless the path starts with
.Ql /
or
.Ql \&. .
Each option is placed on a line,
and lines beginning with
.Ql #
are ignored.
The options are listed below
following their corresponding flags.
.
.Pp
The arguments are as follows:
.
.Bl -tag -width "-h host"
.It Fl N Ar name , Cm network = Ar name
Set the network name to be used
if the server does not send
.Sy RPL_ISUPPORT NETWORK .
The default is the server hostname.
.
.It Fl Q , Cm public-query
Enable the public search query interface.
This allows anyone to perform searches
in private messages to
.Nm .
Search results are limited to channels
on the current network.
.
.Pp
Searches use the full-text search index.
The searchable columns are
.Li channel ,
.Li nick ,
.Li user ,
.Li target ,
.Li message .
For search query syntax, see
.Aq Lk https://www.sqlite.org/fts5.html#full_text_query_syntax .
.
.It Fl c Ar path , Cm cert = Ar path
Load the TLS client certificate from
.Ar path
and authenticate with SASL EXTERNAL.
If the private key is in a separate file,
it is loaded with
.Fl k .
.
.It Fl d Ar path , Cm database = Ar path
Set the path to the database file.
The possible default paths
are documented in
.Sx FILES .
.
.It Fl h Ar host , Cm host = Ar host
Connect to
.Ar host .
.
.It Fl i
Initialize the database.
.
.It Fl j Ar chan , Cm join = Ar chan
Join the comma-separated list of channels
.Ar chan .
.
.It Fl k Ar path , Cm priv = Ar path
Load the TLS client private key from
.Ar path .
.
.It Fl l Ar limit , Cm limit = Ar limit
Limit the number of results
in the search query interface
enabled by
.Fl Q
or
.Fl q .
The default limit is 10.
.
.It Fl m
Migrate the database to the latest format.
.
.It Fl n Ar nick , Cm nick = Ar nick
Set the nickname to
.Ar nick .
The default nickname is
.Dq litterbox .
.
.It Fl p Ar port , Cm port = Ar port
Connect to
.Ar port .
The default port is 6697.
.
.It Fl q , Cm private-query
Enable the private search query interface.
This allows search queries in private messages to
.Nm
only from itself.
This is intended for use with
.Nm
connected to
.Xr pounce 1 ,
allowing the user to message themselves
to perform searches.
Search results are limited to the current network.
.
.Pp
Searches use the full-text search index.
The searchable columns are
.Li channel ,
.Li query ,
.Li nick ,
.Li user ,
.Li target ,
.Li message .
For search query syntax, see
.Aq Lk https://www.sqlite.org/fts5.html#full_text_query_syntax .
.
.It Fl u Ar user , Cm user = Ar user
Set the username to
.Ar user .
If connecting to
.Xr pounce 1 ,
the username should begin with hyphen
.Ql -
to prevent affecting its away status.
The default username is the same as the nickname.
.
.It Fl v , Cm verbose
Write sent and received IRC messages
as well as SQL INSERT statements
to standard error.
.
.It Fl w Ar pass , Cm pass = Ar pass
Log in with the server password
.Ar pass .
.El
.
.Ss Service Configuration
Add the following to
.Pa /etc/rc.conf
to enable the
.Nm
daemon:
.Bd -literal -offset indent
litterbox_enable="YES"
.Ed
.
.Pp
To use the database and configuration files of a user,
add the following:
.Bd -literal -offset indent
litterbox_user="user"
litterbox_env="HOME=/home/user"
.Ed
.
.Pp
The
.Nm
service supports profiles
for running multiple instances.
Set
.Va litterbox_profiles
to a space-separated list of names.
Flags for each profile will be set from
.Va litterbox_${profile}_flags .
For example:
.Bd -literal -offset indent
litterbox_profiles="example1 example2"
litterbox_example1_flags="example1.conf"
litterbox_example2_flags="example2.conf"
.Ed
.
.Pp
The commands
.Cm start , stop ,
etc.\&
will operate on the profile given as an additional argument,
or on all profiles without an additional argument.
.
.Sh FILES
.Bl -tag -width Ds
.It Pa $XDG_CONFIG_DIRS/litterbox
Configuration files are searched for first in
.Ev $XDG_CONFIG_HOME ,
usually
.Pa ~/.config ,
followed by the colon-separated list of paths
.Ev $XDG_CONFIG_DIRS ,
usually
.Pa /etc/xdg .
.
.It Pa $XDG_DATA_DIRS/litterbox/litterbox.sqlite
The database file is searched for first in
.Ev $XDG_DATA_HOME ,
usually
.Pa ~/.local/share ,
followed by the colon-separated list of paths
.Ev $XDG_DATA_DIRS ,
usually
.Pa /usr/local/share:/usr/share .
.It Pa ~/.local/share/litterbox/litterbox.sqlite
The most likely default path to the database file.
.El
.
.Sh EXAMPLES
Configuration on the command line:
.Bd -literal -offset indent
litterbox -Q -h irc.example.org -j '#example'
.Ed
.
.Pp
Configuration in a file:
.Bd -literal -offset indent
host = irc.example.org
join = #example
public-query
.Ed
.
.Sh SEE ALSO
.Xr scoop 1 ,
.Xr unscoop 1
.
.Sh STANDARDS
The
.Nm
daemon implements the following:
.
.Bl -item
.It
.Rs
.%A Waldo Bastian
.%A Ryan Lortie
.%A Lennart Poettering
.%T XDG Base Directory Specification
.%D November 24, 2010
.%U https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
.Re
.
.It
.Rs
.%A Kyle Fuller
.%A St\('ephan Kochen
.%A Alexey Sokolov
.%A James Wheare
.%T IRCv3.2 server-time Extension
.%I IRCv3 Working Group
.%U https://ircv3.net/specs/extensions/server-time-3.2
.Re
.
.It
.Rs
.%A C. Kalt
.%T Internet Relay Chat: Client Protocol
.%I IETF
.%N RFC 2812
.%D April 2000
.%U https://tools.ietf.org/html/rfc2812
.Re
.El
.
.Sh AUTHORS
.An June Bug Aq Mt june@causal.agency
.
.Sh BUGS
Send mail to
.Aq Mt june@causal.agency
or join
.Li #ascii.town
on
.Li chat.freenode.net .