Commit Graph

636 Commits

Author SHA1 Message Date
Simon Ser
c511a3c895
Add network.upstream helper 2020-03-21 10:24:38 +01:00
Simon Ser
4b9168196a
Fix typo 2020-03-21 08:44:03 +01:00
Simon Ser
ec98c6f04f
Fix empty SASL challenge message
We were sending an empty string. We need to send "+" instead.
2020-03-21 08:41:14 +01:00
Simon Ser
cb52f393f4
Drop messages on closed connections
This prevents this panic:

    panic: send on closed channel
    goroutine 9 [running]:
    git.sr.ht/~emersion/soju.(*upstreamConn).SendMessage(...)
            /home/simon/src/soju/upstream.go:866
    git.sr.ht/~emersion/soju.(*upstreamConn).handleMessage(0xc000084b40, 0xc000144680, 0x2, 0x0)
            /home/simon/src/soju/upstream.go:152 +0x62b
    git.sr.ht/~emersion/soju.(*user).run(0xc0000b8070)
            /home/simon/src/soju/user.go:144 +0x53d
    created by git.sr.ht/~emersion/soju.(*Server).Run
            /home/simon/src/soju/server.go:88 +0x286
2020-03-21 08:29:44 +01:00
Simon Ser
7114c8a1e9
Avoid sending JOIN twice for the same channel 2020-03-20 22:53:05 +01:00
Simon Ser
45d118dd12
Move upstreamConn.history to network 2020-03-20 22:48:17 +01:00
Simon Ser
7714c84669
Fix deadlocks in single-upstream mode 2020-03-20 10:42:17 +01:00
delthas
aedf66c73d Fix MODE downstream support
- Fix replies without client as first argument
- Replace wrong prefix check with a proper entity type check
2020-03-20 10:11:27 +01:00
delthas
b3ad960529 Add WHOIS support 2020-03-20 10:11:27 +01:00
delthas
54275c25ac Add WHO support 2020-03-20 00:29:03 +01:00
Simon Ser
549fbf62b1
Add basic Makefile 2020-03-19 15:11:43 +01: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
7dc2d4d9b1
Fix history name
dc.username contains the raw account username, not the username supplied
by the client.
2020-03-19 14:44:49 +01:00
Simon Ser
75cbc57555
readme: add ref to man page, add link to GitHub repo 2020-03-19 14:33:49 +01:00
Simon Ser
55651ede9d
man: fix typo 2020-03-19 14:18:31 +01:00
Simon Ser
80f8d71064
man: add basic man page 2020-03-19 14:16:39 +01:00
delthas
37eb162b75 Add create-network bouncer service command 2020-03-19 01:14:44 +01:00
delthas
37e56a01b2 Add suffixing for multi-upstream connections 2020-03-19 00:06:48 +01:00
delthas
1c41576988 schema: add Network.name 2020-03-19 00:06:48 +01:00
Simon Ser
e3d97bb164
Add basic infrastructure for bouncer service 2020-03-18 12:23:08 +01:00
Simon Ser
8274ff17c1
ci: add builds.sr.ht manifest 2020-03-18 10:28:58 +01:00
delthas
c82438625e Add upstream INVITE support 2020-03-18 10:26:25 +01:00
Simon Ser
0db032d267
Fix typo 2020-03-17 16:17:39 +01:00
Simon Ser
dc26908466
Fix echo PRIVMSG messages 2020-03-17 16:15:54 +01:00
Simon Ser
651e936913
Add downstream SASL support 2020-03-16 16:16:27 +01:00
Simon Ser
9b777922ae
Allow CAP command when registered 2020-03-16 15:12:46 +01:00
Simon Ser
bdfb8634e9
Log downstream messages before registration 2020-03-16 15:10:16 +01:00
Simon Ser
1241bf82aa
Protect upstreamConn.history with a lock 2020-03-16 15:08:56 +01:00
Simon Ser
af76c3868a
Add CAP support for downstream connections 2020-03-16 15:05:24 +01:00
Simon Ser
87684f7eab
Don't reply to PING when client is unregistered 2020-03-16 14:32:38 +01:00
Simon Ser
b1b519d4f9
Make downstreamConn.runUntilegistered exit with an error on EOF 2020-03-16 14:30:49 +01:00
Simon Ser
75e698f671
Echo downstream PRIVMSGs to other downstream connections 2020-03-16 14:28:45 +01:00
Simon Ser
d5db7c988f
Rename consumption to ringMessage 2020-03-16 14:05:48 +01:00
Simon Ser
3919ee2036
Per-user dispatcher goroutine
This allows message handlers to read upstream/downstream connection
information without causing any race condition.

References: https://todo.sr.ht/~emersion/soju/1
2020-03-16 12:44:59 +01:00
Simon Ser
cdab0dc825
Rename messages channels to outgoing 2020-03-16 11:26:54 +01:00
Simon Ser
7fe0986859
Split user logic into its own file 2020-03-16 11:18:41 +01:00
Simon Ser
88877f3c5a
Strip client & network name from username 2020-03-16 09:32:18 +01:00
Simon Ser
3dbc205beb
Add sojuctl to .gitignore 2020-03-13 18:14:14 +01:00
Simon Ser
f3940117d1
Rename project to soju 2020-03-13 18:13:03 +01:00
Simon Ser
2239b94399
Forward NOTICE messages coming from upstream connections 2020-03-13 16:39:49 +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
dad8bc2173
schema: add Channel.key 2020-03-13 12:30:01 +01:00
Simon Ser
fee8fc79c6
Add support for upstream PASS command 2020-03-13 12:06:02 +01:00
Simon Ser
e39948cdbd
Add upstream CAP LS support 2020-03-13 11:26:43 +01:00
Simon Ser
85f28daf2d
Auto-save IRC networks 2020-03-12 21:28:09 +01:00
Simon Ser
0ef08dfbb5
Store NICK changes in the DB 2020-03-12 19:17:06 +01:00
Simon Ser
0c4e9b539c
Update DB on JOIN and PART 2020-03-12 18:33:03 +01:00
Simon Ser
461de13ecc
Fix nil dereference when network is specified in username 2020-03-12 18:21:41 +01:00
Simon Ser
2dfbbf18fd
schema: add UNIQUE constraints 2020-03-12 15:33:49 +01:00