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

Last change on this file since 706 was 705, checked in by contact, 4 years ago

Add per-user IP addresses

The new upstream-user-ip directive allows bouncer operators to
assign one IP address per user.

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