30 Commits

Author SHA1 Message Date
hubert
8ca570988a Make DB.DeleteChannel take the channel ID
... to allow the caller to correctly do any necessary casemapping.

git-svn-id: file:///srv/svn/repo/suika/trunk@416 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-09-07 09:40:18 +00:00
dan.shick
10e3974799 Fix store user query values
git-svn-id: file:///srv/svn/repo/suika/trunk@393 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-08-17 22:26:59 +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
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
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
delthas
d6d3e9ed7a Add an admin flag to users
This is preparatory work for letting some users access admin-exclusive
service commands, such as creating new users.

This adds a boolean admin flag to the User schema. Old users will stay
non-admin after the DB migration.

git-svn-id: file:///srv/svn/repo/suika/trunk@327 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-08 20:30:09 +00:00
contact
7c4131cbdb Introduce User.Created
For Network and Channel, the database only needed to define one Store
operation to create/update a record. However since User is missing an ID
we couldn't have a single StoreUser function like other types. We had
CreateUser and UpdatePassword. As new User fields get added (e.g. the
upcoming Admin flag) this isn't sustainable.

We could have CreateUser and UpdateUser, but this wouldn't be consistent
with other types. Instead, introduce User.Created which indicates
whether the record is already stored in the DB. This can be used in a
new StoreUser function to decide whether we need to UPDATE or INSERT
without relying on SQL constraints and INSERT OR UPDATE.

The ListUsers and GetUser functions set User.Created to true.

git-svn-id: file:///srv/svn/repo/suika/trunk@324 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-08 09:59:03 +00:00
fox.cpp
5f49770e07 Implement upstream SASL EXTERNAL support
Closes: https://todo.sr.ht/~emersion/soju/47

git-svn-id: file:///srv/svn/repo/suika/trunk@307 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-06-02 09:24:22 +00:00
contact
9f84047153 Add support for detached channels
Channels can now be detached by leaving them with the reason "detach",
and re-attached by joining them again. Upon detaching the channel is
no longer forwarded to downstream connections. Upon re-attaching the
history buffer is sent.

git-svn-id: file:///srv/svn/repo/suika/trunk@284 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-05-01 13:18:14 +00:00
contact
a448e04600 Add network.channels, remove DB.GetChannel
Store the list of configured channels in the network data structure.
This removes the need for a database lookup and will be useful for
detached channels.

git-svn-id: file:///srv/svn/repo/suika/trunk@267 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-23 14:36:20 +00:00
delthas
218af4327e Add support for custom network on-connect commands
Some servers use custom IRC bots with custom commands for registering to
specific services after connection.

This adds support for setting custom raw IRC messages, that will be
sent after registering to a network.

It also adds support for a custom flag.Value type for string
slice flags (flags taking several string values).

git-svn-id: file:///srv/svn/repo/suika/trunk@263 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-16 15:38:47 +00:00
contact
c82c640bd9 Set up DB migration infrastructure
The database is now initialized automatically on first run. The schema
version is stored in SQLite's user_version special field. Migrations are
stored in an array and applied based on the schema version.

git-svn-id: file:///srv/svn/repo/suika/trunk@255 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-10 20:45:02 +00:00
admin
88284aa7de Add ability to change password
git-svn-id: file:///srv/svn/repo/suika/trunk@251 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-10 08:09:02 +00:00
contact
9fe572eb4f Fix SQL error logged on JOIN
Closes: https://todo.sr.ht/~emersion/soju/40

git-svn-id: file:///srv/svn/repo/suika/trunk@207 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-01 15:34:22 +00:00
contact
d317a87876 Add "network delete" service command
And add all the infrastructure required to stop and delete networks.

References: https://todo.sr.ht/~emersion/soju/17

git-svn-id: file:///srv/svn/repo/suika/trunk@202 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-04-01 13:40:20 +00:00
contact
a17e0acde2 Stop accessing user data in downstreamConn.authenticate
This becomes racy once user.Password is updated on-the-fly.

git-svn-id: file:///srv/svn/repo/suika/trunk@173 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-27 21:38:38 +00:00
contact
9ffd959ce7 Correctly set Channel.ID in DB.StoreChannel
git-svn-id: file:///srv/svn/repo/suika/trunk@149 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-25 13:23:41 +00:00
contact
d4e5d3dfb4 Error out when storing unsupported SASL mechanism in DB
git-svn-id: file:///srv/svn/repo/suika/trunk@148 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-25 13:15:25 +00:00
contact
dd844bdefc Add support for channel keys
git-svn-id: file:///srv/svn/repo/suika/trunk@146 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-25 10:54:08 +00:00
delthas
0b5e3e828a schema: add Network.name
git-svn-id: file:///srv/svn/repo/suika/trunk@118 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-18 23:06:48 +00:00
contact
1a9d6a58a0 Rename project to soju
git-svn-id: file:///srv/svn/repo/suika/trunk@98 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-13 17:13:03 +00:00
contact
68b7b4461c 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

git-svn-id: file:///srv/svn/repo/suika/trunk@95 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-13 14:12:44 +00:00
contact
fb60233780 Add support for upstream PASS command
git-svn-id: file:///srv/svn/repo/suika/trunk@93 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-13 11:06:02 +00:00
contact
9eb7349674 Store NICK changes in the DB
git-svn-id: file:///srv/svn/repo/suika/trunk@90 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-12 18:17:06 +00:00
contact
9eee83f69d Update DB on JOIN and PART
git-svn-id: file:///srv/svn/repo/suika/trunk@89 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-12 17:33:03 +00:00
contact
ebad23e080 Add support for PASS to downstream
git-svn-id: file:///srv/svn/repo/suika/trunk@85 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-11 18:09:32 +00:00
contact
79f3b73eab cmd/jouncectl: new command
Allows to create users.

git-svn-id: file:///srv/svn/repo/suika/trunk@84 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-11 18:01:03 +00:00
contact
b6d2338737 Use a RWMutex for DB
git-svn-id: file:///srv/svn/repo/suika/trunk@81 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-04 19:15:38 +00:00
contact
c75d825938 go fmt
git-svn-id: file:///srv/svn/repo/suika/trunk@79 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-04 18:23:24 +00:00
contact
18c962e5c0 Add SQLite database
Closes: https://todo.sr.ht/~emersion/jounce/9

git-svn-id: file:///srv/svn/repo/suika/trunk@77 f0ae65fe-ee39-954e-97ec-027ff2717ef4
2020-03-04 17:22:58 +00:00