soju(1) | General Commands Manual | soju(1) |
NAME
soju - IRC bouncer
SYNOPSIS
soju [options...]
DESCRIPTION
soju is a user-friendly IRC bouncer. It connects to upstream IRC servers on behalf of the user to provide extra features.
- Multiple separate users sharing the same bouncer, each with their own upstream servers
- Sending the backlog (messages received while the user was disconnected from the bouncer), with per-client buffers
To connect to the bouncer, use the bouncer username and password. To use a client which doesn't support the soju.im/bouncer-networks IRC extension, setup one connection per server configured in soju, and indicate the network name in the username: "<username>/<network>". Then channels can be joined and parted as if you were directly connected to the upstream server.
For per-client history to work on clients which don't support the IRCv3 chathistory extension, clients need to indicate their name. This can be done by adding a "@<client>" suffix to the username.
When joining a channel, the channel will be saved and automatically joined on the next connection. When registering or authenticating with NickServ, the credentials will be saved and automatically used on the next connection if the server supports SASL. When parting a channel with the reason "detach", the channel will be detached instead of being left.
If a network specified in the username doesn't exist, and the network name is a valid hostname, the network will be automatically added.
When all clients are disconnected from the bouncer, the user is automatically marked as away by default.
soju will reload the configuration file, the TLS certificate/key and the MOTD file when it receives the HUP signal. The configuration options listen, db and log cannot be reloaded.
Administrators can broadcast a message to all bouncer users via /notice $<hostname> <text>, or via /notice $* <text> if the connection isn't bound to a particular network. All currently connected bouncer users will receive the message from the special BouncerServ service.
OPTIONS
-h, -help
-config <path>
-debug
-listen <uri>
CONFIG FILE
The config file has one directive per line.
Example:
listen ircs:// tls cert.pem key.pem hostname example.org
The following directives are supported:
listen <uri>
The following URIs are supported:
- [ircs://][host][:port] listens with TLS over TCP (default port if omitted: 6697)
- irc+insecure://[host][:port] listens with plain-text over TCP (default port if omitted: 6667)
- unix://<path> listens on a Unix domain socket
- https://[host][:port] listens for HTTPS connections (default port: 443) and handles WebSocket requests at endpoint /socket
- http+insecure://[host][:port] listens for plain-text HTTP connections (default port: 80) and handles WebSocket requests at endpoint /socket
- http+unix://<path> listens for plain-text HTTP connections on a Unix domain socket and handles WebSocket requests at endpoint /socket
- wss://[host][:port] listens for WebSocket connections over TLS (default port: 443)
- ws+insecure://[host][:port] listens for plain-text WebSocket connections (default port: 80)
- ws+unix://<path> listens for plain-text WebSocket connections on a Unix domain socket
- ident://[host][:port] listens for plain-text ident connections (default port: 113)
- http+prometheus://localhost:<port> listens for plain-text HTTP connections and serves Prometheus metrics (host must be "localhost")
- http+pprof://localhost:<port> listens for plain-text HTTP connections and serves pprof runtime profiling data (host must be "localhost"). For more information, see: https://pkg.go.dev/net/http/pprof.
- unix+admin://[path] listens on a Unix domain socket for administrative connections, such as sojuctl (default path: /run/soju/admin)
If the scheme is omitted, "ircs" is assumed. If multiple listen directives are specified, soju will listen on each of them.
hostname <name>
This should be set to a fully qualified domain name.
title <title>
tls <cert> <key>
db <driver> <source>
Supported drivers:
- sqlite3 expects source to be a path to the SQLite file
- postgres expects source to be a space-separated list of key=value parameters, e.g. db postgres "host=/run/postgresql dbname=soju". Note that sslmode defaults to require. For more information on connection strings, see: https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters.
message-store <driver> [source]
Supported drivers:
- memory stores messages in memory. For each channel/user, only the latest 4K messages are kept in memory, older messages are discarded. This driver is very basic and doesn't support features such as the chathistory extension and search.
- fs stores messages on disk, in the same format as ZNC. source is required and is the root directory path for the database. This on-disk format is lossy: some IRCv3 messages (e.g. TAGMSG) and all message tags are discarded.
- db stores messages in the database. A full-text search index is used to speed up search queries.
(log is a deprecated alias for this directive.)
file-upload <driver> [source]
File upload requires setting up an HTTP listener (see https:// and http+insecure:// URIs in the listen directive).
Supported drivers:
- •
- fs stores uploaded files on disk. source is required.
http-origin <patterns...>
By default, only the request host is authorized. Use this directive to enable cross-origin WebSockets.
http-ingress <url>
By default, this is https://<hostname>.
accept-proxy-ip <cidr...>
By default, all IPs are rejected.
max-user-networks <limit>
motd <path>
upstream-user-ip <cidr...>
This can be useful to avoid having the whole bouncer banned from an upstream network because of one malicious user.
disable-inactive-user <duration>
A user is inactive when the last downstream connection is closed.
The duration is a positive decimal number followed by the unit "d" (days). For instance, "30d" disables users 30 days after they last disconnect from the bouncer.
enable-user-on-auth true|false
This can be used together with disable-inactive-user to seamlessly disable and re-enable users during lengthy inactivity.
When external authentication is used (e.g. auth oauth2), bouncer users are automatically created after successfull authentication.
auth <driver> ...
Supported drivers:
auth internal
IRC SERVICE
soju exposes an IRC service called BouncerServ to manage the bouncer. Commands can be sent via regular private messages (/msg BouncerServ <command> [args...]). Commands may be written in full or abbreviated form, for instance network can be abbreviated as net or just n.
Commands are parsed according the POSIX shell rules. In particular, words can be quoted (via double or single quotes) and a backslash escapes the next character.
help [command]
network create -addr <addr> [options...]
addr supports several connection types:
- [ircs://]<host>[:port] connects with TLS over TCP
- irc+insecure://<host>[:port] connects with plain-text TCP
- irc+unix:///<path> connects to a Unix socket
For example, to connect to Libera Chat:
net create -addr irc.libera.chat
Other options are:
-name <name>
-username <username>
-pass <pass>
-realname <realname>
-certfp <fingerprint>
The following command can be used to fetch the certificate fingerprint of an IRC server:
openssl s_client -connect irc.example.org:6697 -verify_quiet </dev/null | openssl x509 -fingerprint -sha512 -noout -in /dev/stdin
-nick <nickname>
-auto-away true|false
-enabled true|false
-connect-command <command>
For instance, to identify with NickServ, the following command can be used:
"PRIVMSG NickServ :IDENTIFY <password>"
The flag can be specified multiple times to send multiple IRC messages. To clear all commands, set it to the empty string.
network update [name] [options...]
When this command is executed, soju will disconnect and re-connect to the network.
If name is not specified, the current network is updated.
network delete [name]
If name is not specified, the current network is deleted.
network quote [name] <command>
If name is not specified, the command is sent to the current network.
network status
channel status [options...]
Options:
-network <name>
channel update <name> [options...]
Options are:
-detached true|false
A detached channel is joined but is hidden by the bouncer. This is useful to e.g. collect logs and highlights in low-interest or high-traffic channels.
-relay-detached <mode>
Modes are:
message
highlight
none
default
-reattach-on <mode>
Modes are:
message
highlight
none
default
-detach-after <duration>
Example duration values: 1h30m, 30s, 2.5h.
Setting this value to 0 will disable this behaviour, i.e. this channel will never be automatically detached. This is the default behaviour.
-detach-on <mode>
Modes are:
message
highlight
none
default
channel delete <name>
certfp generate [options...]
Generates a 3072-bit RSA private key by default.
Options are:
-network <name>
-key-type <type>
-bits <bits>
certfp fingerprint [options...]
Options are:
-network <name>
sasl status [options...]
Options are:
-network <name>
sasl set-plain [options...] <username> <password>
Options are:
-network <name>
sasl reset [options...]
Options are:
-network <name>
user status [username]
If username is specified, statistics are only displayed for this user.
user create -username <username> -password <password> [options...]
Options are:
-username <username>
-password <password>
-disable-password
-admin true|false
-nick <nick>
-realname <realname>
-enabled true|false
user update [username] [options...]
If username is omitted, the current user is updated. Only admins can update other users.
Not all flags are valid in all contexts:
- The -username flag is never valid, usernames are immutable.
- The -nick and -realname flag are only valid when updating the current user.
- The -admin and -enabled flags are only valid when updating another user.
user delete <username> [confirmation token]
Only admins can delete other users.
user run <username> <command...>
Only admins can use this command.
server status
server notice <message>
AUTHORS
Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other open-source contributors. For more information about soju development, see https://soju.im.
SEE ALSO
2024-08-18 |