687 Commits

Author SHA1 Message Date
contact
ae9ecc0718 cmd/soju: bump max number of opened files
The bouncer process may be dealing with many opened FDs. The default
on Linux is 1024. To support bouncers with a lot of users, bump
RLIMIT_NOFILE to the max as advised in [1].

[1]: http://0pointer.net/blog/file-descriptor-limits.html

git-svn-id: file:///srv/svn/repo/suika/trunk@687 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-15 20:22:43 +00:00
delthas
a056e2f696 Send the downstream host for PRIVMSG echo messages
If a downstream of prefix host `foo` sends a message, the other
downstream of prefix host `bar` should receive an echo PRIVMSG with
prefix host bar.

This fixes a regression where no prefix host was sent at all.

git-svn-id: file:///srv/svn/repo/suika/trunk@686 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-15 16:45:23 +00:00
delthas
14e0806745 Add support for draft/extended-monitor
References: https://github.com/ircv3/ircv3-specifications/pull/466

git-svn-id: file:///srv/svn/repo/suika/trunk@685 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-15 13:38:19 +00:00
contact
5bb767bf62 Add support for MONITOR
Add support for MONITOR in single-upstream mode.

Each downstream has its own set of monitored targets. These sets
are merged together to compute the MONITOR commands to send to
upstream.

Each upstream has a set of monitored targets accepted by the server
alongside with their status (online/offline). This is used to
directly send replies to downstreams adding a target another
downstream has already added, and send MONITOR S[TATUS] replies.

Co-authored-by: delthas <delthas@dille.cc>

git-svn-id: file:///srv/svn/repo/suika/trunk@684 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-15 13:34:04 +00:00
contact
c4562a004e Add ELIST support in single-upstream mode
We just forward the command as-is, so we can pass down the ISUPPORT
token as well.

Closes: https://todo.sr.ht/~emersion/soju/148

git-svn-id: file:///srv/svn/repo/suika/trunk@683 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-09 21:12:46 +00:00
contact
54c906a82c Add a queue for WHO commands
This has the following upsides:

- We can now routes WHO replies to the correct client, without
  broadcasting them to everybody.
- We are less likely to hit server rate limits when multiple downstreams
  are issuing WHO commands at the same time.

git-svn-id: file:///srv/svn/repo/suika/trunk@682 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-09 21:09:17 +00:00
contact
c652cb0188 Remove support for mixed multi-upstream LIST
Multi-upstream connections can still send LIST commands with a
network suffix.

git-svn-id: file:///srv/svn/repo/suika/trunk@681 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-09 20:32:26 +00:00
contact
86ddd39b77 Add context support to Server.createUser
git-svn-id: file:///srv/svn/repo/suika/trunk@680 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 19:29:14 +00:00
contact
a6d7a40af8 Add partial context support to handleUserUpdate
More plumbing needed to make sure we don't block too long waiting
for the reply.

git-svn-id: file:///srv/svn/repo/suika/trunk@679 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 18:48:32 +00:00
contact
6e0be5f3d9 Check context cancellation in handleServiceServerNotice
This prevents this function from blocking forever if it exceeds the
deadline.

git-svn-id: file:///srv/svn/repo/suika/trunk@678 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 18:42:36 +00:00
contact
a3ca35f09e Add context support to service
References: https://todo.sr.ht/~emersion/soju/141

git-svn-id: file:///srv/svn/repo/suika/trunk@677 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 18:40:48 +00:00
contact
31f86a9f9d Add context support to user and network mutations
References: https://todo.sr.ht/~emersion/soju/141

git-svn-id: file:///srv/svn/repo/suika/trunk@676 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 18:36:10 +00:00
contact
e3bb551273 Plumb context in downstreamConn.handleMessageRegistered
References: https://todo.sr.ht/~emersion/soju/141

git-svn-id: file:///srv/svn/repo/suika/trunk@675 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-08 17:11:24 +00:00
contact
2caeb0f764 Fix upstream USER command when both username and nick are empty
git-svn-id: file:///srv/svn/repo/suika/trunk@674 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-07 17:33:59 +00:00
hubert
f4842d052b Skip list/type A mode arguments
Type-A modes always have an argument[0], but soju doesn't care about
them since it doesn't keep track of mode lists (ban/invite/.. lists).

