We were unconditionally using the ASCII case-mapping in updateNick(),
for instance.
Introduce downstreamConn.casemap to fix this, and use it everywhere.
Some servers like snircd reject OTHER [1], because OTHER can be
used when the ident string is not stable (e.g. is an audit token
that changes each time the ident is queried).
[1]: 17c92003d3/ircd/s_auth.c (L559)
Two reasons:
- Because of [1], when mattn/go-sqlite3 is used without libsqlite3,
we need Go 1.19.
- atomic.Int64 has been introduced in Go 1.19.
[1]: https://github.com/golang/go/issues/58438
No need to re-check that a Web Push subscription is valid every
time a downstream connects. Mobile devices may reconnect pretty
frequently.
Check at most once a day.
PostgreSQL tests use pg_temp only. pg_temp is never searched for FTS
objects, so creating then altering an FTS configuration will not work
because PostgreSQL will not be able to find the FTS configuration it
just created.
Instead, we explicitly refer to the FTS objects with their full name
including their prefix, which makes PostgreSQL able to find the object.
This is only needed for tests.
See: https://stackoverflow.com/a/31095452/2347617
See: https://www.postgresql.org/message-id/15191.1208975632@sss.pgh.pa.us
This adds a new config option, `logs db`, which enables storing chat
logs in the soju database.
Regular store options, CHATHISTORY options, and SEARCH operations are
supported, like the fs logs backend.
Messages are stored in a new table, Message. In order to track the list
of targets we have messages for in an optimized manner, another database
is used: MessageTarget.
All new requests are backend by indexes so should be fast even with
hundreds of thousands of messages.
A contrib script is provided for migrating existing logs fs chat logs to
the database. It can be run with eg:
go run ./contrib/migrate-logs/ logs/ sqlite3:soju.db
Co-authored-by: Simon Ser <contact@emersion.fr>
We need to use sql.NullTime, otherwise we get errors like these:
sql: Scan error on column index 7, name "downstream_interacted_at": unsupported Scan, storing driver.Value type <nil> into type *time.Time
This new command enables communicating with the unix administrative
endpoint (unix+admin) that can be enabled on soju.
The syntax is just that of BouncerServ.
Examples:
sojuctl -config soju.config help
sojuctl -config soju.config user status
This preserves the previous behavior of *not* enabling any unix+admin
endpoint for developement purposes, but enables it in the default
configuration installed by the Makefile.