= suika-bouncerserv(7)
Simon Ser and contributors / Izuru Yakumo
v0.4.3
:doctype: manpage
:manmanual: Suika IRC Bouncer
:mansource: SUIKA-BOUNCERSERV

== Name
suika-bouncerserv - Service bot exposed by suika(1) to control the bouncer

== Description
suika(1) exposes an IRC service called BouncerServ to manage the bouncer.
Commands can be sent via regular private messages.
Commands may be written in full or abbreviated form, for instance network
can be abbreviated as net or just n.

== Commands

=== help [command]
Show a list of commands.
If command is specified, show a help message for the command.

=== network-create -addr <addr> [options...]
Connect to a new network at addr.
The option -addr is mandatory.

addr supports several connection types:
* ircs://<host>:port - connects with TLS over TCP
* irc+insecure://<host>:port - connects with plain-text over TCP
* irc+unix://<path> - connects to a Unix domain socket

Other options are:

* -name <name>
Short network name, this will be used instead of addr to refer to the network

* -username <username>
Connect with the specified username, by default, the nickname is used

* -pass <pass>
Connect with the specified server password

* -realname <realname>
Connect with the specified real name, by default, the account's realname is used if set, otherwise the network's nickname is used

* -nick <nick>
Connect with the specified nickname, by default, the account's username is used

* -enabled [bool]
Enable or disable the network, if the network is disabled, the bouncer won't connect to it, by default, the network is enabled

* -connect-command <command>
Send the specified command as a raw IRC message right after connecting to the server, this can be used to identify to an account if a server does not support SASL

=== network update [options...]
Update an existing network. The options are the same as the network create command.
When this command is executed, suika(1) will disconnect and re-connect to the network.
If name is not specified, the current network is updated.

=== network delete [name]
Disconnect and delete a network.
If name is not specified, the current network is deleted.

=== network quote [name] <command>
Send a raw IRC line as-is to a network.
If name is not specified, the command is sent to the current network.

=== network status
Show a list of saved networks and their current status.

=== channel status [options...]
Show a list of saved channels and their current status.
Options:

* -network <network>
Only show channels for the specified network. By default, only the channels in the current network are displayed.

=== channel update <name> [options...]
Update the options of an existing channel.
Options are:

-detached [bool]
Attach or detach this channel.
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] - Set when to relay messages from detached channels to the user with a BouncerServ NOTICE
* message - Relay any message from this channel when detached.
* highlight - Relay only messages mentioning you when detached.
* none - Do not relay any messages from this channel when detached.
* default - Currently same as highlight. This is the default behaviour.


-reattach-on [mode] - Set when to automatically reattach to detached channels.

* message - Reattach to this channel when any message is received.
* highlight - Reattach to this channel when any message mentioning you is received.
* none - Never automatically reattach to this channel.
* default - Currently same as none. This is the default behaviour.

-detach-after [duration]

Automatically detach this channel after the specified duration has elapsed without receving any message corresponding to -detach-on. 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]
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. Joining, reattaching, sending a message, or changing any channel option will reset the timer, in addition to the messages specified by the mode.

* message - Receiving any message from this channel will reset the auto-detach timer.
* highlight - Receiving any message mentioning you from this channel will reset the auto-detach timer.
* none - Receiving messages from this channel will not reset the auto-detach timer. Sending messages or joining the channel will still reset the timer.
* default - Currently same as message. This is the default behaviour.

=== certfp generate [options...]
Generate self-signed certificate and use it for authentication (via SASL EXTERNAL). Generates a 3072-bit RSA private key by default.
Options are:

* -network <network>
Select a network. By default, the current network is selected, if any.

* -key-type <type>
Private key algorithm to use. Valid values are: rsa, ecdsa and ed25519. ecdsa uses the NIST P-521 curve.

* -bits <bits>
Size of RSA key to generate. Ignored for other key types.

=== certfp fingerprint [options...]
Show SHA-1 and SHA-256 fingerprints for the certificate currently used with the network.
Options are:

* -network <network>
Select a network. By default, the current network is selected, if any.

=== sasl status [options...]

Show current SASL status.
Options are:

* -network <network>
Select a network. By default, the current network is selected, if any.

=== sasl set-plain [options...] <username> <password>
Set SASL PLAIN credentials.
Options are:

* -network <network>
Select a network. By default, the current network is selected, if any.

=== sasl reset [options...]
Disable SASL authentication and remove stored credentials.
Options are:

* -network <network>
Select a network. By default, the current network is selected, if any.

=== user status
Show a list of users on this server. Only admins can query this information.

=== user create -username <username> -password <password> [options...]

Create a new suika user. Only admin users can create new accounts. The -username and -password flags are mandatory.
Options are:

* -username <username> - The bouncer username. This cannot be changed after the user has been created.
* -password <password> - The bouncer password.
* -disable-password - Disable password authentication. The user will be unable to login.
* -admin [bool] - Make the new user an administrator.
* -nick <nick> - Set the user's nickname. This is used as a fallback if there is no nickname set for a network.
* -realname <realname> - Set the user's realname. This is used as a fallback if there is no realname set for a network.
* -enabled [bool] - Enable or disable the user. If the user is disabled, the bouncer will not connect to any of their networks, and downstream connections will be immediately closed. By default, users are enabled.

=== user update [username] [options...]
Update a user. The options are the same as the user create command. 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]
Delete a suika user. Only admins can delete other users.
=== user run <username> <command...>
Execute a command as another user. Only admins can use this command.
=== server status
Show some bouncer statistics. Only admins can query this information.
=== server notice <message>
Broadcast a notice. All currently connected bouncer users will receive the message from the special BouncerServ service. Only admins can broadcast a notice.

== See Also
suika(1)
suikadb(1)
suika-znc-import(1)
suika-config(5)
