source: code/trunk/doc/soju.1.scd@ 658

Last change on this file since 658 was 636, checked in by contact, 4 years ago

Add bouncer MOTD

Closes: https://todo.sr.ht/~emersion/soju/137

File size: 11.6 KB
Line 
1soju(1)
2
3# NAME
4
5soju - IRC bouncer
6
7# SYNOPSIS
8
9*soju* [options...]
10
11# DESCRIPTION
12
13soju is a user-friendly IRC bouncer. It connects to upstream IRC servers on
14behalf of the user to provide extra features.
15
16- Multiple separate users sharing the same bouncer, each with their own
17 upstream servers
18- Clients connecting to multiple upstream servers via a single connection to
19 the bouncer
20- Sending the backlog (messages received while the user was disconnected from
21 the bouncer), with per-client buffers
22
23When joining a channel, the channel will be saved and automatically joined on
24the next connection. When registering or authenticating with NickServ, the
25credentials will be saved and automatically used on the next connection if the
26server supports SASL. When parting a channel with the reason "detach", the
27channel will be detached instead of being left.
28
29When all clients are disconnected from the bouncer, the user is automatically
30marked as away.
31
32soju supports two connection modes:
33
34- Single upstream mode: one downstream connection maps to one upstream
35 connection. To enable this mode, connect to the bouncer with the username
36 "<username>/<network>". If the bouncer isn't connected to the upstream
37 server, it will get automatically added. Then channels can be joined and
38 parted as if you were directly connected to the upstream server.
39- Multiple upstream mode: one downstream connection maps to multiple upstream
40 connections. Channels and nicks are suffixed with the network name. To join
41 a channel, you need to use the suffix too: _/join #channel/network_. Same
42 applies to messages sent to users.
43
44For per-client history to work, clients need to indicate their name. This can
45be done by adding a "@<client>" suffix to the username.
46
47soju will reload the TLS certificate/key and the MOTD file when it receives the
48HUP signal.
49
50Administrators can broadcast a message to all bouncer users via _/notice
51$<hostname> <text>_, or via _/notice $\* <text>_ in multi-upstream mode. All
52currently connected bouncer users will receive the message from the special
53_BouncerServ_ service.
54
55# OPTIONS
56
57*-h, -help*
58 Show help message and quit.
59
60*-config* <path>
61 Path to the config file. If unset, a default config file is used.
62
63*-debug*
64 Enable debug logging (this will leak sensitive information such as
65 passwords).
66
67*-listen* <uri>
68 Listening URI (default: ":6697"). Can be specified multiple times.
69
70# CONFIG FILE
71
72The config file has one directive per line.
73
74Example:
75
76```
77listen ircs://
78tls cert.pem key.pem
79hostname example.org
80```
81
82The following directives are supported:
83
84*listen* <uri>
85 Listening URI (default: ":6697").
86
87 The following URIs are supported:
88
89 - _[ircs://][host][:port]_ listens with TLS over TCP (default port if
90 omitted: 6697)
91 - _irc+insecure://[host][:port]_ listens with plain-text over TCP (default
92 port if omitted: 6667)
93 - _unix:///<path>_ listens on a Unix domain socket
94 - _wss://[host][:port]_ listens for WebSocket connections over TLS (default
95 port: 443)
96 - _ws+insecure://[host][:port]_ listens for plain-text WebSocket
97 connections (default port: 80)
98 - _ident://[host][:port]_ listens for plain-text ident connections (default
99 port: 113)
100
101 If the scheme is omitted, "ircs" is assumed. If multiple *listen*
102 directives are specified, soju will listen on each of them.
103
104*hostname* <name>
105 Server hostname (default: system hostname).
106
107*tls* <cert> <key>
108 Enable TLS support. The certificate and the key files must be PEM-encoded.
109
110*db* <driver> <source>
111 Set the database location for user, network and channel storage. By default,
112 a _sqlite3_ database is opened in "./soju.db".
113
114 Supported drivers:
115
116 - _sqlite3_ expects _source_ to be a path to the SQLite file
117 - _postgres_ expects _source_ to be a space-separated list of _key=value_
118 parameters, e.g. _db postgres "host=/run/postgresql dbname=soju"_. Note
119 that _sslmode_ defaults to _require_. For more information on connection
120 strings, see:
121 <https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters>.
122
123*log* fs <path>
124 Path to the bouncer logs root directory, or empty to disable logging. By
125 default, logging is disabled.
126
127*http-origin* <patterns...>
128 List of allowed HTTP origins for WebSocket listeners. The parameters are
129 interpreted as shell patterns, see *glob*(7).
130
131 By default, only the request host is authorized. Use this directive to
132 enable cross-origin WebSockets.
133
134*accept-proxy-ip* <cidr...>
135 Allow the specified IPs to act as a proxy. Proxys have the ability to
136 overwrite the remote and local connection addresses (via the PROXY protocol,
137 the Forwarded HTTP header field defined in RFC 7239 or the X-Forwarded-\*
138 HTTP header fields). The special name "localhost" accepts the loopback
139 addresses 127.0.0.0/8 and ::1/128.
140
141 By default, all IPs are rejected.
142
143*max-user-networks* <limit>
144 Maximum number of networks per user. By default, there is no limit.
145
146*motd* <path>
147 Path to the MOTD file. The bouncer MOTD is sent to clients which aren't
148 bound to a specific network. By default, no MOTD is sent.
149
150# IRC SERVICE
151
152soju exposes an IRC service called *BouncerServ* to manage the bouncer.
153Commands can be sent via regular private messages
154(_/msg BouncerServ <command> [args...]_). Commands may be written in full or
155abbreviated form, for instance *network* can be abbreviated as *net* or just
156*n*.
157
158*help* [command]
159 Show a list of commands. If _command_ is specified, show a help message for
160 the command.
161
162*network create* *-addr* <addr> [options...]
163 Connect to a new network at _addr_. _-addr_ is mandatory.
164
165 _addr_ supports several connection types:
166
167 - _[ircs://]<host>[:port]_ connects with TLS over TCP
168 - _irc+insecure://<host>[:port]_ connects with plain-text TCP
169 - _irc+unix:///<path>_ connects to a Unix socket
170
171 Other options are:
172
173 *-name* <name>
174 Short network name. This will be used instead of _addr_ to refer to the
175 network.
176
177 *-username* <username>
178 Connect with the specified username. By default, the nickname is used.
179
180 *-pass* <pass>
181 Connect with the specified server password.
182
183 *-realname* <realname>
184 Connect with the specified real name. By default, the account's realname
185 is used if set, otherwise the network's nickname is used.
186
187 *-nick* <nickname>
188 Connect with the specified nickname. By default, the account's username
189 is used.
190
191 *-enabled* true|false
192 Enable or disable the network. If the network is disabled, the bouncer
193 won't connect to it. By default, the network is enabled.
194
195 *-connect-command* <command>
196 Send the specified command as a raw IRC message right after connecting
197 to the server. This can be used to identify to an account when the
198 server doesn't support SASL.
199
200 For instance, to identify with _NickServ_, the following command can be
201 used:
202
203 ```
204 PRIVMSG NickServ :IDENTIFY <password>
205 ```
206
207 The flag can be specified multiple times to send multiple IRC messages.
208 To clear all commands, set it to the empty string.
209
210*network update* <name> [options...]
211 Update an existing network. The options are the same as the
212 _network create_ command.
213
214 When this command is executed, soju will disconnect and re-connect to the
215 network.
216
217*network delete* <name>
218 Disconnect and delete a network.
219
220*network quote* <name> <command>
221 Send a raw IRC line as-is to a network.
222
223*network status*
224 Show a list of saved networks and their current status.
225
226*channel status* [options...]
227 Show a list of saved channels and their current status.
228
229 Options:
230
231 *-network* <name>
232 Only show channels for the specified network. By default, only the
233 channels in the current network are displayed.
234
235*channel update* <name> [options...]
236 Update the options of an existing channel.
237
238 Options are:
239
240 *-relay-detached* <mode>
241 Set when to relay messages from detached channels to the user with a BouncerServ NOTICE.
242
243 Modes are:
244
245 *message*
246 Relay any message from this channel when detached.
247
248 *highlight*
249 Relay only messages mentioning you when detached.
250
251 *none*
252 Don't relay any messages from this channel when detached.
253
254 *default*
255 Currently same as *highlight*. This is the default behaviour.
256
257 *-reattach-on* <mode>
258 Set when to automatically reattach to detached channels.
259
260 Modes are:
261
262 *message*
263 Reattach to this channel when any message is received.
264
265 *highlight*
266 Reattach to this channel when any message mentioning you is received.
267
268 *none*
269 Never automatically reattach to this channel.
270
271 *default*
272 Currently same as *none*. This is the default behaviour.
273
274 *-detach-after* <duration>
275 Automatically detach this channel after the specified duration has elapsed without receving any message corresponding to *-detach-on*.
276
277 Example duration values: *1h30m*, *30s*, *2.5h*.
278
279 Setting this value to 0 will disable this behaviour, i.e. this channel will never be automatically detached. This is the default behaviour.
280
281 *-detach-on* <mode>
282 Set when to reset the auto-detach timer used by *-detach-after*, causing it to wait again for the auto-detach duration timer before detaching.
283 Joining, reattaching, sending a message, or changing any channel option will reset the timer, in addition to the messages specified by the mode.
284
285 Modes are:
286
287 *message*
288 Receiving any message from this channel will reset the auto-detach timer.
289
290 *highlight*
291 Receiving any message mentioning you from this channel will reset the auto-detach timer.
292
293 *none*
294 Receiving messages from this channel will not reset the auto-detach timer. Sending messages or joining the channel will still reset the timer.
295
296 *default*
297 Currently same as *message*. This is the default behaviour.
298
299*certfp generate* [options...] <network name>
300 Generate self-signed certificate and use it for authentication (via SASL
301 EXTERNAL).
302
303 Generates a 3072-bit RSA private key by default.
304
305 Options are:
306
307 *-key-type* <type>
308 Private key algorithm to use. Valid values are: _rsa_, _ecdsa_ and
309 _ed25519_. _ecdsa_ uses the NIST P-521 curve.
310
311 *-bits* <bits>
312 Size of RSA key to generate. Ignored for other key types.
313
314*certfp fingerprint* <network name>
315 Show SHA-1 and SHA-256 fingerprints for the certificate
316 currently used with the network.
317
318*sasl set-plain* <network name> <username> <password>
319 Set SASL PLAIN credentials.
320
321*sasl reset* <network name>
322 Disable SASL authentication and remove stored credentials.
323
324*user create* -username <username> -password <password> [options...]
325 Create a new soju user. Only admin users can create new accounts.
326 The _-username_ and _-password_ flags are mandatory.
327
328 Options are:
329
330 *-username* <username>
331 The bouncer username. This cannot be changed after the user has been
332 created.
333
334 *-password* <password>
335 The bouncer password.
336
337 *-admin* true|false
338 Make the new user an administrator.
339
340 *-realname* <realname>
341 Set the user's realname. This is used as a fallback if there is no
342 realname set for a network.
343
344*user update* [username] [options...]
345 Update a user. The options are the same as the _user create_ command.
346
347 If _username_ is omitted, the current user is updated. Only admins can
348 update other users.
349
350 Not all flags are valid in all contexts:
351
352 - The _-username_ flag is never valid, usernames are immutable.
353 - The _-realname_ flag is only valid when updating the current user.
354 - The _-admin_ flag is only valid when updating another user.
355
356*user delete* <username>
357 Delete a soju user. Only admins can delete accounts.
358
359*server status*
360 Show some bouncer statistics. Only admins can query this information.
361
362*server notice* <message>
363 Broadcast a notice. All currently connected bouncer users will receive the
364 message from the special _BouncerServ_ service. Only admins can broadcast a
365 notice.
366
367# AUTHORS
368
369Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other
370open-source contributors. For more information about soju development, see
371<https://sr.ht/~emersion/soju>.
Note: See TracBrowser for help on using the repository browser.