Commit graph

193 commits

Author SHA1 Message Date
5636534d03
server: fix user deletes being stuck in queue
Some checks failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
The user was already deleted from the user cache, so requesting the
user returned null. Because the key was not null, there was a non-null
return, in turn making further code think, fetching the user was
successful.
2024-03-19 18:07:41 +01:00
fba8536743
stop retries after wrong content-type
It does not make sense to re-request the same resource with the same
parameters and expect a different content-type to be returned. Also
this makes the error message more sensible and understandable.
2024-02-19 07:50:19 +01:00
47b3277201
check content-type header on AP requests
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/test unknown status
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
Changelog: Security
Ref: GHSA-jhrq-qvrm-qr36
2024-02-17 09:04:36 +01:00
Laura Hausmann
c8f8e4c01d
activitypub: fix typo in audience.ts isPublic check
Some checks failed
ci/woodpecker/push/build Pipeline failed
ci/woodpecker/push/test unknown status
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
2024-02-11 13:12:43 +01:00
24f6177b94
server: endpoint to fetch votes count
Changelog: Added
2024-01-03 17:29:46 +01:00
b7dc3cca22
activitypub: send all cascade deletes
The `deleteNotes` function would not correctly handle cases where cascade
deleted notes were from a different user than the initially deleted note.

Changelog: Fixed
2023-12-03 14:18:34 +01:00
2c69cb4a92
server: check inbox URLs
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
This adds a check for inbox and sharedInbox URLs to be both
valid and also absolute URLs. If the normal inbox URL is invalid,
the actor will be rejected. If the sharedInbox URL is invalid, it
will be ignored.

Changelog: Fixed
2023-08-16 19:21:37 +02:00
650b797fd6
star is like
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-19 10:27:56 +02:00
75ab4de41f
server: limit caching time for public keys 2023-07-19 09:43:17 +02:00
9b4e976bda
activitypub: correctly handle new notes that were edited 2023-07-16 14:32:57 +02:00
796adc8599
trigger side effects after updating note
Some checks failed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-sw Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-07-02 10:06:54 +02:00
42b555e5e4
activitypub: handle incoming Update Note activities
Changelog: Added
2023-07-02 10:06:53 +02:00
5c3e7c132a
add function to update a note 2023-07-02 10:06:53 +02:00
2ea6daaf7a
rename extractDbHost to extractPunyHost
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-06-27 22:02:32 +02:00
b600efae0d
BREAKING: activitypub: validate fetch signatures
Enforces HTTP signatures on object fetches, and rejects fetches from blocked
instances. This should mean proper and full blocking of remote instances.

This is now default behavior, which makes it a breaking change. To disable
it (mostly for development purposes), the configuration item
`allowUnsignedFetches` can be set to true. It is not the default for
development environments as it is important to have as close as possible
behavior to real environments for ActivityPub development.

Co-authored-by: nullobsi <me@nullob.si>
Co-authored-by: Norm <normandy@biribiri.dev>
Changelog: Added
2023-06-25 20:42:14 +02:00
7272bde464
fix more variable issues in processContent
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 20:58:18 +02:00
bed8286175
fix missing variable in processContent
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 20:25:55 +02:00
f00b3cc378
add missing import for emoji parsing
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 19:53:17 +02:00
21ab8e75ee
activitypub: improve JSON-LD context
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Added @type values for most definitions, and made name and value only
scoped to the PropertyValue type. (Blame Volpeon)
2023-05-30 17:57:03 +02:00
9c5755cf65
backend: fixup another missed import of extractEmojis
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 00:17:56 -04:00
fce14a07da
backend: fix import of extractEmojis in models/person
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-30 00:12:07 -04:00
eb971de3a7
move extractEmojis to models/tags 2023-05-29 22:29:36 +02:00
d74b7d2eec
refactor note content processing
Refactor the content processing into a separate function so it can be
reused in a updateNote function to be created.
2023-05-29 22:29:36 +02:00
89fad52272
remove redundant check
Some checks failed
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
Whether the actor is suspended is already checked in the performOneActivity
function and does not need to be checked here again since the actor is still
the same as it was there.
2023-05-28 23:31:06 +02:00
2696c34f6c
fix some audience parsing assumptions
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline failed
The assumptions made in the comment is actually wrong. The comment says:
"If value is a string, this means it must have passed through the resolver,
which means it must be public." But this is not true because we do signed
GET requests which means we may well get non-public posts using the
resolver.
2023-05-28 23:28:43 +02:00
bda8488194
fix messaging messages with multiple recipients
instead of returning early, this should only return after all messaging
messages have been created
2023-05-28 23:28:42 +02:00
c9df2fd060
validate that note attributed to is not local 2023-05-28 23:28:42 +02:00
cc342f1443
refactor createNote, translate comments
Use the already existing functions isPost and toArray instead of
reimplementing them.
2023-05-28 23:28:42 +02:00
e584937b4f
fix: missing paren, type error 2023-05-23 21:49:34 +02:00
4312393169
Revert 'Revert "server: fix user deletion race condition"'
This reverts commit bb3ec8bafe.
2023-05-23 21:49:33 +02:00
85a392ee33
logger: remove unused structured data
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The `data` field is not used anywhere in the logger. While it would
be possible to send structured data through syslog, it seems unnecessary
at present and also the way in which this structured data would have to be
provided sounds too cumbersome to implement for no real value.
2023-05-18 22:42:30 +02:00
1516ddfc9b
refactor: remove CacheableUser & co
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
The CacheableUser, CacheableLocalUser and CacheableRemoteUser are
identical types to User, ILocalUser and IRemoteUser so it seems
nonsensical to have different types for them.
2023-05-18 13:25:57 +02:00
9675ced915
translate japanese comment
Some checks failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed
2023-05-18 02:08:07 +02:00
1472c21cb6
activitypub: properly handle all scopes for renotes
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This was not implemented because of concerns raised in
https://github.com/misskey-dev/misskey/issues/8261
about Mastodon incorrectly interpreting the scope on renotes.
However this bug seems to be fixed so it can now be implemented.

