Find a file
Simon Ser ec2c0685dd Add WHO cache
This adds a new field to upstreams, members, which is a casemapped map
of upstream users known to the soju. The upstream users known to soju
are: self, any monitored user, and any user with whom we share a
channel.

The information stored for each upstream user corresponds to the info
that can be returned by a WHO/WHOX command.

We build the upstream user information both incrementally, capturing
information contained in JOIN and AWAY messages; and with the bulk user
information contained in WHO replies we receive.

This lets us build a user cache that can then be used to return
synthetic WHO responses to later WHO requests by downstreams.

This is useful because some networks (eg Libera) heavily throttle WHO
commands, and without this cache, any downstream connecting would send 1
WHO command per channel, so possibly more than a dozen WHO commands,
which soju then forwarded to the upstream as WHO commands.

With this cache most WHO commands can be cached and avoid sending
WHO commands to the upstream.

In order to cache the "flags" field, we synthetize the field from user
info we get from incremental messages: away status (H/G) and bot status
(B). This could result in incorrect values for proprietary user fields.
Support for the server-operator status (*) is also not supported.

Of note is that it is difficult to obtain a user "connected server"
field incrementally, so clients that want to maximize their WHO cache
hit ratio can use WHOX to only request fields they need, and in
particular not include the server field flag.

Co-authored-by: delthas <delthas@dille.cc>
2022-12-01 15:50:33 +01:00
cmd config: drop multi-upstream-mode 2022-09-26 16:57:05 +02:00
config config: drop multi-upstream-mode 2022-09-26 16:57:05 +02:00
contrib contrib/clients: reference read_marker.py for Weechat 2022-11-11 11:52:24 +01:00
database Make the auto-away functionality configurable 2022-09-26 19:52:07 +02:00
doc Be more clear that -connect-command needs quotes 2022-11-28 15:10:39 +01:00
identd Move identd to separate package 2022-05-09 16:36:54 +02:00
msgstore Truncate message times to the second when using the FS message store 2022-11-28 17:54:13 +01:00
xirc Add WHO cache 2022-12-01 15:50:33 +01:00
.build.yml ci: switch to alpine/latest 2021-10-15 09:59:53 +02:00
.editorconfig Add .editorconfig 2020-11-30 11:39:41 +01:00
.gitignore doc: document "network delete" 2020-04-01 17:38:09 +02:00
certfp.go Split CertFP logic into separate file 2021-10-08 09:47:25 +02:00
config.in Rename "log" config directive to "message-store" 2022-05-09 16:41:41 +02:00
conn.go Upgrade to gopkg.in/irc.v4 2022-11-14 12:06:58 +01:00
downstream.go Add WHO cache 2022-12-01 15:50:33 +01:00
go.mod Upgrade dependencies 2022-11-22 14:55:52 +01:00
go.sum Upgrade dependencies 2022-11-22 14:55:52 +01:00
irc.go Add WHO cache 2022-12-01 15:50:33 +01:00
irc_test.go irc: add isHighlight tests 2022-02-25 11:31:41 +01:00
LICENSE Switch license to AGPLv3 2020-02-07 17:41:51 +01:00
Makefile makefile: switch to BSD/GNU make 2022-02-08 16:10:19 +01:00
net_go113.go go fmt: add go:build tags 2021-09-09 10:07:37 +02:00
net_go116.go go fmt: add go:build tags 2021-09-09 10:07:37 +02:00
rate.go Add exponential backoff when re-connecting to upstream 2021-12-02 12:14:35 +01:00
README.md Add build tag for modernc/sqlite driver 2022-09-26 19:31:43 +02:00
server.go Upgrade to gopkg.in/irc.v4 2022-11-14 12:06:58 +01:00
server_test.go Upgrade to gopkg.in/irc.v4 2022-11-14 12:06:58 +01:00
service.go Upgrade to gopkg.in/irc.v4 2022-11-14 12:06:58 +01:00
service_test.go Hand-made word splitter for BouncerServ 2021-06-24 19:33:46 +02:00
upstream.go Add WHO cache 2022-12-01 15:50:33 +01:00
user.go Add WHO cache 2022-12-01 15:50:33 +01:00

soju

builds.sr.ht status

soju is a user-friendly IRC bouncer. soju connects to upstream IRC servers on behalf of the user to provide extra functionality. soju supports many features such as multiple users, numerous IRCv3 extensions, chat history playback and detached channels. It is well-suited for both small and large deployments.

Usage

Building and installing

Dependencies:

  • Go
  • BSD or GNU make
  • a C89 compiler (optional, for SQLite)
  • scdoc (optional, for man pages)

For end users, a Makefile is provided:

make
sudo make install

For development, you can use go run ./cmd/soju as usual.

To link with the system libsqlite3, set GOFLAGS="-tags=libsqlite3". To disable SQLite support, set GOFLAGS="-tags=nosqlite".

To use an alternative SQLite library that does not require CGO, set GOFLAGS="-tags=moderncsqlite".

Contributing

Send patches on the mailing list or on GitHub, report bugs on the issue tracker. Discuss in #soju on Libera Chat.

License

AGPLv3, see LICENSE.

Copyright (C) 2020 The soju Contributors