645 Commits

Author SHA1 Message Date
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
contact
a4e6f3496b Don't strip spaces at start of MOTD
This breaks ASCII art. Instead, just drop the final newline if any.

git-svn-id: file:///srv/svn/repo/suika/trunk@637 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 10:53:43 +00:00
contact
afd52fc4c3 Add bouncer MOTD
Closes: https://todo.sr.ht/~emersion/soju/137

git-svn-id: file:///srv/svn/repo/suika/trunk@636 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 08:58:34 +00:00
contact
75cc0231be db_postgres: fix constraints errors
Stop using ON CONFLICT DO UPDATE.

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

git-svn-id: file:///srv/svn/repo/suika/trunk@635 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 08:12:14 +00:00
hubert
3a20033cc7 db_postgres: handle both constraints on network updates
Closes: https://todo.sr.ht/~emersion/soju/138

git-svn-id: file:///srv/svn/repo/suika/trunk@634 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-13 06:53:49 +00:00
contact
dcba21c7e5 contrib/clients: update IRCv3 caps for Weechat 3.3
git-svn-id: file:///srv/svn/repo/suika/trunk@633 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 19:49:06 +00:00
contact
66229dd5e8 doc.soju.1: fix typo and improve formatting for "certfp generate"
git-svn-id: file:///srv/svn/repo/suika/trunk@632 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 19:34:25 +00:00
contact
7cce9c4a31 doc/soju.1: add descriptions for all flags for "user create"
git-svn-id: file:///srv/svn/repo/suika/trunk@631 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 19:31:12 +00:00
contact
18b7972e80 doc/soju.1: use angle-brackets for URL
Helps a bit terminal emulators to recognize the link.

git-svn-id: file:///srv/svn/repo/suika/trunk@630 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 19:27:48 +00:00
contact
9d5456fb96 Stop sending RPL_CREATED
There's no point in sending this numeric if it doesn't contain any
useful info.

git-svn-id: file:///srv/svn/repo/suika/trunk@629 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 17:28:44 +00:00
contact
75c7442d34 msgstore_fs: fix ListTargets error on missing log dir
Initially, before connecting to the network, the log dir will be
empty. Return an empty list of chat history targets in this case.

git-svn-id: file:///srv/svn/repo/suika/trunk@628 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 15:36:00 +00:00
contact
627f9f74a7 Fix printf formatting in error message
git-svn-id: file:///srv/svn/repo/suika/trunk@627 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 15:36:00 +00:00
contact
bf890cb13a Upgrade dependencies
git-svn-id: file:///srv/svn/repo/suika/trunk@626 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 14:54:51 +00:00
contact
c0502705d1 service: allow updating other users
git-svn-id: file:///srv/svn/repo/suika/trunk@625 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-12 07:11:14 +00:00
contact
2de938c585 ci: run PostgreSQL tests
git-svn-id: file:///srv/svn/repo/suika/trunk@624 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 14:06:37 +00:00
contact
c5006e45a7 Fix unused imports in tests
git-svn-id: file:///srv/svn/repo/suika/trunk@623 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 14:01:50 +00:00
contact
76d67ceb78 Run server test with PostgreSQL too
git-svn-id: file:///srv/svn/repo/suika/trunk@622 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 13:57:37 +00:00
contact
d7c72036a1 db_postgres: add migration test
git-svn-id: file:///srv/svn/repo/suika/trunk@621 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 13:55:07 +00:00
hubert
bbe15df672 PostgreSQL support
git-svn-id: file:///srv/svn/repo/suika/trunk@620 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 13:21:04 +00:00
contact
7e56d2149b db_sqlite: add migration test
git-svn-id: file:///srv/svn/repo/suika/trunk@619 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-11 10:26:51 +00:00
hubert
75c35762b2 Correctly send back PRIVMSGs and NOTICEs to self
git-svn-id: file:///srv/svn/repo/suika/trunk@618 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:41 +00:00
hubert
51c6ddf269 Send back TAGMSGs to self
git-svn-id: file:///srv/svn/repo/suika/trunk@617 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:41 +00:00
hubert
83f092720a Dismiss TAGMSGs directed to BouncerServ
git-svn-id: file:///srv/svn/repo/suika/trunk@616 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-10 10:05:40 +00:00
contact
1004b91f55 Add "server notice" command
git-svn-id: file:///srv/svn/repo/suika/trunk@615 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-08 08:52:03 +00:00
contact
f2fddf331e Split CertFP logic into separate file
git-svn-id: file:///srv/svn/repo/suika/trunk@614 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-08 07:47:25 +00:00
contact
2c0f43286d build: don't clobber config file
Use `test -f` instead of `cp -n`, because the former is POSIX.

