390 Commits

Author SHA1 Message Date
contact
01ab1f06b8 Handle upstream ERROR messages
git-svn-id: file:///srv/svn/repo/suika/trunk@390 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-13 13:31:07 +00:00
contact
5bcf511d5c Handle ERR_NOPERMFORHOST and ERR_YOUREBANNEDCREEP
git-svn-id: file:///srv/svn/repo/suika/trunk@389 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-13 13:31:03 +00:00
contact
fd15fd5482 Add missing ident.go
Forgot to check in this file.

Fixes: 65302d3c1e8e ("Add an ident server")

git-svn-id: file:///srv/svn/repo/suika/trunk@388 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-13 10:58:29 +00:00
contact
c7e29a966a Extract history loading into functions
These will get re-used for sending history to clients that don't support
the chathistory extension.

git-svn-id: file:///srv/svn/repo/suika/trunk@387 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 13:58:50 +00:00
contact
4b7854b268 doc: add ident server to man page
git-svn-id: file:///srv/svn/repo/suika/trunk@386 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 09:03:20 +00:00
contact
d4a0c5bd48 Add an ident server
Closes: https://todo.sr.ht/~emersion/soju/69

git-svn-id: file:///srv/svn/repo/suika/trunk@385 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:59:06 +00:00
contact
7fce9bcc76 Add conn.{Local,Remote}Addr
git-svn-id: file:///srv/svn/repo/suika/trunk@384 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:35:05 +00:00
contact
9880c34024 Add ircConn.LocalAddr
git-svn-id: file:///srv/svn/repo/suika/trunk@383 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:34:38 +00:00
contact
aa04c4bf88 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@382 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:26:42 +00:00
contact
f1aa33eb16 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@381 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:24:54 +00:00
contact
d000ec491a 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

git-svn-id: file:///srv/svn/repo/suika/trunk@380 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-11 08:21:49 +00:00
contact
d6696ca80c Add user delete command
References: https://todo.sr.ht/~emersion/soju/17

git-svn-id: file:///srv/svn/repo/suika/trunk@379 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-10 13:04:01 +00:00
contact
0dddc73278 Remove user from Server map when stopped
git-svn-id: file:///srv/svn/repo/suika/trunk@378 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-10 13:03:38 +00:00
contact
25dc76452b Make user.stop block
This allows callers to wait until the user has been stopped.

git-svn-id: file:///srv/svn/repo/suika/trunk@377 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-10 13:03:38 +00:00
contact
1869b37956 Add user.stop
git-svn-id: file:///srv/svn/repo/suika/trunk@376 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-10 13:03:38 +00:00
contact
676ffcc0b3 Add DB.DeleteUser
git-svn-id: file:///srv/svn/repo/suika/trunk@375 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-03 16:43:39 +00:00
hubert
6293d8dfe9 Fix help message for BouncerServ's network update
It was missing the network name as first argument.

git-svn-id: file:///srv/svn/repo/suika/trunk@374 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-03 09:03:39 +00:00
contact
a991600fc8 readme: update mailing list link
git-svn-id: file:///srv/svn/repo/suika/trunk@373 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-24 07:49:54 +00:00
admin
58f185b9a2 doc: fix typo in man page
git-svn-id: file:///srv/svn/repo/suika/trunk@372 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-23 21:31:37 +00:00
contact
d2f7a0ec1b 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@371 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 16:07:55 +00:00
contact
1e0e265c48 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@370 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 15:03:01 +00:00
contact
2ebc03a712 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@369 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 13:44:19 +00:00
contact
06cc81a33e doc: add example config file in man page
git-svn-id: file:///srv/svn/repo/suika/trunk@368 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 13:43:22 +00:00
contact
5769fa7867 readme: mention the znc-import tool
git-svn-id: file:///srv/svn/repo/suika/trunk@367 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 11:36:19 +00:00
nomeji
12843259a4 readme: expand usage
git-svn-id: file:///srv/svn/repo/suika/trunk@366 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 11:06:03 +00:00
contact
8dddba2c84 doc: mention SASL EXTERNAL in the CertFP docs
git-svn-id: file:///srv/svn/repo/suika/trunk@365 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 10:51:32 +00:00
contact
e0210a0ced Rename certfp reset to sasl reset
And make it reset all SASL credentials.

