Commit Graph

234 Commits

Author SHA1 Message Date
Ske
dd9cc3ef0c Respect description privacy when searching members 2020-06-18 17:33:37 +02:00
Ske
56eae82b0a Move most references to PKMember.Name to go through helper extepsions for privacy 2020-06-18 17:08:36 +02:00
Ske
761270f0c3 Clean up member privacy command 2020-06-17 23:06:49 +02:00
Ske
dd2690c3f4 Get rid of compiler warning 2020-06-17 22:39:54 +02:00
Ske
e92700f339 Comment out color privacy stuff for now (revisit later?) 2020-06-17 21:51:40 +02:00
BeeFox-sys
721a4502bb
Feature/granular member privacy (#174)
* Some reasons this needs to exist for it to run on my machine? I don't think it would hurt to have it in other machines so

* Add options to member model

* Add Privacy to member embed

* Added member privacy display list

* Update database settings

* apparetnly this is nolonger needed?

* Fix sql call

* Fix more sql errors

* Added in settings control

* Add all subject to system privacy

* Basic API Privacy

* Name privacy in logs

* update todo

* remove CheckReadMemberPermission

* Added name privacy to log embed

* update todo

* Update todo

* Update api to handle privacy

* update todo

* Update systemlist full to respect privacy (as well as system list)

* include colour as option for member privacy subject

* move todo file (why was it there?)

* Update TODO.md

* Update TODO.md

* Update TODO.md

* Deleted to create pr

* Update command usage and add to the command tree

* Make api respect created privacy

* Add editing privacy through the api

* Fix pronoun privacy field in api

* Fix info leak of display name in api

* deprecate privacy field in api

* Deprecate privacy diffrently

* Update API

* Update documentation

* Update documentation

* Remove comment in yml

* Update userguide

* Update migration (fix typo in 5.sql too)

* Sanatize names

* some full stops

* Fix after merge

* update migration

* update schema version

* update edit command

* update privacy filter

* fix a dumb mistake

* clarify on what name privacy does

* make it easier on someone else

* Update docs

* Comment out unused code

* Add aliases for `member privacy all public` and `member privacy all private`
2020-06-17 21:31:39 +02:00
Ske
627f544ee8 Migrate API to ASP.NET Core Auth services + refactor 2020-06-16 01:15:59 +02:00
Ske
21f8caf006 Update type signature of MessageContext rows 2020-06-15 12:54:22 +02:00
Ske
5aa55359b3 Always return a row from message_context even with both system and guild is undefined (closes #183) 2020-06-15 12:54:00 +02:00
Ske
088bc15e5e Upgrade Autofac dependency 2020-06-15 00:52:20 +02:00
Ske
b9cbd241de Migrate to type-safe model ID structs 2020-06-14 21:37:04 +02:00
Ske
0f041c2e3c Add unit test project and some early tests 2020-06-14 18:56:53 +02:00
Ske
55b1c6499d Remove duplicated ProxyName function 2020-06-14 15:37:07 +02:00
Ske
c780781184 Remove unused imports 2020-06-13 23:12:44 +02:00
Ske
d135042a58 Change default console log level back 2020-06-13 22:39:19 +02:00
Ske
2702c45b4f General bits of cleanup 2020-06-13 22:20:24 +02:00
Ske
6d06474d26 Refactor sort/filter code once again
Now we handle sorting on the bot side, but still filter in the database
2020-06-13 21:49:31 +02:00
Ske
f1b28b7fb6 Move schema migration stuff to Database 2020-06-13 19:54:16 +02:00
Ske
c927967c3b Migrate GetSystemById 2020-06-13 19:42:04 +02:00
Ske
511cf0ab55 Get rid of some unused ctors 2020-06-13 19:41:51 +02:00
Ske
90ac186183 Extract Database to interface 2020-06-13 19:36:43 +02:00
Ske
c875c8af9f Various small fixes, setting guild config now works 2020-06-13 19:15:50 +02:00
Ske
2038f023a0 Move count stat collecting to raw SQL 2020-06-13 19:15:29 +02:00
Ske
767a37e637 Use async transactions for AddSwitch 2020-06-13 19:14:42 +02:00
Ske
37b99f9521 Wrap DbTransaction too 2020-06-13 18:49:05 +02:00
Ske
e176ccbab5 Several more database-y refactors
- DbConnectionFactory renamed to "Database", will now be the primary entry point for DB stuff
- Created IPKConnection interface mostly containing async extensions to IDbConnection, use this going forward
- Reworked the Connection/Command wrappers (that have performance/logging extensions)
- Probably more stuff that I forgot???
2020-06-13 18:31:20 +02:00
Ske
a915ddb41c Extract system/member guild settings and refactor DB access
(also refactor MemberAvatar now that I'm here)
2020-06-13 16:03:57 +02:00
Ske
ed511a6236 Refactor server config models/commands 2020-06-13 13:58:27 +02:00
Ske
23c595f675 Extract ProxyTag to separate file 2020-06-13 13:18:21 +02:00
Ske
cb8f29cc47 Remove setters where possible 2020-06-13 13:11:08 +02:00
Ske
e8b69dfe29 Remove JSON attributes from models 2020-06-13 13:06:41 +02:00
Ske
292676b694 Optimize last message search in member list view 2020-06-13 02:45:06 +02:00
Ske
d246c9bf33 Change HID function types to char(5) as in DB 2020-06-13 01:54:29 +02:00
Ske
920c8cff01 Optimize message count migration 2020-06-13 01:25:12 +02:00
Ske
8ac2f1e4b8 Move hid generation to the database. Closes #157. 2020-06-13 00:43:48 +02:00
Ske
c39c51426f Remove setters for function models 2020-06-13 00:42:25 +02:00
Ske
761a82740f Remove unused functions and classes 2020-06-12 23:55:25 +02:00
Ske
729930a562 Move system tag/icon from ProxyMember to MessageContent 2020-06-12 23:30:10 +02:00
Ske
2a39489c4d Move proxy name/avatar logic to the bot itself 2020-06-12 23:24:36 +02:00
Ske
3d62a0d33c Split message/proxy data up in MessageContext and ProxyMember 2020-06-12 23:13:21 +02:00
Ske
ba441a15cc Too many refactors in one:
- Allowed adding ephemeral(ish) views and functions
- Moved message_count to a concrete database field
- Moved most proxy logic to a stored procedure
- Moved database files around and refactored schema manager
2020-06-12 20:29:50 +02:00
Ske
24f1363bb0 Return AsyncDisposable from DbConnectionFactory 2020-06-12 00:54:50 +02:00
Ske
49acc4d9e2 Refactor proxy handling code
- Move reaction handlers to the ReactionAdded event instead of
  ProxyService
- Split tag matching off into ProxyTagParser
- Split autoproxy matching off into Autoproxier
- General cleanup and simplification
2020-06-11 23:22:53 +02:00
Ske
ccb6ba5d30 Minor renames and rewordings 2020-06-11 21:32:04 +02:00
Lillian Berry
50c9675963 Fix formatting 2020-06-11 21:19:40 +02:00
Lillian Berry
59af6f02e8 Add disabling reaction pings 2020-06-11 21:19:40 +02:00
Ske
39f92309b7 Refactor import/export database code 2020-06-11 21:11:50 +02:00
Ske
62207a9255 Reduce flush to disk interval further 2020-05-31 03:22:41 +02:00
Ske
c3d439dc5f Properly handle duplicate message insertions to the database 2020-05-06 23:49:06 +02:00
Ske
f803b9a392 Add a character limit to avatar URLs (256 for now) 2020-05-05 16:04:17 +02:00
Ske
91c2eb3992 Fix plain-text logging output file 2020-05-01 20:13:15 +02:00
Ske
483a9d6ed9 Save log file as both text and JSON 2020-04-29 00:25:31 +02:00
Ske
4fe40b220e Optimize latch-mode autoproxy query 2020-04-16 18:23:56 +02:00
Ske
93e53be7db Bump member count limit for the time being 2020-04-09 17:25:01 +02:00
Ske
a1d91784a0 Fix importing older export files 2020-03-07 17:30:22 +01:00
Ske
c5a91c4575 Fix Tupperbox importing birthdays 2020-03-04 19:49:02 +01:00
Ske
45c5e5ed42 Normalize colors to lowercase hex 2020-02-25 16:37:52 +01:00
BeeFox-sys
e455bd6d12
Fix import validation issue (#156) 2020-02-25 16:33:49 +01:00
Ske
9d4993b121 Fix Tupperbox import errors 2020-02-23 12:45:26 +01:00
Ske
26e7ef3c23 Add further bounds/sanity checking to import files 2020-02-22 20:11:37 +01:00
Ske
de141d629b Fix newline rendering in embeds on iOS 2020-02-20 22:57:37 +01:00
Ske
e9cc8ed424 Add logger bot cleanup support 2020-02-15 14:17:25 +01:00
Ske
48342a2890 Fix spurious empty-string-description errors 2020-02-12 23:18:31 +01:00
Ske
2148e29f54 Log updates to guild settings 2020-02-12 19:07:40 +01:00
Ske
d0d3579b17 Add server-specific member avatars 2020-02-12 17:42:12 +01:00
Ske
6d5004bf54 Large refactor and project restructuring 2020-02-12 15:16:19 +01:00
Ske
30ed293dc6 Change no-year sentinel value to 0004
This allows setting the date "Feb 29" with no year, since the year 0004 is a leap year in the Gregorian calendar, while the year 0001 isn't.
2020-02-09 22:36:02 +01:00
Ske
951b089c97 Handle imports from other systems/instances with different HIDs 2020-02-03 15:16:57 +01:00
Ske
7bdc3020b0 Handle malformed proxy tag importing correctly 2020-02-03 15:05:05 +01:00
Ske
026932049a Properly invalidate account caches when unlinking 2020-02-03 15:04:53 +01:00
Ske
de427d8bfe Properly invalidate account caches when deleting systems 2020-02-03 14:47:29 +01:00
Ske
82dfe43d5a Rework caching
This does a *lot* of things. Essentially, it replaces the existing
individual proxy- and autoproxy caches on the bot end with a
global cache (in Core) that handles all the caching at once, and
automatically invalidates the cache once something changes in the
datastore.

This allows us to do proxying and autoproxying with *zero database
queries* (best-case).
2020-02-01 14:40:57 +01:00
Ske
a60be64551 Ensure metrics instance is a singleton 2020-02-01 12:33:43 +01:00
Ske
3b2167e16f Shuffle dependencies around 2020-01-26 01:30:39 +01:00
Ske
1ea0526ef8 Migrate DI container to Autofac 2020-01-26 01:27:45 +01:00
Ske
b371c2f34d Fix Npgsql deprecation error 2020-01-25 16:46:34 +01:00
Ske
83cfb3eb46 Add autoproxy functionality 2020-01-24 20:28:48 +01:00
Ske
57bc576de6 Add autoproxy management commands 2020-01-23 21:20:22 +01:00
Ske
ca37c7e6ca Put the autoproxy settings in the correct class 👀 2020-01-23 20:29:22 +01:00
Ske
bf70a6e3e1 Add schema changes for autoproxy 2020-01-23 20:19:50 +01:00
Ske
b347d2d557 Add front history pagination; upgrade more store methods 2020-01-18 00:58:35 +01:00
Ske
8a689ac0f2 Upgrade various store methods to IAsyncEnumerable 2020-01-18 00:02:17 +01:00
Ske
0dd8988c08 Fix member count including private members in system card 2020-01-17 17:54:07 +01:00
Ske
991c00a4e6 Increase precision in exported timestamps 2020-01-17 17:43:06 +01:00
Ske
98613c4287 Add system and member privacy support 2020-01-11 16:51:13 +01:00
Ske
66eb012e4a Fix database errors on first startup 2020-01-07 16:31:46 +01:00
Ske
64b633e6b4 Fix member avatar URL not showing up in API responses 2020-01-07 15:52:32 +01:00
Ske
54aa9fb7d7 Change handling of Tupperbox per-member tags 2019-12-28 15:53:11 +01:00
Ske
0f22285824 Upgrade API serialisation code to enable potential context-based serialisation 2019-12-28 15:52:59 +01:00
Ske
73b2631280 Optimize database queries for proxy filtering 2019-12-28 12:00:52 +01:00
Ske
4a30e56298 Add basic database schema migration system 2019-12-26 21:43:05 +01:00
Ske
4d07886ec8 Add server-specific display names 2019-12-26 20:39:47 +01:00
Ske
6a4c131d6d Upgrade every dependency to latest compatible version 2019-12-23 15:53:20 +01:00
Ske
f2ce09d467 Upgrade to Npgsql 4.1.2 2019-12-23 13:55:56 +01:00
Ske
b4ad1e5041 Use asynchronous logging 2019-12-23 00:29:30 +01:00
Ske
d2205ea7e6 Update documentation with new features 2019-12-22 14:26:53 +01:00
Ske
639c813ce7 Add per-server per-system proxy enable toggle 2019-12-22 14:15:56 +01:00
Ske
d4c1a6b1fc Add beginnings of new export/data system 2019-12-22 00:41:53 +01:00
Ske
9c9e48a799 Upgrade to .NET Core 3.1 2019-12-22 00:40:57 +01:00
Ske
5fc654b758 Add index to message table to speed up count querying 2019-12-21 21:42:34 +01:00