Commit Graph

634 Commits

Author SHA1 Message Date
Simon Ser
6faa081a7c
Add conn.{Local,Remote}Addr 2020-08-11 10:35:05 +02:00
Simon Ser
20c26d113c
Add ircConn.LocalAddr 2020-08-11 10:34:38 +02:00
Simon Ser
0812c795f4
Add User.ID
For now it's just a new field that'll be useful to generate user ident
strings. It uses the SQLite implicit rowid column. In the future the DB
interface will need to be updated to use user IDs instead of usernames.
2020-08-11 10:26:42 +02:00
Simon Ser
7c31c26d86
Don't perform TLS handshake in connectToUpstream
This defers TLS handshake until the first read or write operation. This
allows the upcoming identd server to register the connection before the
TLS handshake is complete, and is necessary because some IRC servers
send an ident request before that.
2020-08-11 10:24:54 +02:00
Simon Ser
c1f8002428
cmd/sojuctl: read user from DB before updating it
This makes sure we don't overwrite other fields, such as Admin.

Closes: https://todo.sr.ht/~emersion/soju/85
2020-08-11 10:21:49 +02:00
Simon Ser
ccc8768435
Add user delete command
References: https://todo.sr.ht/~emersion/soju/17
2020-08-10 15:04:01 +02:00
Simon Ser
6598fcf36e
Remove user from Server map when stopped 2020-08-10 15:03:38 +02:00
Simon Ser
6baa15ba14
Make user.stop block
This allows callers to wait until the user has been stopped.
2020-08-10 15:03:38 +02:00
Simon Ser
ef01142a44
Add user.stop 2020-08-10 15:03:38 +02:00
Simon Ser
b71fcc2e00
Add DB.DeleteUser 2020-08-03 18:43:39 +02:00
Hubert Hirtz
5e2910ba9d
Fix help message for BouncerServ's network update
It was missing the network name as first argument.
2020-08-03 11:03:39 +02:00
Simon Ser
73f9a6e455
readme: update mailing list link 2020-07-24 09:49:54 +02:00
Thorben Günther
0ff4ac07fe
doc: fix typo in man page 2020-07-23 23:31:37 +02:00
Simon Ser
2793698dbb
config: make http-origin directive overwrite previous list
Let's be on the safe side and assume the user doesn't meant the union of
all directive values.
2020-07-22 18:07:55 +02:00
Simon Ser
ef2dd479bf
Add accept-proxy-ip config directive
This allows to set the list of IPs allowed to act as a proxy. This is
only used for WebSockets right now, but will be expanded to TCP as well
once the PROXY protocol is supported.
2020-07-22 17:03:01 +02:00
Simon Ser
b0bf012bbc
Change unix:// to irc+unix://
When Unix socket support will be added for listeners, unix:// will be
ambiguous. It won't be clear whether to setup an IRC server, or some
other kind of server (e.g. identd).

