Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Merge branch 'release/v8.2.x' into develop

Chocobozzz172d45b68300
diff --cc server/core/lib/activitypub/process/process-create.ts
index d72ba821f2,a9bec98fff..079ef97213
--- a/server/core/lib/activitypub/process/process-create.ts
+++ b/server/core/lib/activitypub/process/process-create.ts
@@@ -52,7 -51,10 +53,10 @@@ async function processCreateActivity (o
}
if (activityType === 'WatchAction') {
- return retryTransactionWrapper(() => processCreateWatchAction(activityObject))
+ // Watch actions are only sent to the inbox of the video origin, so we never have to process a fetched one
+ if (options.fromFetch) return
+
- return retryTransactionWrapper(processCreateWatchAction, activityObject, byActor)
++ return retryTransactionWrapper(() => processCreateWatchAction(activityObject, byActor))
}
if (activityType === 'CacheFile') {
diff --cc server/core/lib/activitypub/process/process-update.ts
index 12335d4c94,3e763a3ba4..ab4696cdbc
--- a/server/core/lib/activitypub/process/process-update.ts
+++ b/server/core/lib/activitypub/process/process-update.ts
@@@ -26,8 -26,8 +26,8 @@@ import { createOrUpdateCacheFile } fro
import { upsertAPPlayerSettings } from '../player-settings.js'
import { createOrUpdateVideoPlaylist } from '../playlists/index.js'
import { forwardVideoRelatedActivity } from '../send/shared/send-utils.js'
- import { checkUrlsSameHost } from '../url.js'
-import { APVideoUpdater, canVideoBeFederated, getOrCreateAPVideo, maybeGetOrCreateAPVideo } from '../videos/index.js'
+ import { checkUrlsSameHost, isLocalUrl } from '../url.js'
+import { APVideoUpdater, canVideoBeFederated, getOrCreateAPVideo, maybeGetOrCreateAPVideo } from '../videos/index.js'
async function processUpdateActivity (options: APProcessorOptions<ActivityUpdate<ActivityUpdateObject>>) {
const { activity, byActor } = options
@@@ -40,9 -40,16 +40,16 @@@
}
if (isActorTypeValid(objectType as ActivityPubActorType)) {
+ // An actor can only update itself: the object id must be the actor that signed the activity
+ const actorObjectId = getAPId(object as ActivityPubActor)
+ if (actorObjectId !== byActor.url) {
+ logger.error(`Actor ${byActor.url} cannot update the actor ${actorObjectId}.`, { actorObjectId, byActor: byActor.url })
+ return undefined
+ }
+
// We need more attributes
const byActorFull = await ActorModel.loadByUrlAndPopulateAccountAndChannel(byActor.url)
- return retryTransactionWrapper(processUpdateActor, byActorFull, object)
+ return retryTransactionWrapper(() => processUpdateActor(byActorFull, object as ActivityPubActor))
}
if (objectType === 'CacheFile') {