soju v0.1.0 This is the first soju release. Any database created with this version of soju is guaranteed to work with future versions. The configuration file format, the CLI interface and the BouncerServ interface may be changed in future releases. Dan Shick (1): Fix store user query values Eyal Sawady (1): Join all channels with a single JOIN message Hubert Hirtz (24): Send the full user mask in RPL_LOGGEDIN Don't save corrupted NickServ credentials Send compact channel name lists Fix help message for BouncerServ's network update More explicit error message on KICK with the wrong network More explicit error message on INVITE with the wrong network Fix marshalling of channel name in RPL_CREATIONTIME Reject downstream NICK with illegal characters Forward RPL_TOPICWHOTIME to downstreams Make sure that WebSocket messages are valid UTF-8 Make DB.DeleteChannel take the channel ID Don't send TAGMSG to upstreams that don't support it Prevent downstreams from changing their nick to service's Uphold echo-message even with BouncerServ Advertise all caps, CAP DEL them on registration Improve dc.authenticate()'s error messages Don't forward batch tags Request invite-notify to upstreams if true return true else return false Send correct CHATHISTORY error messages Implement casemapping Fix CHATHISTORY target not being casemapped Make casemapping work over bytes instead of runes Drop TAGMSG in detached channels Kalyan Sriram (1): sojuctl: change-password: check if user exists Kenny Levinsen (2): docs: Fix manpage syntax service: Handle zero-value in stringPtrFlag.String Nomeji (1): readme: expand usage Simon Ser (405): Add basic IRC listener Add LICENSE and README.md Send "unknown command" replies Handle NICK and USER Add connection registration Send ERR_NOMOTD on registration Handle PING Rename conn to downstreamConn Add Server.Logger Connect to upstream servers Add basic upstream message handler Log upstream server errors Split downstram and upstream code into separate files Ignore some upstream messages Send standard user/channel modes to downstream connections Handle upstream RPL_MYINFO messages Handle MODE messages from upstream servers Handle NOTICE from upstream servers Join channels on upstream servers Split IRC helpers to separate file Add per-upstream logger Maintain a list of downstream connections Allow Server to have access to upstreamConn Remove downstream conn from list on disconnect Mark channel info as complete on RPL_ENDOFNAMES Write to downstream conn in dedicated goroutine Forward channel information De-duplicate downstream QUIT handling Keep track of upstream connections in a list Send channel info to downstream on registration Remove downstreamConn.WriteMessage Add missing bridge.go, oops Use a dedicated goroutine to write upstream messages Handle third-party JOIN and PART messages Handle channel mode changes Forward PRIVMSG messages Per-user connections Add Server.getUser Add user.forEachUpstream Add user.forEachDownstream Skip unregistered and closed upstream connections Allow changing nickname Add parseMessageParams helper Add upstreamConn.register Close connection from writer goroutine Handle downstream MODE messages Send fake RPL_CREATED message Handle downstream JOIN messages Handle downstream PART messages Add an in-memory ring buffer Add names to consumers Switch license to AGPLv3 readme: add some high-level goals, add contributing links Don't write to downstreamConn.messages directly Abbreviate {upstream,downstream}Conn with uc and dc Add downstreamConn.writeMessages Fix issues related to Ring Forward PRIVMSG coming from downstream Document Ring Add upstreamConn.SendMessage Add CLI flags for listening address and hostname Add config file Fix panic when closing downstream connection Add a -debug flag Don't leave connections half-opened Properly handle PING messages Enable TCP keep-alive on all connections Fix PING handlers, again Add functions to translate between upstream and downstream names cmd/jounce: fix non-TLS listener address Retry connecting to upstream servers Remove upstream prefix for outgoing MODE and PRIVMSG Allow clients to specify an upstream name in their username Fix TOPIC parsing, broadcast to downstream clients Remove unused user.getChannel, move getUpstream to user Rename network to upstreamName Add SQLite database readme: add instructions to initialize database go fmt readme: pipe commands into sqlite3 instead of using -init Use a RWMutex for DB Pass-through NICK messages for other users Pass-through QUIT messages cmd/jouncectl: new command Add support for PASS to downstream schema: make User.password NOT NULL schema: add UNIQUE constraints Fix nil dereference when network is specified in username Update DB on JOIN and PART Store NICK changes in the DB Auto-save IRC networks Add upstream CAP LS support Add support for upstream PASS command schema: add Channel.key Add support for SASL authentication Update dependencies Forward NOTICE messages coming from upstream connections Rename project to soju Add sojuctl to .gitignore Strip client & network name from username Split user logic into its own file Rename messages channels to outgoing Per-user dispatcher goroutine Rename consumption to ringMessage Echo downstream PRIVMSGs to other downstream connections Make downstreamConn.runUntilegistered exit with an error on EOF Don't reply to PING when client is unregistered Add CAP support for downstream connections Protect upstreamConn.history with a lock Log downstream messages before registration Allow CAP command when registered Add downstream SASL support Fix echo PRIVMSG messages Fix typo ci: add builds.sr.ht manifest Add basic infrastructure for bouncer service man: add basic man page man: fix typo readme: add ref to man page, add link to GitHub repo Fix history name Remove some IRCv3 constants Add basic Makefile Fix deadlocks in single-upstream mode Move upstreamConn.history to network Avoid sending JOIN twice for the same channel Drop messages on closed connections Fix empty SASL challenge message Fix typo Add network.upstream helper Add user.{add,remove}Downstream Add more details to ring buffer panics Move upstreamConn.ring to network Consume ring buffer for networks added on-the-fly Handle downstream JOIN/PART with multiple channel names Add support for channel keys gitignore: add soju.db and soju.1 Error out when storing unsupported SASL mechanism in DB Correctly set Channel.ID in DB.StoreChannel Make BouncerServ commands a tree Add a "network status" command Introduce a user.events channel Add eventDownstreamConnected Add eventDownstreamDisconnected Nuke user.lock Move man page to doc/ doc: add basic architecture document Get rid of Server.downstreamConns Stop accessing user data in downstreamConn.authenticate Fix race condition in upstreamConn.Close Introduce eventUpstreamDisconnected Document functions safe to call from any goroutine s/List/LIST/ when referring to the command Update password on NickServ SET PASSWORD message Add downstreamConn.clientName Remove downstreamConn.username Use clientName to decide whether or not history should be sent Fix missing upstreamConn.closed initialization Rename AppendLog to appendLog Consume ring messages outside of writer goroutine readme: advise connecting with "<username>/<network>" Make "@" and "/" indicate client name and network, respectively Expose message-tags capability downstream Avoid directly forwarding NOTICE messages Request server-time cap Add downstream support for server-time Fix log dir permission Add eventUpstreamConnected Only set network.conn when registered Auto away Set network.conn in user goroutine config: use shlex Make user.getNetwork handle Network.Name Add "network delete" service command Stop ring consumers when deleting network Simplify ring consumer goroutine Set write deadlines Set connect timeout Fix SQL error logged on JOIN doc: document "network delete" Fix writer goroutine races Introduce conn for common connection logic Add support for downstream echo-message extension Use conn.ReadMessage instead of irc.Conn.ReadMessage Log self-messages too doc: document auto-away feature Introduce messageLogger Add time tag to all messages Add NOTICE messages to ring buffer Add network.{createUpdate,delete}Channel Use Network.GetName in network status NOTICE messages Only print addr if necessary in network status service command Use Network.GetName for logs path Introduce upstreamConn.produce Remove per-network ring buffer goroutines Remove channel from ring buffer consumers Remove locks from ring buffer Remove downstreamConn.lock Remove downstreamConn.ringConsumers Remove RingConsumer.Close Simplify ring consumer loop Fix NOTICE log formatting Log TOPIC messages Remove downstreamConn.ourMessages Remove network.lock Add origin argument to upstreamConn.produce Make upstreamConn.produce log messages Fix server-time tags timezone Remove Ring.Close Make Ring.NewConsumer seq argument mandatory Remove Ring.consumers Fix upstream NICK handling Centralize logged messages marshaling Remove outdated comment Extract logic to build log filepath into a function Make newMessageLogger take a *network instead of an *upstreamConn Document downstreamConn.{,un}marshalEntity Parse timestamp from message tags in messageLogger.Append Per-entity ring buffers doc: fix SQL driver name in manpage Set up DB migration infrastructure Add support for downstream batch & chathistory Unify downstreamConn.marshal{Entity,Nick,Channel} Disallow marshalling for anotehr network Kill downstreamConn.marshal{Nick,Channel} Make downstreamConn.marshal{Entity,UserPrefix} take a network Support sending history when upstream is disconnected Fix typo doc: describe more default settings readme: fix ref to manpage doc/architecture: ring buffers are now per-channel Add network.channels, remove DB.GetChannel Abbreviate net status service reply Forward RPL_AWAY messages Check upstream NOTICE prefix is non-nil Don't use forEachDownstreamByID when forwarding RPL_AWAY Add downstream support for cap-notify Add support for away-notify Rename upstreamConn.caps to supportedCaps Add upstreamConn.caps Remove network.upstream Use a lock to protect conn.{closed,outgoing} Add upstream cap-notify support Introduce permanentUpstreamCaps Add support for detached channels Don't clear channel key on JOIN Unify upstream NOTICE and PRIVMSG handling Send service NOTICE on highlight in detached channel Improve highlight matching readme: add CI badge Add time tag to echo messages Unexport network.Stop Only send JOIN message if we have channels to join Introduce network.isClosed Close net.Conn in conn.Close Add network update command Remove setKeepAlive Introduce ircConn Remove keepAlivePeriod Allow multiple listeners, default to ircs doc: add missing change-password service command doc: update URL to sr.ht hub in man page Fail auth on empty password in DB Add support for WebSocket connections Introduce User.Created ci: check scdoc is happy Fix missing appendServiceCommandSetHelp argument readme: add link to website readme: extend copyright notice to all contributors service: list commands in lexicographic order Return io.EOF on websocket connection closure Handle registration failures Reply to WHO BouncerServ Extract X-Forwarded-* headers for WebSocket connections Only read X-Forwarded-* if remote address is loopback Add RemoteAddr to ircConn interface Accept "irc" WebSocket subprotocol Make length check clearer in sendNames Sort and split JOIN messages Check upstream address with net.SplitHostPort Parse upstream URLs with net/url Add support for upstream Unix socket connections Strip network name from nickname when auto-saving network Broadcast unhandled messages to downstream connections Fix deadlock in DB.Close contrib/znc-import: new utility Add unix as supported upstream URL scheme to service Prevent error handler from falling through in user.run Implement CHATHISTORY AFTER doc: document the network update command go fmt Add a `sasl set-plain` command Rename `certfp reset` to `sasl reset` doc: mention SASL EXTERNAL in the CertFP docs readme: mention the znc-import tool doc: add example config file in man page Change unix:// to irc+unix:// Add accept-proxy-ip config directive config: make http-origin directive overwrite previous list readme: update mailing list link Add DB.DeleteUser Add user.stop Make user.stop block Remove user from Server map when stopped Add `user delete` command cmd/sojuctl: read user from DB before updating it Don't perform TLS handshake in connectToUpstream Add User.ID Add ircConn.LocalAddr Add conn.{Local,Remote}Addr Add an ident server doc: add ident server to man page Extract history loading into functions Add missing ident.go Handle ERR_NOPERMFORHOST and ERR_YOUREBANNEDCREEP Handle upstream ERROR messages Parse NOTICE messages from logs Format CTCP ACTION messages in logs ident: remove leftover debug log Encode idents to hex instead of base64 Strip message tags in error message Escape user/network/entity characters in log file path Implement rate limiting for upstream messages Improve registration error messages go fmt Replace networkHistory.offlineClients with clients Introduce internal message IDs Introduce loadHistoryLatestID Nuke in-memory ring buffer Update dependencies Allow '/' in nickname Fix downstream PING argument handling Fix panic in downstreamConn.sendNetworkHistory Don't update history when msgID is empty in appendLog Set Server.AcceptProxyIPs Add support for the PROXY protocol Add id column to User table Switch DB API to user IDs Switch to sql.NullString Add message store abstraction Switch to go-scfg Upgrade dependencies Don't accept any IP as a proxy by default Implement delivery receipts via PING messages Fix nickname in ERR_ERRONEOUSNICKNAME Add .editorconfig Turn messageStore into an interface Add store-agnostic message ID format Make chat history operations optional in messageStore Add in-memory message store go fmt Update dependencies Send RPL_ISUPPORT CHATHISTORY token Forward ISUPPORT NETWORK token Add support for graceful shutdown Rename sendNetworkHistory to sendNetworkBacklog Rename network.history to network.delivered Introduce downstreamConn.sendTargetBacklog Use sendTargetBacklog when re-attaching a channel Add irc to ALPN protocols Add Network.{URL,GetUsername,GetRealname} Extract ISUPPORT CHANMODES/PREFIX to separate functions Simplify if block in ISUPPORT handler Maintain state for upstream ISUPPORT Use upstream ISUPPORT map for NETWORK Properly handle all ISUPPORT negations Passthrough some ISUPPORT tokens Improve ERR_NOSUCHCHANNEL error messages Correctly set WebSocket read/write deadline Add Unix socket listener Send NOTICE to downstream when upstream is disconnected Don't store history for NickServ Don't update downstream caps in upstream RPL_WELCOME handler Don't add "irc" in ALPN list for WebSocket servers Drop "irc" WebSocket subprotocol Add support for the Forwarded HTTP header Fix Forwarded HTTP header handling Stop reading X-Forwarded-Port Reload TLS certs on SIGHUP Fix panic on GetCertificate Introduce deliveredClientMap contrib/casemap-logs.sh: new utility script Simplify network.offlineClients Move network.clients to user Ensure targets are case-mapped before being passed to messageStore Introduce deliveredStore Make NickServ detection casemapping-aware Rename user.clients to clientNames Use BARE for internal message IDs Save delivery receipts in DB Update dependencies cmd/soju: allow specifying -listen multiple times Introduce per-user logger Panic on unknown user event type Take msg ID in sendTargetBacklog Skip backlog logic in downstreamConn.welcome on chathistory Store last internal msg ID in DB when detaching Move isHighlight to irc.go Relay detached channel backlog as BouncerServ NOTICE if necessary Error out on network name conflict Add per-network logger Add user prefix to upstream logger sojuctl: don't use log.Fatalf in readPassword readme: mention Makefile, assume soju is installed system-wide Add default configuration file Make db and log config options more future-proof Thorben Günther (4): Add ability to change password Allow users to change password in client Allow to read password when stdin is not a tty. doc: fix typo in man page delthas (65): Add upstream INVITE support schema: add Network.name Add suffixing for multi-upstream connections Add create-network bouncer service command Add WHO support Add WHOIS support Fix MODE downstream support Add MODE arguments support Add downstream NAMES support Add user hostname to downstream user prefix Add downstream self WHO and WHOIS support Add upstream message-tags capability support Add upstream batch capability support Add a server-unique id to each downstream Add upstream labeled-response capability support Route NAMES, WHO, WHOIS replies to the requesting downstream Fix wrong handling of members parameter of RPL_NAMREPLY Simplify error handling for downstream JOIN/PART Add KICK support Add downstream TOPIC support Fix capitalization of 'id' Add upstream RPL_CREATIONTIME support Add downstream INVITE support Add downstream NOTICE support Marshal NOTICE user prefixes and channels Fix parsing wrong empty element in RPL_WHOISCHANNELS channel list Make upstream.SendMessageLabeled use an uint64 id Add LIST support Add support for bouncer logs Send one NOTICE on new upstream disconnect/connect errors Send the last error for disconnected networks in network status Fill all fields of the service user prefix Remove unused entityLog struct Add support for custom network on-connect commands Unmarshal nicks in texts of PRIVMSG and NOTICE from downstreams Add support for IRC address schemes Add support for the irc+insecure address scheme Fix joining only one saved channel per network Fix not properly marshaling self in single-server mode Add support for multiple user channel memberships Fix parsing MODE messages by updating channel memberships Fix a null access due to assigning nil to the member memberships map Fix sending CAP END twice when SASL is not used Update downstream nicks in single-server mode and after NICK Add support for downstream NICK to a single upstream Add support for downstream LIST to a single upstream Add support for downstream WHOIS nick/network nick/network Add support for upstream ban, invite, and exception lists Send a label with all messages sent from downstream Forward all labeled errors and unknown messages to their downstream Add support for TAGMSG and client message tags Fix parsing upstream RPL_INVITING messages Add support for downstream CHATHISTORY Rename handleServiceCreateNetwork to handleServiceNetworkCreate Fix: Check the stdin scanner for errors when reading the password Add an admin flag to users Add support for admin-restricted service commands Add support for the user create admin service command sojuctl: Add support for creating admin users Fix sending messages from detached channels Add support for the extended-join capability Introduce Channel.{RelayDetached,ReattachOn,DetachAfter,DetachOn} Add customizable auto-detaching, auto-reattaching, relaying. service: Introduce `channel update` Increase downstream TCP keepalive interval to 1 hour fox.cpp (3): Implement upstream SASL EXTERNAL support Fix handling of empty response to SASL challenge Do not panic if BouncerServ command without handler is sent