See also https://github.com/misskey-dev/misskey/pull/10291

Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
2023-03-31 07:59:20 +02:00
e78069d904
server: implement moveTo property on actors
Co-authored-by: Mary Strodl <ipadlover8322@gmail.com>
Co-authored-by: amybones <amy@spookygirl.boo >
2023-03-23 21:43:50 +01:00
910976a55b
server: implement receiving Move activities
For now only creates notifications.
2023-03-23 21:10:15 +01:00
3c2092935c
server: add object hint to resolvePerson 2023-03-23 21:10:14 +01:00
f1d7357e75
server: fix undefined variable in getOneApId
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This is a fixup for commit 48fd543d0f.

closes #365
2023-03-22 18:30:56 +01:00
6a17dcf4de
server: refactor to group deletion deliveries
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
The `quiet` argument has been removed from `deleteNote` (or `deleteNotes`
respectively) since it was not used anywhere and it does not seem a good
idea to not update statistics in some cases.

This should also fix an issue where cascade deletions mean that statistics
are not properly updated or streaming clients not properly informed of
deletions. This case was seemingly not considered before, even though
there was some handling for cascade deleted notes.

This is going to improve how cascade deletion impacts the delivery queue,
because cascade-deleted notes will now be grouped for delivery.

Changelog: Fixed
2023-03-12 12:37:20 +01:00
e52cf25489
server: use named export for deleteNote 2023-03-11 09:54:46 +01:00
2164fda2fb
server: do AP sent statistics in request function 2023-03-11 09:42:05 +01:00
e2063f4ff9
fix: correctly parse quotes
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
2023-02-24 23:47:50 +01:00
41aa5cd18f
fix typo
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
2023-02-19 23:32:36 +01:00
17c9a9374d
fixup: server: parse quote tag syntax
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This is a fixup for commit 5893a44ff5.
2023-02-19 19:41:11 +01:00
b8796cb1fa
activitypub: remove _misskey_votes property
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This is a duplication of `replies.totalItems` and seems unnecessary,
it is even only parsed by Misskey if the afforementioned property is
not available.

Changelog: Removed
2023-02-11 17:49:12 +01:00
68bc2e314b
activitypub: remove _misskey_reaction property
This property is duplicated by the `content` property so seems unnecessary.

Changelog: Removed
2023-02-11 17:43:44 +01:00
fff93c6965
activitypub: remove _misskey_content attribute
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
As already noted back in https://github.com/misskey-dev/misskey/pull/8787
the intention was to replace the `_misskey_content` attribute with the
ActivityPub-defined `source` property. Misskey and by extension Foundkey
have shipped with the `source` property and the respective parsing for
quite a while so it seems reasonable to remove it now.

Changelog: Removed
2023-02-11 17:25:24 +01:00
48fd543d0f
security: check URL schema of AP URIs
Changelog: Fixed
2023-02-10 20:06:12 +01:00
28c11ca7af
refactor isPureRenote to foundkey-js 2023-02-04 16:42:36 +01:00
9458045c8f
server: refactor note/renote rendering to separate file
All checks were successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
2023-02-04 15:32:25 +01:00