Commit graph

620 commits

Author SHA1 Message Date
vib a4c9ab8dd1 Merge branch 'main' into snug.moe 2022-10-17 09:05:03 +03:00
Norm 04d4dd323f
backend: use time constant in services/chart/index.ts 2022-10-16 18:22:18 -04:00
Norm e814fdc7d1
backend: fix lints in services/drive 2022-10-16 18:20:20 -04:00
Norm f2f547172e
backend: improve documentation of pin/update functions 2022-10-16 18:06:22 -04:00
Norm f17485d8a2
backend: add type annotations to delete.ts 2022-10-16 17:14:30 -04:00
Norm 70eec26b74
bump versions in all package.json files 2022-10-16 11:46:12 -04:00
Chloe Kudryavtsev 811d5cd0d7 Merge pull request 'deliver Delete activities to all known instances' (#198) from deliver-delete-everyone into main
Reviewed-on: FoundKeyGang/FoundKey#198
2022-10-16 13:46:23 +00:00
Chloe Kudryavtsev d762143b89 backend: fixup missing deadTime and incorrect import 2022-10-16 09:32:01 -04:00
Chloe Kudryavtsev 21c1e5c06c backend: simplify suspended and dead queries
This should also have better latency due to being a single query.
Furthermore, it's no longer a linear scan, since host is indexed.
Would be cool to simplify it further to a single query for blocks also...
Why exactly are blocks not in the db?
2022-10-16 09:22:05 -04:00
Chloe Kudryavtsev 91a4f38871 backend: add automatic dead instance detection
It works by having a day-long cache of
"when did we last successfully communicate with this instance?"
Anything over a specified threshold (1 month) will act as though the instance
is suspended - all outgoing jobs are dropped on processing.
The day-long cache is in place because the ordering is necessarily a
linear scan.
Once an instance comes back online, we will detect that is the case as soon as
we receive an activity from them (which will update the "last communicated at")
field.

Potential future TODOs:
* Improve the caching system, it's actually pretty inefficient as it is.
  CacheBox with a call override?
* Think of ways to make it not-a-linear-scan, since the instances table can get
  pretty big. It's around 4500 on toast cafe.

ChangeLog: Added
2022-10-16 12:16:04 +00:00
Johann150 756ecbb1f7
fix type error 2022-10-16 04:20:11 +02:00
Johann150 cb0b14ba2d
backend: allow to export only specific emoji 2022-10-12 01:49:53 +02:00
Johann150 7cd11e7afd
fix function name 2022-10-11 21:26:20 +02:00
Johann150 0b8fa2665c
use DISTINCT instead of GROUP BY
This should have better performance for large recordsets.

Ref: FoundKeyGang/FoundKey#198 (comment)
2022-10-11 20:15:59 +02:00
Johann150 421b42d07d
backend: send delete activity to all known instances
closes FoundKeyGang/FoundKey#190

Changelog: Added
2022-10-11 19:32:26 +02:00
Norm 9a503273fb Merge pull request 'refactor meta API endpoint' (#196) from refactor/api/meta into main 2022-10-11 17:20:51 +00:00
Norm 20a6140e9a Merge pull request 'backend: Cleanup prelude directory' (#199) from backend-cleanup-prelude into main
Reviewed-on: FoundKeyGang/FoundKey#199
2022-10-11 14:47:40 +00:00
vib fe99f4de6f Merge branch 'main' into snug.moe 2022-10-11 17:19:09 +03:00
Chloe Kudryavtsev 6d58d5ed3b fixup: muted-renotes review round 1 2022-10-11 10:42:39 +00:00
Chloe Kudryavtsev 897658c188 import publishUserEvent in mute renote APIs 2022-10-11 10:42:39 +00:00
Chloe Kudryavtsev 590a8b98d9 fixup renoteMuting stream filter being overzealous 2022-10-11 10:42:39 +00:00
Chloe Kudryavtsev dd5100d124 add streaming events for renotemuting and blocking 2022-10-11 10:42:39 +00:00
Chloe Kudryavtsev 3d9df839a5 add down-migration for renote mutes 2022-10-11 10:42:39 +00:00
Hélène c414f24a2c feat: per-user renote muting
Changelog: Added
2022-10-11 10:42:39 +00:00
Michcio 60600729df
backend: Fix import of sanitize-html
I'm not sure how it managed to work so far, but the function is the default
export, using the namespace like a function should not have worked,
maybe something under the hood was correcting it back
2022-10-11 10:41:50 +02:00
Norm 683b0cfa82
backend: remove unused prelude modules
Much of these modules are no longer used in the backend. They seem to be
from before the code was organized in packages.
2022-10-11 01:53:34 -04:00
Norm c65559872b
backend: add missing return type annotation in array.ts 2022-10-11 01:51:17 -04:00
Norm 13a3581817
Merge branch 'refactor/use-null-coalesce-etc'
Reviewed-on: FoundKeyGang/FoundKey#195
2022-10-10 18:44:19 -04:00
Johann150 808c43377e
refactor: use nullish coalescing & optional chaining
Changes several places to use the afforementioned constructs in favour of
ternary expressions.
2022-10-11 00:39:27 +02:00
Johann150 8920eeb86a
ActivityPub: allow all known shared inboxes to be addressed
This is oriented on this paragraph from the AP spec:

> Additionally, if an object is addressed to the Public special collection,
> a server MAY deliver that object to all known sharedInbox endpoints
> on the network.
2022-10-11 00:27:43 +02:00
Norm 91c043689b Merge pull request 'backend: Fix imports from weird paths' (#192) from Michcio/FoundKey-0x7f:extensionless-imports into main
Reviewed-on: FoundKeyGang/FoundKey#192
2022-10-10 18:58:54 +00:00
Michcio 30faeb73d2 backend: Fix type errors in genId
I checked on NodeJS locally and `Math.min` was coercing the Dates to numbers,
I'm just making it more obvious (to the typechecker as well)
2022-10-10 20:50:04 +02:00
Michcio dc510c6834 Fix imports from weird paths
These imports were breaking in TS error checking and VS Code, because
imports need to have an extension to be valid, apparently
2022-10-10 20:45:45 +02:00
Michcio a91bbed34e
Make it impossible to start initializing Vue before DOM exists 2022-10-10 14:22:48 -04:00
Johann150 9022ab9f2a
backend: ignore detail parameter on meta endpoint
Also allow meta endpoint to be fetched via GET.

Changelog: Removed
2022-10-10 17:36:13 +02:00
vib 07f42e6df0 Merge branch 'main' into snug.moe 2022-10-07 10:13:11 +03:00
Norm c20352b22e
backend: update THRESHOLD constants to use time constants 2022-10-05 00:54:16 -04:00
Norm 9084864b34
backend: translate comments in const.ts 2022-10-05 00:52:52 -04:00
vib 750e88f183 Merge branch 'main' into snug.moe 2022-10-04 22:27:15 +03:00
Norm a6d1284423 backend: change Misskey -> FoundKey and use absolute import in index.ts 2022-10-03 20:04:06 +00:00
Norm 8ccc22bb35 Merge pull request 'refactor expiring data and expire signins after 60 days' (#180) from expire-data into main
Reviewed-on: FoundKeyGang/FoundKey#180
2022-10-03 18:27:13 +00:00
Michcio ffcb840e06
Fix type in thread muting 2022-10-03 13:24:27 -04:00
Johann150 a7f9e244f3
merge: allow redis family to be specified as a string
Reviewed-on: FoundKeyGang/FoundKey#165
2022-10-02 18:46:34 +02:00
Johann150 5b7a06675f
refactor expiring data and expire signins after 60 days
closes FoundKeyGang/FoundKey#176

Changelog: Added
2022-10-02 00:18:07 +02:00
Johann150 36a0e48e49
bacakend: prefer absolute over relative imports
There are still many places where import paths with `..` are used and
maybe should use absolute paths also.
2022-10-01 14:40:30 +02:00
vib 56171ee2bd Merge branch 'main' into snug.moe 2022-09-30 21:35:18 +03:00
Norm 8ca544c45d
remove outgoingAddressFamily 2022-09-30 11:05:50 -04:00
Norm 29164740b9
fix warning message 2022-09-30 11:05:50 -04:00
Norm 508748ac0d
backend: refactor Redis option loading 2022-09-30 11:05:49 -04:00
Norm 5a52532c99
allow redis family to be specified as a string
This makes it consistent with `outgoingAddressFamily`, reducing
potential confusion.

For compatibility reasons, numbers are still permitted for `redis.family`
with the following mapping:
- `dual` = `0`
- `ipv4` = `4`
- `ipv6` = `6`

Changelog: Changed
2022-09-30 11:05:49 -04:00