git-svn-id: file:///srv/svn/repo/suika/trunk@364 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 10:20:52 +00:00
contact
869942603b Add a sasl set-plain command
This allows to manually set the SASL credentials for a network.

git-svn-id: file:///srv/svn/repo/suika/trunk@363 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 10:16:13 +00:00
contact
9e9565daf0 go fmt
git-svn-id: file:///srv/svn/repo/suika/trunk@362 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 10:16:01 +00:00
contact
3c2981df11 doc: document the network update command
git-svn-id: file:///srv/svn/repo/suika/trunk@361 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-22 10:04:26 +00:00
contact
803dbabd4f Implement CHATHISTORY AFTER
References: https://todo.sr.ht/~emersion/soju/12

git-svn-id: file:///srv/svn/repo/suika/trunk@360 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-15 15:47:57 +00:00
contact
b97cd39cd3 Prevent error handler from falling through in user.run
git-svn-id: file:///srv/svn/repo/suika/trunk@359 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-09 12:20:23 +00:00
contact
c00ddb8ec3 Add unix as supported upstream URL scheme to service
git-svn-id: file:///srv/svn/repo/suika/trunk@358 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-09 10:19:51 +00:00
contact
542445e391 contrib/znc-import: new utility
Allows populating the soju database from a ZNC config file.

git-svn-id: file:///srv/svn/repo/suika/trunk@357 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-09 09:25:25 +00:00
contact
1bceed3bdb Fix deadlock in DB.Close
This method was calling itself, instead of the underlying SQLite
database's Close method.

git-svn-id: file:///srv/svn/repo/suika/trunk@356 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-09 09:23:51 +00:00
contact
dddac6e178 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@355 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-08 16:21:52 +00:00
contact
6ba63d0774 Strip network name from nickname when auto-saving network
git-svn-id: file:///srv/svn/repo/suika/trunk@354 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 16:13:40 +00:00
contact
e55e59080e Add support for upstream Unix socket connections
References: https://todo.sr.ht/~emersion/soju/51

git-svn-id: file:///srv/svn/repo/suika/trunk@353 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 15:31:11 +00:00
contact
e4b56520f9 Parse upstream URLs with net/url
This allows us to ignore the path part of the URL. This is preliminary
work for unix URLs.

git-svn-id: file:///srv/svn/repo/suika/trunk@352 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 15:18:13 +00:00
contact
04309085c4 Check upstream address with net.SplitHostPort
Looking for a colon is incorrect, IPv6 addresses can contain colons too.

git-svn-id: file:///srv/svn/repo/suika/trunk@351 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 14:04:56 +00:00
contact
1a16d0b47a 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.

git-svn-id: file:///srv/svn/repo/suika/trunk@350 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 09:06:20 +00:00
contact
0a87ae1452 Make length check clearer in sendNames
git-svn-id: file:///srv/svn/repo/suika/trunk@349 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-06 08:59:34 +00:00
contact
3367f4ebd8 Accept "irc" WebSocket subprotocol
git-svn-id: file:///srv/svn/repo/suika/trunk@348 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-02 09:05:49 +00:00
contact
51df0c157e Add RemoteAddr to ircConn interface
git-svn-id: file:///srv/svn/repo/suika/trunk@347 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-07-01 15:02:37 +00:00
hubert
3f1ece2d19 Send compact channel name lists
This commit resolves `sendNames`' TODO.

git-svn-id: file:///srv/svn/repo/suika/trunk@346 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-30 08:28:05 +00:00
contact
e9f9453cba Only read X-Forwarded-* if remote address is loopback
git-svn-id: file:///srv/svn/repo/suika/trunk@345 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-29 16:33:23 +00:00
contact
d97de5552f Extract X-Forwarded-* headers for WebSocket connections
git-svn-id: file:///srv/svn/repo/suika/trunk@344 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-29 16:27:43 +00:00
contact
35c7c0df7f Reply to WHO BouncerServ
Closes: https://todo.sr.ht/~emersion/soju/75

git-svn-id: file:///srv/svn/repo/suika/trunk@343 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-29 16:09:48 +00:00
contact
929f7b48c6 Handle registration failures
References: https://todo.sr.ht/~emersion/soju/30

git-svn-id: file:///srv/svn/repo/suika/trunk@342 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-29 15:52:49 +00:00
contact
8bf8de560b Return io.EOF on websocket connection closure
git-svn-id: file:///srv/svn/repo/suika/trunk@341 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-29 08:24:41 +00:00