References: https://github.com/emersion/soju/pull/32

git-svn-id: file:///srv/svn/repo/suika/trunk@613 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-08 07:11:31 +00:00
contact
8dda53c683 Add max-user-networks config option
git-svn-id: file:///srv/svn/repo/suika/trunk@612 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-07 18:43:10 +00:00
contact
3547bb7749 doc/soju.1: mention that accept-proxy-ip affects PROXY proto
git-svn-id: file:///srv/svn/repo/suika/trunk@611 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-07 18:04:20 +00:00
alex
700f5d91c6 chathistory: Fix truncated backlog due to timezones
Because msgstore_fs writes logs in localtime, the CHATHISTORY timestamps
(UTC) must be converted to localtime prior to filtering ranges ensure
the right range is sent back to the client.

Prior to this patch, the iteration back from the BEFORE time failed to
load the hours between midnight UTC and midnight localtime in each day's
logged messages. This is because the final time to be considered in a
day's log file (the "start" time) reuses the previous start time's
locale:

    start = time.Date(year, month, day, 0, 0, 0, 0, start.Location()).Add(-1)

By converting the original start and end from the CHATHISTORY commands
to localtime in Load*Time and ListTargets, we ensure we read through
midnight each day.

git-svn-id: file:///srv/svn/repo/suika/trunk@610 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-07 09:57:42 +00:00
contact
c8179c1537 Add WHOIS reply for BouncerServ
git-svn-id: file:///srv/svn/repo/suika/trunk@609 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-06 09:50:12 +00:00
contact
3a0dc00117 msgstore_fs: add limit on number of opened files
git-svn-id: file:///srv/svn/repo/suika/trunk@608 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-06 09:41:39 +00:00
contact
97110c193a Add DB stats
git-svn-id: file:///srv/svn/repo/suika/trunk@607 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 17:31:06 +00:00
contact
48dab8d280 Add limit for RSA bits
git-svn-id: file:///srv/svn/repo/suika/trunk@606 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 17:21:43 +00:00
contact
ae7aef71b3 Add "server status" command
Right now, it prints the number of active users and number of
downstream connections.

git-svn-id: file:///srv/svn/repo/suika/trunk@605 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 17:13:53 +00:00
contact
40fbc3d61d test: get rid of testUpstream
No need for this complexity.

git-svn-id: file:///srv/svn/repo/suika/trunk@604 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 12:26:10 +00:00
contact
fbabe10b66 test: add NOTICE broadcast
git-svn-id: file:///srv/svn/repo/suika/trunk@603 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 12:14:31 +00:00
contact
44f7e07b44 test: add upstream
git-svn-id: file:///srv/svn/repo/suika/trunk@602 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 12:03:17 +00:00
contact
f5c683daec Use isErrClosed in Server.Serve
git-svn-id: file:///srv/svn/repo/suika/trunk@601 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 12:02:59 +00:00
contact
a62892d469 Add basic server test
git-svn-id: file:///srv/svn/repo/suika/trunk@600 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 10:11:40 +00:00
contact
15036cef1e Close DB on shutdown
git-svn-id: file:///srv/svn/repo/suika/trunk@599 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 09:53:38 +00:00
contact
3131c1ef6e db_sqlite: fix realname not fetched in ListUsers
This fixes per-user realname not being used on bouncer startup.

git-svn-id: file:///srv/svn/repo/suika/trunk@598 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-10-05 09:10:48 +00:00
contact
caa77db7cd Add support for IRCv3 WebSocket text subprotocol
Technically we aren't spec-compliant since we don't serve
binary.ircv3.net. Any complaints will be redirected to /dev/null.

git-svn-id: file:///srv/svn/repo/suika/trunk@597 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-28 19:25:06 +00:00
contact
1dfd2238c0 db_sqlite: switch to sql.Named
This allows us to avoid mixing up arguments.

git-svn-id: file:///srv/svn/repo/suika/trunk@596 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2021-09-27 14:54:06 +00:00