Browse Source

Fix pleroma follow

Chocobozzz 5 years ago
parent
commit
c28bcdd10a

+ 1 - 2
server/lib/activitypub/crawl.ts

@@ -3,8 +3,7 @@ import { doRequest } from '../../helpers/requests'
 import { logger } from '../../helpers/logger'
 import * as Bluebird from 'bluebird'
 import { ActivityPubOrderedCollection } from '../../../shared/models/activitypub'
-import { checkUrlsSameHost } from '../../helpers/activitypub'
-import { parse } from "url"
+import { parse } from 'url'
 
 type HandlerFunction<T> = (items: T[]) => (Promise<any> | Bluebird<any>)
 type CleanerFunction = (startedDate: Date) => (Promise<any> | Bluebird<any>)

+ 1 - 1
server/lib/job-queue/handlers/utils/activitypub-http-utils.ts

@@ -28,7 +28,7 @@ async function buildSignedRequestOptions (payload: Payload) {
     actor = await getServerActor()
   }
 
-  const keyId = actor.getWebfingerUrl()
+  const keyId = actor.url
   return {
     algorithm: HTTP_SIGNATURE.ALGORITHM,
     authorizationHeaderName: HTTP_SIGNATURE.HEADER_NAME,

+ 2 - 0
server/middlewares/activitypub.ts

@@ -74,6 +74,8 @@ async function checkHttpSignature (req: Request, res: Response) {
 
   const verified = isHTTPSignatureVerified(parsed, actor)
   if (verified !== true) {
+    logger.warn('Signature from %s is invalid', actorUrl, { parsed })
+
     res.sendStatus(403)
     return false
   }