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