[0] https://modern.ircdocs.horse/#mode-message
> Type A: Modes that add or remove an address to or from a list. These
> modes MUST always have a parameter when sent from the server to a
> client.

git-svn-id: file:///srv/svn/repo/suika/trunk@673 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-04 11:24:15 +00:00
contact
52d2b1ed2a Add plus sign in RPL_UMODEIS reply
git-svn-id: file:///srv/svn/repo/suika/trunk@672 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 21:02:19 +00:00
contact
53c9b0049b Set mode +o on admins for bouncer-only connections
git-svn-id: file:///srv/svn/repo/suika/trunk@671 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 20:42:42 +00:00
contact
9d67b78657 Turn CHATHISTORY and backlog limits into constants
git-svn-id: file:///srv/svn/repo/suika/trunk@670 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:29:21 +00:00
contact
34689ca82d msgstore_memory: add comment about Append dropping messages
git-svn-id: file:///srv/svn/repo/suika/trunk@669 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:25:39 +00:00
contact
9d44ab9586 msgstore_fs: abort on timeout
git-svn-id: file:///srv/svn/repo/suika/trunk@668 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:21:12 +00:00
contact
58db345425 msgstore: add context to messageStore methods
This allows setting a hard timeout.

git-svn-id: file:///srv/svn/repo/suika/trunk@667 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 17:21:05 +00:00
contact
21f482684d msgstore: take Network as arg instead of network
The message stores don't need to access the internal network
struct, they just need network metadata such as ID and name.

This can ease moving message stores into a separate package in the
future.

git-svn-id: file:///srv/svn/repo/suika/trunk@666 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 15:37:01 +00:00
delthas
9cefc64749 Add support for draft/event-playback
git-svn-id: file:///srv/svn/repo/suika/trunk@665 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-03 14:17:16 +00:00
contact
70a12fc286 Make Network.Nick optional
Make Network.Nick optional, default to the user's username. This
will allow adding a global setting to set the nickname in the
future, just like we have for the real name.

References: https://todo.sr.ht/~emersion/soju/110

git-svn-id: file:///srv/svn/repo/suika/trunk@664 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-02 22:33:17 +00:00
contact
2e071c0be7 db_sqlite: use TEXT instead of VARCHAR
VARCHAR(n) is pointless in SQLite and is the same as TEXT. Don't
bother with a migration since they're equivalent.

Also remove some unnecessary DEFAULT NULL statements.

git-svn-id: file:///srv/svn/repo/suika/trunk@663 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-02 21:58:50 +00:00
contact
427638fa0d Add title config option
Closes: https://todo.sr.ht/~emersion/soju/146

git-svn-id: file:///srv/svn/repo/suika/trunk@662 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-02 21:38:07 +00:00
contact
622e22593c Mark bouncer users and BouncerServ as authenticated in WHOX/WHOIS
git-svn-id: file:///srv/svn/repo/suika/trunk@661 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-02 17:32:39 +00:00
contact
c5665ceb4a Add support for WHOX
This adds support for WHOX, without bothering about flags and mask2
because Solanum and Ergo [1] don't support it either.

The motivation is to allow clients to reliably query account names.

It's not possible to use WHOX tokens to route replies to the right
client, because RPL_ENDOFWHO doesn't contain it.

[1]: https://github.com/ergochat/ergo/pull/1184

Closes: https://todo.sr.ht/~emersion/soju/135

git-svn-id: file:///srv/svn/repo/suika/trunk@660 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-02 17:25:43 +00:00
contact
956263f0f3 Fix operator flag in RPL_WHOREPLY
@ and + indicate channel privileges. * indicates that the user is
a server operator.

git-svn-id: file:///srv/svn/repo/suika/trunk@659 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-01 17:36:21 +00:00
contact
0b3d82d359 Mark admins as server operators in self WHO/WHOIS replies
git-svn-id: file:///srv/svn/repo/suika/trunk@658 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-01 17:32:01 +00:00
contact
a80cf22771 Mark BouncerServ as server operator
That's what some widely used IRC servers do for their own services
(e.g. NickServ and ChanServ). This adds an additional level of
trust to make sure BouncerServ isn't typo'ed or impersonated.

