Commit Graph

35 Commits

Author SHA1 Message Date
Henrique Dias c5d07658ab Upgrade to go-sqlite3 to fix musl build
go-sqlite3 does not build with musl 1.2.4+, which is packaged in some
distros (e.g. Alpine 3.19+). This update fixes it. More info:
https://github.com/mattn/go-sqlite3/pull/1177
2023-12-21 15:36:41 +01:00
Simon Ser e6d6476a0d Upgrade dependencies 2023-11-01 00:17:57 +01:00
Simon Ser 00877b50c5 Upgrade dependencies 2023-08-16 21:04:37 +02:00
Simon Ser 64196d5b6e Upgrade dependencies 2023-06-01 13:07:39 +02:00
Simon Ser 522f8a80d7 Bump minimum Go version to 1.19
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
2023-02-22 23:46:14 +01:00
delthas 1ccc7ce6d2 Add a database store for messages
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>
2023-02-17 14:13:43 +01:00
Simon Ser 24cae474db Add support for PAM authentication 2023-01-30 11:55:43 +01:00
Simon Ser 330d5d794c Upgrade dependencies 2022-11-22 14:55:52 +01:00
Simon Ser 106d40dcd4 Upgrade to gopkg.in/irc.v4 2022-11-14 12:06:58 +01:00
Łukasz Margiela d605d64d1d Add build tag for modernc/sqlite driver 2022-09-26 19:31:43 +02:00
Simon Ser 9cdbee3b1b Upgrade dependencies 2022-09-11 15:48:24 +02:00
Simon Ser 3863b8cb6b Add webpush extension
References: https://github.com/ircv3/ircv3-specifications/pull/471
Co-authored-by: delthas <delthas@dille.cc>
2022-06-14 16:16:12 +02:00
Simon Ser 8cbaae2b90 Upgrade dependencies 2022-06-13 11:11:15 +02:00
Simon Ser 5ee667a2d9 Upgrade dependencies 2022-03-03 09:00:36 +01:00
Simon Ser b2957c05d5 Use golang.org/x/time/rate
Instead of hand-rolling our own rate-limiter based on goroutines,
use golang.org/x/time/rate.
2021-12-02 23:52:29 +01:00
Simon Ser 254108bd99 Upgrade dependencies 2021-11-17 16:57:41 +01:00
Simon Ser 8f8d7aab0e Add basic Prometheus metrics exporter
This only exports the default metrics for now.

References: https://todo.sr.ht/~emersion/soju/142
2021-11-17 15:58:18 +01:00
Simon Ser 5c20c4c0f4 Upgrade dependencies 2021-10-12 16:54:51 +02:00
Hubert Hirtz 6e06663615 PostgreSQL support 2021-10-11 15:21:04 +02:00
Simon Ser 8adf65ade2 Upgrade dependencies 2021-09-13 14:23:33 +02:00
Simon Ser bc7123f486 Update dependencies 2021-03-31 18:18:16 +02:00
Simon Ser 5b4469fcb7 Use BARE for internal message IDs
This allows to have shorter and more future-proof IDs. This also
guarantees the IDs will only use reasonable ASCII characters (no
spaces), removing the need to encode them for PING/PONG tokens.
2021-03-31 17:57:24 +02:00
Simon Ser 0ba3f1148e
Update dependencies
In particular, go-irc v3.1.4 should fix empty IRC message handling.
2021-01-19 19:20:04 +01:00
Simon Ser 24d8f2167b
Upgrade dependencies 2020-10-25 18:15:54 +01:00
Simon Ser 0709ac143f
Switch to go-scfg
We don't use child directives yet, but likely will in the future.
2020-10-25 18:10:50 +01:00
Simon Ser bbe67adf1e
Add support for the PROXY protocol
IPs whitelisted in accept-proxy-ip can now use the PROXY protocol to
indicate the original source/destination addresses.

Closes: https://todo.sr.ht/~emersion/soju/81
2020-09-07 21:28:24 +02:00
Simon Ser ae3e4262b9
Update dependencies 2020-08-24 19:05:56 +02:00
Simon Ser d0cf1d2882
Add support for WebSocket connections
WebSocket connections allow web-based clients to connect to IRC. This
commit implements the WebSocket sub-protocol as specified by the pending
IRCv3 proposal [1].

WebSocket listeners can now be set up via a "wss" protocol in the
`listen` directive. The new `http-origin` directive allows the CORS
allowed origins to be configured.

[1]: https://github.com/ircv3/ircv3-specifications/pull/342
2020-06-07 14:13:46 +02:00
Simon Ser 166d8b0626
Remove some IRCv3 constants
go-irc v3.1.2 adds some missing IRCv3 constants.
2020-03-19 14:51:45 +01:00
Simon Ser e3d97bb164
Add basic infrastructure for bouncer service 2020-03-18 12:23:08 +01:00
Simon Ser 85ffadea33
Update dependencies
go-irc v3.1.1 contains a breaking change.

References: https://github.com/go-irc/irc/issues/76
2020-03-13 16:18:53 +01:00
Simon Ser 03d5600da6
Add support for SASL authentication
We now store SASL credentials in the database and automatically populate
them on NickServ REGISTER/IDENTIFY.

References: https://todo.sr.ht/~emersion/jounce/10
2020-03-13 15:12:44 +01:00
Simon Ser a572b24702
cmd/jouncectl: new command
Allows to create users.
2020-03-11 19:01:03 +01:00
Simon Ser 84fe3ae255
Add SQLite database
Closes: https://todo.sr.ht/~emersion/jounce/9
2020-03-04 18:22:58 +01:00
Simon Ser 8e31fde0ab
Add basic IRC listener 2020-02-04 10:46:22 +01:00