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

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

doc/soju.1: use angle-brackets for URL

Helps a bit terminal emulators to recognize the link.

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