git-svn-id: file:///srv/svn/repo/suika/trunk@657 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-11-01 17:28:19 +00:00
contact
3169170b8e Fix missing imports in server.go
Oops.

git-svn-id: file:///srv/svn/repo/suika/trunk@656 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-29 14:18:34 +00:00
contact
ba0f309c71 Get rid of io.EOF errors in logs
Closes: https://todo.sr.ht/~emersion/soju/150

git-svn-id: file:///srv/svn/repo/suika/trunk@655 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-29 14:03:04 +00:00
contact
8094bb5252 Unify BOUNCER ADDNETWORK and CHANGENETWORK
git-svn-id: file:///srv/svn/repo/suika/trunk@654 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-29 13:51:13 +00:00
contact
897ad293e6 Always reply ERR_SASLABORTED on SASL abort
Some clients (Hexchat) always expect AUTHENTICATE * to succeed with
ERR_SASLABORTED even if SASL hasn't been started.

git-svn-id: file:///srv/svn/repo/suika/trunk@653 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-28 09:29:34 +00:00
contact
2748715183 Add context args to Database interface
This is a mecanical change, which just lifts up the context.TODO()
calls from inside the DB implementations to the callers.

Future work involves properly wiring up the contexts when it makes
sense.

git-svn-id: file:///srv/svn/repo/suika/trunk@652 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-18 17:15:15 +00:00
contact
9455e04afb Remove unnecessary downstream cap checks
downstreamConn.SendMessage already performs this cap checking.

git-svn-id: file:///srv/svn/repo/suika/trunk@651 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-18 07:20:11 +00:00
contact
2a475dc7fa Remove incorrect AWAY TODO in downstreamConn.SendMessage
PRIVMSG/NOTICE get RPL_AWAY, not AWAY.

git-svn-id: file:///srv/svn/repo/suika/trunk@650 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-18 07:08:52 +00:00
contact
7ed749a0c2 Unify away-notify and account-notify handling
git-svn-id: file:///srv/svn/repo/suika/trunk@649 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-17 19:54:18 +00:00
contact
cbf11ae498 Add support for account-notify
git-svn-id: file:///srv/svn/repo/suika/trunk@648 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-17 19:54:18 +00:00
contact
d98ecb5722 Remove unused REGISTRATION_IS_COMPLETED in handleMessageUnregistered
downstreamConn.handleMessageUnregistered is only called when the
user isn't registered.

git-svn-id: file:///srv/svn/repo/suika/trunk@647 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-16 09:42:32 +00:00
contact
02449246d7 Send BOUNCER REGISTRATION_IS_COMPLETED error
git-svn-id: file:///srv/svn/repo/suika/trunk@646 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-16 09:41:37 +00:00
hubert
753f1704e5 Set hard timeouts on DB transactions
git-svn-id: file:///srv/svn/repo/suika/trunk@645 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-15 20:39:14 +00:00
contact
abc45dc323 msgstore_fs: rename log dir when network is renamed
git-svn-id: file:///srv/svn/repo/suika/trunk@644 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-15 16:11:04 +00:00
contact
b3c38a5719 ci: switch to alpine/latest
We don't need the bleeding edge.

git-svn-id: file:///srv/svn/repo/suika/trunk@643 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-15 07:59:53 +00:00
contact
3b153471b8 msgstore_fs: add reference to ZNC
git-svn-id: file:///srv/svn/repo/suika/trunk@642 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-14 18:51:03 +00:00
yyp
e54608a2cc downstream: handle name=... in BOUNCER
git-svn-id: file:///srv/svn/repo/suika/trunk@641 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-14 14:03:14 +00:00
contact
58dc869a21 db_postgres: remove unnecessary DEFAULT NULL in schema
git-svn-id: file:///srv/svn/repo/suika/trunk@640 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-14 08:09:01 +00:00
contact
1c5ea5026a db_postgres: use tx for all queries in StoreClientDeliveryReceipts
git-svn-id: file:///srv/svn/repo/suika/trunk@639 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 17:15:50 +00:00
contact
090e469fd2 db_postgres: quote table name in StoreClientDeliveryReceipts
git-svn-id: file:///srv/svn/repo/suika/trunk@638 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 15:38:20 +00:00