unix:// is still recognized to avoid breaking existing DBs.
2020-07-22 15:44:19 +02:00
Simon Ser
d3661705dc
doc: add example config file in man page 2020-07-22 15:43:22 +02:00
Simon Ser
ec7c78050a
readme: mention the znc-import tool 2020-07-22 13:36:19 +02:00
Nomeji
9d27f393dc readme: expand usage 2020-07-22 13:06:03 +02:00
Simon Ser
c616a17041
doc: mention SASL EXTERNAL in the CertFP docs 2020-07-22 12:51:32 +02:00
Simon Ser
cc01ffc19d
Rename certfp reset to sasl reset
And make it reset all SASL credentials.
2020-07-22 12:20:52 +02:00
Simon Ser
2a3ae55f52
Add a sasl set-plain command
This allows to manually set the SASL credentials for a network.
2020-07-22 12:16:13 +02:00
Simon Ser
cd3eacdbfc
go fmt 2020-07-22 12:16:01 +02:00
Simon Ser
360ce5b72d
doc: document the network update command 2020-07-22 12:04:26 +02:00
Simon Ser
dcfe206bda
Implement CHATHISTORY AFTER
References: https://todo.sr.ht/~emersion/soju/12
2020-07-15 17:47:57 +02:00
Simon Ser
25d4312e0f
Prevent error handler from falling through in user.run 2020-07-09 14:20:23 +02:00
Simon Ser
907da56311
Add unix as supported upstream URL scheme to service 2020-07-09 12:19:51 +02:00
Simon Ser
1ac895430a
contrib/znc-import: new utility
Allows populating the soju database from a ZNC config file.
2020-07-09 11:25:25 +02:00
Simon Ser
7ebe47ad4a
Fix deadlock in DB.Close
This method was calling itself, instead of the underlying SQLite
database's Close method.
2020-07-09 11:23:51 +02:00
Simon Ser
51dc9f0bf9
Broadcast unhandled messages to downstream connections
In case labelled-response isn't supported, broadcast unhandled messages
to all downstream connections. That's better than silently dropping the
messages.
2020-07-08 18:21:52 +02:00
Simon Ser
1685ba23b3
Strip network name from nickname when auto-saving network 2020-07-06 18:13:40 +02:00
Simon Ser
85fad93a71
Add support for upstream Unix socket connections
References: https://todo.sr.ht/~emersion/soju/51
2020-07-06 17:31:11 +02:00
Simon Ser
7af21d9d81
Parse upstream URLs with net/url
This allows us to ignore the path part of the URL. This is preliminary
work for unix URLs.
2020-07-06 17:18:13 +02:00
Simon Ser
b46a2554e1
Check upstream address with net.SplitHostPort
Looking for a colon is incorrect, IPv6 addresses can contain colons too.
2020-07-06 16:04:56 +02:00
Simon Ser
c490705fee
Sort and split JOIN messages
Sort channels so that channels with a key appear first. Split JOIN
messages so that we don't reach the message size limit.
2020-07-06 11:06:20 +02:00
Simon Ser
4c8b01fb51
Make length check clearer in sendNames 2020-07-06 10:59:34 +02:00
Simon Ser
82990fb774
Accept "irc" WebSocket subprotocol 2020-07-02 11:05:49 +02:00
Simon Ser
3397965dea
Add RemoteAddr to ircConn interface 2020-07-01 17:02:37 +02:00
Hubert Hirtz
dc59263681
Send compact channel name lists
This commit resolves `sendNames`' TODO.
2020-06-30 10:28:05 +02:00
Simon Ser
a9887114d5
Only read X-Forwarded-* if remote address is loopback 2020-06-29 18:33:23 +02:00
Simon Ser
2c172fa8ca
Extract X-Forwarded-* headers for WebSocket connections 2020-06-29 18:27:43 +02:00
Simon Ser
90250f5be5
Reply to WHO BouncerServ
Closes: https://todo.sr.ht/~emersion/soju/75
2020-06-29 18:09:48 +02:00
Simon Ser
d26194f62d
Handle registration failures
References: https://todo.sr.ht/~emersion/soju/30
2020-06-29 17:52:49 +02:00
Simon Ser
0fa07f5f9a
Return io.EOF on websocket connection closure 2020-06-29 10:24:41 +02:00
Hubert Hirtz
cfb1de044e
Don't save corrupted NickServ credentials
soju saved most NickServ messages[0] as credentials because of a missing
`default` clause in the check of the NickServ command.

[0] messages that had at least a command and two other parameters
2020-06-24 23:02:46 +02:00
Simon Ser
6c453aa5ca
service: list commands in lexicographic order 2020-06-24 12:08:35 +02:00
delthas
2232b3128b Fix sending messages from detached channels
Currently, a downstream receives MODE, RPL_CHANNELMODEIS and
RPL_CREATIONTIME messages from soju for detached channels. It should not
be sent any of these messages.

This adds a detach check to the handling of these messages to avoid
receiving these messages.
2020-06-12 14:43:45 +02:00
Simon Ser
ccf9cff351
readme: extend copyright notice to all contributors
soju now has multiple contributors. Even if they weren't explicitly
listed as copyright holders, they still retain copyright ownership for
their contributions. Make this clear. See [1].

[1]: https://www.linuxfoundation.org/blog/2020/01/copyright-notices-in-open-source-software-projects/
2020-06-12 14:37:43 +02:00
Simon Ser
33a69edbfe
readme: add link to website 2020-06-10 23:00:50 +02:00
Simon Ser
67f8773320
Fix missing appendServiceCommandSetHelp argument 2020-06-10 16:34:45 +02:00