Use asciidoctor for generating manpages.

Rename suikactl to suikadb.

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/suika/trunk@823 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This commit is contained in:
yakumo.izuru 2023-09-15 04:20:11 +00:00
parent 065e07da4b
commit 66c3c63129
14 changed files with 1422 additions and 468 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
/suika /suika
/suikactl /suikadb
/suika-znc-import /suika-znc-import
/suika.db /suika.db

View File

@ -16,19 +16,24 @@ BUILD = `git show -s --pretty=format:%cI`
GOARCH ?= amd64 GOARCH ?= amd64
GOOS ?= linux GOOS ?= linux
all: suika suikactl suika-znc-import all: suika suikadb suika-znc-import
suika: suika:
$(GO) build $(GOFLAGS) ./cmd/suika $(GO) build $(GOFLAGS) ./cmd/suika
strip -s suika @strip -s suika
suikactl: suikadb:
$(GO) build $(GOFLAGS) ./cmd/suikactl $(GO) build $(GOFLAGS) ./cmd/suikadb
strip -s suikactl @strip -s suikadb
suika-znc-import: suika-znc-import:
$(GO) build $(GOFLAGS) ./cmd/suika-znc-import $(GO) build $(GOFLAGS) ./cmd/suika-znc-import
strip -s suika-znc-import @strip -s suika-znc-import
clean: clean:
$(RM) -f suika suikactl suika-znc-import $(RM) -f suika suikadb suikactl suika-znc-import
docs:
asciidoctor -b manpage doc/suika.adoc -o doc/suika.1
asciidoctor -b manpage doc/suikadb.adoc -o doc/suikadb.1
asciidoctor -b manpage doc/suika-config.adoc -o doc/suika-config.5
asciidoctor -b manpage doc/suika-bouncerserv.adoc -o doc/suika-bouncerserv.7
install: install:
$(MKDIR) -p $(DESTDIR)$(PREFIX)/$(BINDIR) $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(BINDIR)
$(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
@ -36,11 +41,15 @@ install:
$(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man7 $(MKDIR) -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man7
$(MKDIR) -p $(DESTDIR)${SYSCONFDIR}/suika $(MKDIR) -p $(DESTDIR)${SYSCONFDIR}/suika
$(MKDIR) -p $(DESTDIR)/var/lib/suika $(MKDIR) -p $(DESTDIR)/var/lib/suika
$(CP) -f suika suikactl suika-znc-import $(DESTDIR)$(PREFIX)/$(BINDIR) $(CP) -f suika suikadb suika-znc-import $(DESTDIR)$(PREFIX)/$(BINDIR)
$(CP) -f doc/suika.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1 $(CP) -f doc/suika.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
$(CP) -f doc/suikadb.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
$(CP) -f doc/suika-znc-import.1 $(DESTDIR)/$(MANDIR)/man1
$(CP) -f doc/suika-config.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5 $(CP) -f doc/suika-config.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
$(CP) -f doc/suika-bouncerserv.7 $(DESTDIR)$(PREFIX)/$(MANDIR)/man7 $(CP) -f doc/suika-bouncerserv.7 $(DESTDIR)$(PREFIX)/$(MANDIR)/man7
[ -f $(DESTDIR)${SYSCONFDIR}/suika/config ] || $(CP) -f config.in $(DESTDIR)${SYSCONFDIR}/suika/config [ -f $(DESTDIR)${SYSCONFDIR}/suika/config ] || $(CP) -f config.in $(DESTDIR)${SYSCONFDIR}/suika/config
test: test:
go test go test
.PHONY: suika suikactl suika-znc-import clean install vendor:
go mod vendor
.PHONY: suika suikadb suika-znc-import clean install

View File

@ -15,7 +15,7 @@ import (
"golang.org/x/crypto/ssh/terminal" "golang.org/x/crypto/ssh/terminal"
) )
const usage = `usage: suikactl [-config path] <action> [options...] const usage = `usage: suikadb [-config path] <action> [options...]
create-user <username> [-admin] Create a new user create-user <username> [-admin] Create a new user
change-password <username> Change password for a user change-password <username> Change password for a user

2
doc.go
View File

@ -1,7 +1,7 @@
// Package suika is a hard-fork of the 0.3 series of soju, an user-friendly IRC bouncer in Go. // Package suika is a hard-fork of the 0.3 series of soju, an user-friendly IRC bouncer in Go.
// //
// # Copyright (C) 2020 The soju Contributors // # Copyright (C) 2020 The soju Contributors
// # Copyright (C) 2023-present Aoi Koizumi et al. // # Copyright (C) 2023-present Izuru Yakumo et al.
// //
// suika is covered by the AGPLv3 license: // suika is covered by the AGPLv3 license:
// //

View File

@ -1,258 +1,525 @@
.Dd $Mdocdate$ '\" t
.Dt SUIKA-BOUNCERSERV 7 .\" Title: suika-bouncerserv
.Os .\" Author: Simon Ser and contributors / Izuru Yakumo
.Sh NAME .\" Generator: Asciidoctor 2.0.20
.Nm suika-bouncerserv .\" Date: 2023-09-15
.Nd Service bot exposed by suika to control the bouncer .\" Manual: Suika IRC Bouncer
.Sh DESCRIPTION .\" Source: SUIKA-BOUNCERSERV
suika exposes an IRC service called BouncerServ to manage the bouncer. .\" Language: English
Commands can be sent via regular private messages .\"
(/msg BouncerServ <command> [args...]). Commands may be written in full or .TH "SUIKA\-BOUNCERSERV" "7" "2023-09-15" "SUIKA\-BOUNCERSERV" "Suika IRC Bouncer"
abbreviated form, for instance network can be abbreviated as net or just .ie \n(.g .ds Aq \(aq
n. .el .ds Aq '
.Ss COMMANDS .ss \n[.ss] 0
.Bl -tag -width 11n .nh
.It help [command] .ad l
Show a list of commands. If command is specified, show a help message for .de URL
the command. \fI\\$2\fP <\\$1>\\$3
.It network create -addr <addr> [options...] ..
Connect to a new network at addr. -addr is mandatory. .als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
suika-bouncerserv \- Service bot exposed by suika(1) to control the bouncer
.SH "DESCRIPTION"
.sp
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.
.SH "COMMANDS"
.SS "help [command]"
.sp
Show a list of commands.
If command is specified, show a help message for the command.
.SS "network\-create \-addr <addr> [options...]"
.sp
Connect to a new network at addr.
The option \-addr is mandatory.
.sp
addr supports several connection types: addr supports several connection types:
* ircs://<host>:port \- connects with TLS over TCP
.Bl -tag -width 5n * irc+insecure://<host>:port \- connects with plain\-text over TCP
.It [ircs://]<host>[:port] * irc+unix://<path> \- connects to a Unix domain socket
connects with TLS over TCP .sp
.It irc+insecure://<host>[:port]
connects with plain-text TCP
.It irc+unix:///<path>
connects to a Unix socket
.El
Other options are: Other options are:
.sp
-name <name> .RS 4
Short network name. This will be used instead of addr to refer to the .ie n \{\
network. \h'-04'\(bu\h'+03'\c
.\}
-username <username> .el \{\
Connect with the specified username. By default, the nickname is used. . sp -1
. IP \(bu 2.3
-pass <pass> .\}
Connect with the specified server password. \-name <name>
Short network name, this will be used instead of addr to refer to the network
-realname <realname> .RE
Connect with the specified real name. By default, the account's realname .sp
is used if set, otherwise the network's nickname is used. .RS 4
.ie n \{\
-nick <nickname> \h'-04'\(bu\h'+03'\c
Connect with the specified nickname. By default, the account's username .\}
is used. .el \{\
. sp -1
-enabled true|false . IP \(bu 2.3
Enable or disable the network. If the network is disabled, the bouncer .\}
won't connect to it. By default, the network is enabled. \-username <username>
Connect with the specified username, by default, the nickname is used
-connect-command <command> .RE
Send the specified command as a raw IRC message right after connecting .sp
to the server. This can be used to identify to an account when the .RS 4
server doesn't support SASL. .ie n \{\
\h'-04'\(bu\h'+03'\c
.It network update [name] [options...] .\}
Update an existing network. The options are the same as the .el \{\
network create command. . sp -1
. IP \(bu 2.3
When this command is executed, suika will disconnect and re-connect to the .\}
network. \-pass <pass>
Connect with the specified server password
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-realname <realname>
Connect with the specified real name, by default, the account\(cqs realname is used if set, otherwise the network\(cqs nickname is used
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-nick <nick>
Connect with the specified nickname, by default, the account\(cqs username is used
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-enabled [bool]
Enable or disable the network, if the network is disabled, the bouncer won\(cqt connect to it, by default, the network is enabled
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-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
.RE
.SS "network update [options...]"
.sp
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. If name is not specified, the current network is updated.
.SS "network delete [name]"
.It network delete [name] .sp
Disconnect and delete a network. Disconnect and delete a network.
If name is not specified, the current network is deleted. If name is not specified, the current network is deleted.
.SS "network quote [name] <command>"
.It network quote [name] <command> .sp
Send a raw IRC line as-is to a network. Send a raw IRC line as\-is to a network.
If name is not specified, the command is sent to the current network. If name is not specified, the command is sent to the current network.
.It network status .SS "network status"
.sp
Show a list of saved networks and their current status. Show a list of saved networks and their current status.
.It channel status [options...] .SS "channel status [options...]"
.sp
Show a list of saved channels and their current status. Show a list of saved channels and their current status.
Options: Options:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Only show channels for the specified network. By default, only the channels in the current network are displayed. Only show channels for the specified network. By default, only the channels in the current network are displayed.
channel update <name> [options...] .RE
.SS "channel update <name> [options...]"
.sp
Update the options of an existing channel. Update the options of an existing channel.
Options are: Options are:
.sp
-detached true|false \-detached [bool]
Attach or detach this channel. 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. 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> .sp
\-relay\-detached [mode] \- Set when to relay messages from detached channels to the user with a BouncerServ NOTICE
Set when to relay messages from detached channels to the user with a BouncerServ NOTICE. * message \- Relay any message from this channel when detached.
Modes are: * highlight \- Relay only messages mentioning you when detached.
* none \- Do not relay any messages from this channel when detached.
message * default \- Currently same as highlight. This is the default behaviour.
.sp
Relay any message from this channel when detached. \-reattach\-on [mode] \- Set when to automatically reattach to detached channels.
highlight .sp
.RS 4
Relay only messages mentioning you when detached. .ie n \{\
none \h'-04'\(bu\h'+03'\c
.\}
Don't relay any messages from this channel when detached. .el \{\
default . sp -1
. IP \(bu 2.3
Currently same as highlight. This is the default behaviour. .\}
-reattach-on <mode> message \- Reattach to this channel when any message is received.
.RE
Set when to automatically reattach to detached channels. .sp
Modes are: .RS 4
.ie n \{\
message \h'-04'\(bu\h'+03'\c
.\}
Reattach to this channel when any message is received. .el \{\
highlight . sp -1
. IP \(bu 2.3
Reattach to this channel when any message mentioning you is received. .\}
none highlight \- Reattach to this channel when any message mentioning you is received.
.RE
Never automatically reattach to this channel. .sp
default .RS 4
.ie n \{\
Currently same as none. This is the default behaviour. \h'-04'\(bu\h'+03'\c
-detach-after <duration> .\}
.el \{\
Automatically detach this channel after the specified duration has elapsed without receving any message corresponding to -detach-on. . sp -1
Example duration values: 1h30m, 30s, 2.5h. . IP \(bu 2.3
.\}
Setting this value to 0 will disable this behaviour, i.e. this channel will never be automatically detached. This is the default behaviour. none \- Never automatically reattach to this channel.
.RE
-detach-on <mode> .sp
.RS 4
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. .ie n \{\
Modes are: \h'-04'\(bu\h'+03'\c
.\}
message .el \{\
. sp -1
Receiving any message from this channel will reset the auto-detach timer. . IP \(bu 2.3
highlight .\}
default \- Currently same as none. This is the default behaviour.
Receiving any message mentioning you from this channel will reset the auto-detach timer. .RE
none .sp
\-detach\-after [duration]
Receiving messages from this channel will not reset the auto-detach timer. Sending messages or joining the channel will still reset the timer. .sp
default 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.
.sp
Currently same as message. This is the default behaviour. \-detach\-on [mode]
.It channel delete <name> 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.
Leave and forget a channel. .sp
.It certfp generate [options...] .RS 4
Generate self-signed certificate and use it for authentication (via SASL EXTERNAL). .ie n \{\
Generates a 3072-bit RSA private key by default. \h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
message \- Receiving any message from this channel will reset the auto\-detach timer.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
highlight \- Receiving any message mentioning you from this channel will reset the auto\-detach timer.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
none \- Receiving messages from this channel will not reset the auto\-detach timer. Sending messages or joining the channel will still reset the timer.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
default \- Currently same as message. This is the default behaviour.
.RE
.SS "certfp generate [options...]"
.sp
Generate self\-signed certificate and use it for authentication (via SASL EXTERNAL). Generates a 3072\-bit RSA private key by default.
Options are: Options are:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Select a network. By default, the current network is selected, if any. Select a network. By default, the current network is selected, if any.
-key-type <type> .RE
.sp
Private key algorithm to use. Valid values are: rsa, ecdsa and ed25519. ecdsa uses the NIST P-521 curve. .RS 4
-bits <bits> .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-key\-type <type>
Private key algorithm to use. Valid values are: rsa, ecdsa and ed25519. ecdsa uses the NIST P\-521 curve.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-bits <bits>
Size of RSA key to generate. Ignored for other key types. Size of RSA key to generate. Ignored for other key types.
certfp fingerprint [options...] .RE
.SS "certfp fingerprint [options...]"
Show SHA-1 and SHA-256 fingerprints for the certificate currently used with the network. .sp
Show SHA\-1 and SHA\-256 fingerprints for the certificate currently used with the network.
Options are: Options are:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Select a network. By default, the current network is selected, if any. Select a network. By default, the current network is selected, if any.
sasl status [options...] .RE
.SS "sasl status [options...]"
.sp
Show current SASL status. Show current SASL status.
Options are: Options are:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Select a network. By default, the current network is selected, if any. Select a network. By default, the current network is selected, if any.
.It sasl set-plain [options...] <username> <password> .RE
.SS "sasl set\-plain [options...] <username> <password>"
.sp
Set SASL PLAIN credentials. Set SASL PLAIN credentials.
Options are: Options are:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Select a network. By default, the current network is selected, if any. Select a network. By default, the current network is selected, if any.
.It sasl reset [options...] .RE
.SS "sasl reset [options...]"
.sp
Disable SASL authentication and remove stored credentials. Disable SASL authentication and remove stored credentials.
Options are: Options are:
.sp
-network <name> .RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-network <network>
Select a network. By default, the current network is selected, if any. Select a network. By default, the current network is selected, if any.
.It user status .RE
.SS "user status"
.sp
Show a list of users on this server. Only admins can query this information. Show a list of users on this server. Only admins can query this information.
user create -username <username> -password <password> [options...] .SS "user create \-username <username> \-password <password> [options...]"
.sp
Create a new suika user. Only admin users can create new accounts. The -username and -password flags are mandatory. Create a new suika user. Only admin users can create new accounts. The \-username and \-password flags are mandatory.
Options are: Options are:
.sp
-username <username> .RS 4
.ie n \{\
The bouncer username. This cannot be changed after the user has been created. \h'-04'\(bu\h'+03'\c
-password <password> .\}
.el \{\
The bouncer password. . sp -1
-disable-password . IP \(bu 2.3
.\}
Disable password authentication. The user will be unable to login. \-username <username> \- The bouncer username. This cannot be changed after the user has been created.
-admin true|false .RE
.sp
Make the new user an administrator. .RS 4
-nick <nick> .ie n \{\
\h'-04'\(bu\h'+03'\c
Set the user's nickname. This is used as a fallback if there is no nickname set for a network. .\}
-realname <realname> .el \{\
. sp -1
Set the user's realname. This is used as a fallback if there is no realname set for a network. . IP \(bu 2.3
-enabled true|false .\}
\-password <password> \- The bouncer password.
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. .RE
.It user update [username] [options...] .sp
Update a user. The options are the same as the user create command. .RS 4
If username is omitted, the current user is updated. Only admins can update other users. .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-disable\-password \- Disable password authentication. The user will be unable to login.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-admin [bool] \- Make the new user an administrator.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-nick <nick> \- Set the user\(cqs nickname. This is used as a fallback if there is no nickname set for a network.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-realname <realname> \- Set the user\(cqs realname. This is used as a fallback if there is no realname set for a network.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-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.
.RE
.SS "user update [username] [options...]"
.sp
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.
.sp
Not all flags are valid in all contexts: Not all flags are valid in all contexts:
.sp
•The -username flag is never valid, usernames are immutable. .RS 4
•The -nick and -realname flag are only valid when updating the current user. .ie n \{\
•The -admin and -enabled flags are only valid when updating another user. \h'-04'\(bu\h'+03'\c
.It user delete <username> [confirmation token] .\}
Delete a suika user. .el \{\
Only admins can delete other users. . sp -1
.It user run <username> <command...> . IP \(bu 2.3
Execute a command as another user. .\}
Only admins can use this command. The \-username flag is never valid, usernames are immutable.
.It server status .RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
The \-nick and \-realname flag are only valid when updating the current user.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
The \-admin and \-enabled flags are only valid when updating another user.
.RE
.SS "user delete <username> [confirmation token]"
.sp
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. Show some bouncer statistics. Only admins can query this information.
.It server notice <message> === 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. Broadcast a notice. All currently connected bouncer users will receive the message from the special BouncerServ service. Only admins can broadcast a notice.
.El .SH "SEE ALSO"
.Sh SEE ALSO .sp
.Xr suika 1 suika(1)
.Xr suika-config 5 suikadb(1)
.Sh AUTHORS suika\-znc\-import(1)
.An Simon Ser and contributors suika\-config(5)
.Lk https://emersion.fr .SH "AUTHOR"
.Pp .sp
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja Simon Ser and contributors / Izuru Yakumo

193
doc/suika-bouncerserv.adoc Normal file
View File

@ -0,0 +1,193 @@
= 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)

View File

@ -1,142 +1,326 @@
.Dd $Mdocdate$ '\" t
.Dt SUIKA-CONFIG 5 .\" Title: suika-config
.Os .\" Author: Simon Ser and contributors / Izuru Yakumo
.Sh NAME .\" Generator: Asciidoctor 2.0.20
.Nm suika-config .\" Date: 2023-09-15
.Nd Configuration file for suika IRC bouncer .\" Manual: Suika IRC Bouncer
.Sh DESCRIPTION .\" Source: SUIKA-CONFIG
.\" Language: English
.\"
.TH "SUIKA\-CONFIG" "5" "2023-09-15" "SUIKA\-CONFIG" "Suika IRC Bouncer"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
suika-config \- Configuration file for suika(1)
.SH "DESCRIPTION"
.sp
The config file has one directive per line The config file has one directive per line
.sp
Example: Example:
.sp
listen ircs:// listen ircs://
.Pp
tls cert.pem key.pem tls cert.pem key.pem
.Pp
hostname example.org hostname example.org
.sp
The following directives are supported: The following directives are supported:
.sp
.Bl -tag -width 7n -compact .RS 4
.It listen <uri> .ie n \{\
Listening URI (default: ":6697") \h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
listen <uri>
Listening URI (default ":6697")
.RE
.sp
The following URIs are supported: The following URIs are supported:
.Bl -tag -width 11n -compact .sp
.It ircs://[host]:[port] .RS 4
listens with TLS over TCP .ie n \{\
.It irc+insecure://[host]:[port] \h'-04'\(bu\h'+03'\c
listens with plain-text over TCP .\}
.It unix:///<path> .el \{\
listens on a Unix domain socket . sp -1
.It wss://[host]:[port] . IP \(bu 2.3
listens for WebSocket connections over .\}
TLS ircs://host:port
.It ws+insecure://[host]:[port] Listens with TLS over TCP
listens for plain-text WebSocket .RE
connections .sp
.It ident://[host]:[port] .RS 4
listens for plain-text ident .ie n \{\
connections \h'-04'\(bu\h'+03'\c
.It http+prometheus://[host]:[port] .\}
listens for plain-text HTTP .el \{\
connections and serves Prometheus . sp -1
metrics (host must be "localhost") . IP \(bu 2.3
.It http+pprof://[host]:[port] .\}
listens for plain-text HTTP irc+insecure://host:port
connections and serves pprof Listens with plain\-text over TCP
runtime profiling data .RE
(host must be "localhost"). .sp
For more information, see: .RS 4
<https://pkg.go.dev/net/http/pprof>. .ie n \{\
.El \h'-04'\(bu\h'+03'\c
.\}
If the scheme is omitted, "ircs" is assumed. .el \{\
If multiple "listen" directives are specified, . sp -1
suika will listen on each of them. . IP \(bu 2.3
.\}
.It hostname <name> unix:///<path>
Listens on a Unix domain socket
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
unix+admin:///<path>
Listens on a Unix domain socket for use with suikactl(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
wss://host:port
Listens for WebSocket connections over TLS
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
ws+insecure://host:port
Listens for plain\-text WebSocket connections
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
ident://host:port
Listens for plain\-text ident connections
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
http+prometheus://host:port
Listens for plain\-text HTTP connections and serves Prometheus metrics (host must be "localhost")
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
http+pprof://host:port
Listens for plain\-text HTTP connections and serves pprof runtime profiling data (host must be "localhost")
For more information, see: \c
.URL "https://pkg.go.dev/net/http/pprof" "" "."
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
hostname <name>
Server hostname Server hostname
.RE
.It title <title> .sp
Server title. This will be sent as .RS 4
the ISUPPORT NETWORK value when .ie n \{\
clients don't select a specific \h'-04'\(bu\h'+03'\c
network. .\}
.el \{\
.It tls <cert> <key> . sp -1
Enable TLS support. The certificate . IP \(bu 2.3
and key files must be PEM-encoded. .\}
title <title>
.It db <driver> <source> Server title. This will be sent as the ISUPPORT NETWORK value when clients don\(cqt select a specific network.
Set the database location for user, .RE
network and channel storage. By .sp
default, a sqlite3 database is .RS 4
opened in ./suika.db. .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
tls <cert> <key>
Enable TLS support. The certificate and key files must be PEM\-encoded.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
db <driver> <source>
Set the database location for user, network and channel storage.
By default, a sqlite3 database is opened in ./suika.db.
.RE
.sp
Supported drivers: Supported drivers:
* sqlite3: expects source to be a path to the SQLite file
.Bl tag -width 7n -compact * postgres: expects source to be a space\- separated list of key=value parameters, e.g. db postgres host=/run/postgresql dbname=suika.
.It sqlite3 Note that sslmode defaults to require.
expects source to be a path to For more information on connection strings, see: \c
the SQLite file .URL "https://pkg.go.dev/github.com/lib/pq#hdr\-Connection_String_Parameters" "" ""
.It postgres .sp
expects source to be a space- .RS 4
separated list of key=value .ie n \{\
parameters, e.g. db postgres \h'-04'\(bu\h'+03'\c
host=/run/postgresql .\}
dbname=suika. Note that .el \{\
sslmode defaults to require. . sp -1
For more information on . IP \(bu 2.3
connection strings, see: .\}
<https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters> log fs <path>
.El Path to the bouncer logs directory, or empty to disable logging.
By default, logging is disabled.
.It log fs <path> .RE
Path to the bouncer logs directory, or empty to .sp
disable logging. By default, logging is disabled. .RS 4
.ie n \{\
.It http-origin <patterns> \h'-04'\(bu\h'+03'\c
List of allowed HTTP origins for WebSocket listeners. .\}
The parameters are interpreted as shell patterns, see *glob*(7). .el \{\
. sp -1
By default, only the request host is authorized. . IP \(bu 2.3
Use this directive to enable cross-origin WebSockets. .\}
http\-origin <patterns>
.It accept-proxy-ip <cidr..> List of allowed HTTP origins for WebSocket listeners. The parameters are interpreted as shell patterns, see glob(3)
Allow the specified IPs to act as a proxy. Proxys have the ability to By default, only the request host is authorized. Use this directive to enable cross\-origin WebSockets.
overwrite the remote and local connection addresses (via the PROXY protocol, .RE
the Forwarded HTTP header field defined in RFC 7239 or the X-Forwarded-\* .sp
HTTP header fields). The special name "localhost" accepts the loopback .RS 4
addresses 127.0.0.0/8 and ::1/128. .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
accept\-proxy\-ip <cidr..>
Allow the specified IPs to act as a proxy.
Proxies have the ability to overwrite the remote and local connection addresses (via the PROXY protocol, the Forwarded HTTP header field defined in RFC 7239 or the X\-Forwarded\- HTTP header fields).
The special name "localhost" accepts the loopback addresses 127.0.0.0/8 and ::1/128.
By default, all IPs are rejected. By default, all IPs are rejected.
.RE
.It max-user-networks <limit> .sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
max\-user\-networks <limit>
Maximum number of networks per user. By default, there is no limit. Maximum number of networks per user. By default, there is no limit.
.RE
.It motd <path> .sp
Path to the MOTD file. The bouncer MOTD is sent to clients which aren't .RS 4
bound to a specific network. By default, no MOTD is sent. .ie n \{\
\h'-04'\(bu\h'+03'\c
.It multi-upstream-mode <true|false> .\}
Globally enable or disable multi-upstream mode. .el \{\
By default, multi-upstream mode is enabled. . sp -1
. IP \(bu 2.3
.It upstream-user-ip <cidr...> .\}
Enable per-user IP addresses. motd <path>
One IPv4 range and/or one IPv6 range can be Path to the MOTD file.
specified in CIDR notation. The bouncer MOTD is sent to clients which aren\(cqt bound to a specific network.
One IP address per range will be assigned to By default, no MOTD is sent.
each user and will be used as the source address when connecting to an .RE
upstream network. .sp
.RS 4
This can be useful to avoid having the whole bouncer banned from an upstream .ie n \{\
network because of one malicious user. \h'-04'\(bu\h'+03'\c
.El .\}
.Sh SEE ALSO .el \{\
.Xr suika 1 . sp -1
.Xr suika-bouncerserv 7 . IP \(bu 2.3
.Sh AUTHORS .\}
.An Simon Ser and contributors Aq https://emersion.fr multi\-upstream\-mode <true|false>
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja Globally enable or disable multi\-upstream mode.
By default, multi\-upstream mode is enabled.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
upstream\-user\-ip <cidr...>
Enable per\-user IP addresses.
One IPv4 range and/or one IPv6 range can be specified in CIDR notation.
One IP address per range will be assigned to each user and will be used as the source address when connecting to an upstream network.
This can be useful to avoid having the whole bouncer banned from an upstream network because of one malicious user.
.RE
.SH "SEE ALSO"
.sp
suika(1)
suikadb(1)
suika\-znc\-import(1)
suika\-bouncerserv(7)
.SH "AUTHOR"
.sp
Simon Ser and contributors / Izuru Yakumo

104
doc/suika-config.adoc Normal file
View File

@ -0,0 +1,104 @@
= suika-config(5)
Simon Ser and contributors / Izuru Yakumo
v0.4.3
:doctype: manpage
:manmanual: Suika IRC Bouncer
:mansource: SUIKA-CONFIG
== Name
suika-config - Configuration file for suika(1)
== Description
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>
Listening URI (default ":6697")
The following URIs are supported:
* ircs://host:port
Listens with TLS over TCP
* irc+insecure://host:port
Listens with plain-text over TCP
* unix:///<path>
Listens on a Unix domain socket
* unix+admin:///<path>
Listens on a Unix domain socket for use with suikactl(1)
* wss://host:port
Listens for WebSocket connections over TLS
* ws+insecure://host:port
Listens for plain-text WebSocket connections
* ident://host:port
Listens for plain-text ident connections
* http+prometheus://host:port
Listens for plain-text HTTP connections and serves Prometheus metrics (host must be "localhost")
* http+pprof://host: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.
--
* hostname <name>
Server hostname
* title <title>
Server title. This will be sent as the ISUPPORT NETWORK value when clients don't select a specific network.
* tls <cert> <key>
Enable TLS support. The certificate and key files must be PEM-encoded.
* db <driver> <source>
Set the database location for user, network and channel storage.
By default, a sqlite3 database is opened in ./suika.db.
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=suika.
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
--
* log fs <path>
Path to the bouncer logs directory, or empty to disable logging.
By default, logging is disabled.
* http-origin <patterns>
List of allowed HTTP origins for WebSocket listeners. The parameters are interpreted as shell patterns, see glob(3)
By default, only the request host is authorized. Use this directive to enable cross-origin WebSockets.
* accept-proxy-ip <cidr..>
Allow the specified IPs to act as a proxy.
Proxies have the ability to overwrite the remote and local connection addresses (via the PROXY protocol, the Forwarded HTTP header field defined in RFC 7239 or the X-Forwarded- HTTP header fields).
The special name "localhost" accepts the loopback addresses 127.0.0.0/8 and ::1/128.
By default, all IPs are rejected.
* max-user-networks <limit>
Maximum number of networks per user. By default, there is no limit.
* motd <path>
Path to the MOTD file.
The bouncer MOTD is sent to clients which aren't bound to a specific network.
By default, no MOTD is sent.
* multi-upstream-mode <true|false>
Globally enable or disable multi-upstream mode.
By default, multi-upstream mode is enabled.
* upstream-user-ip <cidr...>
Enable per-user IP addresses.
One IPv4 range and/or one IPv6 range can be specified in CIDR notation.
One IP address per range will be assigned to each user and will be used as the source address when connecting to an upstream network.
This can be useful to avoid having the whole bouncer banned from an upstream network because of one malicious user.
== See Also
suika(1)
suikadb(1)
suika-znc-import(1)
suika-bouncerserv(7)

19
doc/suika-znc-import.adoc Normal file
View File

@ -0,0 +1,19 @@
= suika-znc-import(1)
Simon Ser and contributors / Izuru Yakumo
v0.4.3
:doctype: manpage
:manmanual: Suika IRC Bouncer
:mansource: SUIKA-ZNC-IMPORT
== Name
suika-znc-import - Command for migrating from ZNC
== Synopsis
suika-znc-import <command> [options] <znc config file>
== See Also
suika(1)
suikadb(1)
suika-config(5)
suika-bouncerserv(7)

View File

@ -1,102 +1,154 @@
.Dd $Mdocdate$ '\" t
.Dt SUIKA 1 .\" Title: suika
.Os .\" Author: Simon Ser and contributors / Izuru Yakumo
.Sh NAME .\" Generator: Asciidoctor 2.0.20
.Nm suika .\" Date: 2023-09-15
.Nd Drunk as hell IRC bouncer oni. .\" Manual: Suika IRC Bouncer
.Sh SYNOPSIS .\" Source: SUIKA
.Nm .\" Language: English
.Op Fl options .\"
.Ar ... .TH "SUIKA" "1" "2023-09-15" "SUIKA" "Suika IRC Bouncer"
.Sh DESCRIPTION .ie \n(.g .ds Aq \(aq
suika is an user-friendly IRC bouncer. .el .ds Aq '
It connects to upstream IRC servers on .ss \n[.ss] 0
behalf of the user to provide extra .nh
features. .ad l
.de URL
.Bl -tag -width 10n -compact \fI\\$2\fP <\\$1>\\$3
.It * ..
Multiple separate users sharing the same .als MTO URL
bouncer, each with their own upstream .if \n[.g] \{\
servers . mso www.tmac
.It * . am URL
Clients connecting to multiple upstream . ad l
servers via a single connection to the . .
bouncer . am MTO
.It * . ad l
Sending the backlog (messages received . .
while the user was disconnected from . LINKSTYLE blue R < >
the bouncer), with per-client buffers .\}
.El .SH "NAME"
suika \- Drunk as hell IRC bouncer, named after Suika Ibuki from Touhou Project
When joining a channel, the channel will .SH "SYNOPSIS"
be saved and automatically joined on .sp
the next connection. When registering suika [\-options] ...
or authenticating with NickServ, the .SH "DESCRIPTION"
credentials will be saved and .sp
automatically used on the next suika is an user\-friendly IRC bouncer.
connection if the server supports It connects to upstream IRC servers on behalf of the user to provide extra features.
SASL. When parting a channel with .sp
the reason "detach", the channel .RS 4
will be detached instead of being .ie n \{\
left. \h'-04'\(bu\h'+03'\c
.\}
When all clients are disconnected .el \{\
from the bouncer, the user is . sp -1
automatically marked as away. . IP \(bu 2.3
.\}
Multiple separate users sharing the same bouncer, each with their own upstream servers
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Clients connecting to multiple upstream servers via a single connection to the bouncer
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Sending the backlog (messages received while the user was disconnected from the bouncer), with per\-client buffers
.RE
.sp
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.
When all clients are disconnected from the bouncer, the user is automatically marked as away.
.sp
suika supports two connection modes: suika supports two connection modes:
.sp
.Bl -tag -width 10n -compact Single upstream mode: one downstream connection maps to one upstream connection. To enable this mode, connect to the bouncer with the username "<username>/<network>".
.It Single upstream mode If the bouncer isn\(cqt connected to the upstream server, it will get automatically added.
one downstream connection maps to one upstream Then channels can be joined and parted as if you were directly connected to the upstream server.
connection. To enable this mode, .sp
connect to the bouncer with the username Multiple upstream mode: one downstream connection maps to multiple upstream connections.
"<username>/<network>". Channels and nicks are suffixed with the network name.
If the bouncer isn't connected to the upstream To join a channel, you need to use the suffix too: /join #channel/network.
server, it will get automatically added. Same applies to messages sent to users.
Then channels can be joined and .sp
parted as if you were directly For per\-client history to work, clients need to indicate their name.
connected to the upstream server. This can be done by adding a "@<client>" suffix to the username.
.It Multiple upstream mode .sp
one downstream connection maps to multiple upstream suika will reload the configuration file, the TLS certificate/key and the MOTD file when it receives the HUP signal.
connections. The configuration options listen, db and log cannot be reloaded.
Channels and nicks are suffixed .sp
with the network name. To join Administrators can broadcast a message to all bouncer users via /notice $<hostname> <text>, or via /notice $<text> in multi\-upstream mode.
a channel, you need to use All currently connected bouncer users will receive the message from the special BouncerServ service.
the suffix too: .SH "OPTIONS"
/join #channel/network. .sp
Same applies to messages .RS 4
sent to users. .ie n \{\
.El \h'-04'\(bu\h'+03'\c
.\}
For per-client history to work, clients need to indicate their name. This can .el \{\
be done by adding a "@<client>" suffix to the username. . sp -1
. IP \(bu 2.3
suika will reload the configuration file, the TLS certificate/key and the MOTD .\}
file when it receives the HUP signal. The configuration options listen, db \-h, \-help
and log cannot be reloaded.
Administrators can broadcast a message to all bouncer users via /notice
$<hostname> <text>, or via /notice $\* <text> in multi-upstream mode. All
currently connected bouncer users will receive the message from the special
BouncerServ service.
.Sh OPTIONS
.Bl -tag -width 11n -compact
.It -h, -help
Show help message and quit Show help message and quit
.It -config <path> .RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-config <path>
Path to the config file. If unset, a default config file is used. Path to the config file. If unset, a default config file is used.
.It -debug .RE
Enable debug logging (this will leak sensitive information .sp
such as passwords) .RS 4
.It -listen <uri> .ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-debug
Enable debug logging (this will leak sensitive information such as passwords)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
\-listen <uri>
Listening URI (default ":6697"). Can be specified multiple times. Listening URI (default ":6697"). Can be specified multiple times.
.El .RE
.Sh SEE ALSO .SH "SEE ALSO"
.Xr suika-config 5 .sp
.Xr suika-bouncerserv 7 suikadb(1)
.Sh AUTHORS suika\-znc\-import(1)
.An Simon Ser and contributors https://emersion.fr suika\-config(5)
.An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja suika\-bouncerserv(7)
.SH "AUTHOR"
.sp
Simon Ser and contributors / Izuru Yakumo

61
doc/suika.adoc Normal file
View File

@ -0,0 +1,61 @@
= suika(1)
Simon Ser and contributors / Izuru Yakumo
v0.4.3
:doctype: manpage
:manmanual: Suika IRC Bouncer
:mansource: SUIKA
== Name
suika - Drunk as hell IRC bouncer, named after Suika Ibuki from Touhou Project
== Synopsis
suika [-options] ...
== Description
suika is an 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
* Clients connecting to multiple upstream servers via a single connection to the bouncer
* Sending the backlog (messages received while the user was disconnected from the bouncer), with per-client buffers
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.
When all clients are disconnected from the bouncer, the user is automatically marked as away.
suika supports two connection modes:
Single upstream mode: one downstream connection maps to one upstream connection. To enable this mode, connect to the bouncer with the username "<username>/<network>".
If the bouncer isn't connected to the upstream server, it will get automatically added.
Then channels can be joined and parted as if you were directly connected to the upstream server.
Multiple upstream mode: one downstream connection maps to multiple upstream connections.
Channels and nicks are suffixed with the network name.
To join a channel, you need to use the suffix too: /join #channel/network.
Same applies to messages sent to users.
For per-client history to work, clients need to indicate their name.
This can be done by adding a "@<client>" suffix to the username.
suika 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> in multi-upstream mode.
All currently connected bouncer users will receive the message from the special BouncerServ service.
== Options
* -h, -help
Show help message and quit
* -config <path>
Path to the config file. If unset, a default config file is used.
* -debug
Enable debug logging (this will leak sensitive information such as passwords)
* -listen <uri>
Listening URI (default ":6697"). Can be specified multiple times.
== See Also
suikadb(1)
suika-znc-import(1)
suika-config(5)
suika-bouncerserv(7)

45
doc/suikadb.1 Normal file
View File

@ -0,0 +1,45 @@
'\" t
.\" Title: suikadb
.\" Author: Simon Ser and contributors / Izuru Yakumo
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-09-15
.\" Manual: Suika IRC Bouncer
.\" Source: SUIKADB
.\" Language: English
.\"
.TH "SUIKADB" "1" "2023-09-15" "SUIKADB" "Suika IRC Bouncer"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
suikadb \- Basic user manipulation command for suika(1)
.SH "SYNOPSIS"
.sp
suikadb create\-user
suikadb change\-password
.SH "SEE ALSO"
.sp
suika(1)
suikactl(1)
suika\-znc\-import(1)
suika\-config(5)
suika\-bouncerserv(7)
.SH "AUTHOR"
.sp
Simon Ser and contributors / Izuru Yakumo

21
doc/suikadb.adoc Normal file
View File

@ -0,0 +1,21 @@
= suikadb(1)
Simon Ser and contributors / Izuru Yakumo
v0.4.3
:doctype: manpage
:manmanual: Suika IRC Bouncer
:mansource: SUIKADB
== Name
suikadb - Basic user manipulation command for suika(1)
== Synopsis
suikadb create-user
suikadb change-password
== See Also
suika(1)
suikactl(1)
suika-znc-import(1)
suika-config(5)
suika-bouncerserv(7)

View File

@ -1107,7 +1107,6 @@ func handleServiceChannelUpdate(ctx context.Context, dc *downstreamConn, params
sendServicePRIVMSG(dc, fmt.Sprintf("updated channel %q", name)) sendServicePRIVMSG(dc, fmt.Sprintf("updated channel %q", name))
return nil return nil
} }
func handleServiceServerStatus(ctx context.Context, dc *downstreamConn, params []string) error { func handleServiceServerStatus(ctx context.Context, dc *downstreamConn, params []string) error {
dbStats, err := dc.user.srv.db.Stats(ctx) dbStats, err := dc.user.srv.db.Stats(ctx)
if err != nil { if err != nil {