aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/activitypub
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-14 17:31:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-27 19:40:51 +0100
commit350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (patch)
treef4191f3c04a5230fcf8ca3d6ca3248643fc4151d /server/controllers/activitypub
parente34c85e527100c0b5c44567bd951e95be41b8d7e (diff)
downloadPeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.gz
PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.tar.zst
PeerTube-350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad.zip
Follow works
Diffstat (limited to 'server/controllers/activitypub')
-rw-r--r--server/controllers/activitypub/client.ts4
-rw-r--r--server/controllers/activitypub/inbox.ts4
-rw-r--r--server/controllers/activitypub/index.ts10
3 files changed, 10 insertions, 8 deletions
diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts
index 461a619dd..56a4054fa 100644
--- a/server/controllers/activitypub/client.ts
+++ b/server/controllers/activitypub/client.ts
@@ -16,12 +16,12 @@ activityPubClientRouter.get('/account/:name',
16 executeIfActivityPub(asyncMiddleware(accountController)) 16 executeIfActivityPub(asyncMiddleware(accountController))
17) 17)
18 18
19activityPubClientRouter.get('/account/:nameWithHost/followers', 19activityPubClientRouter.get('/account/:name/followers',
20 executeIfActivityPub(localAccountValidator), 20 executeIfActivityPub(localAccountValidator),
21 executeIfActivityPub(asyncMiddleware(accountFollowersController)) 21 executeIfActivityPub(asyncMiddleware(accountFollowersController))
22) 22)
23 23
24activityPubClientRouter.get('/account/:nameWithHost/following', 24activityPubClientRouter.get('/account/:name/following',
25 executeIfActivityPub(localAccountValidator), 25 executeIfActivityPub(localAccountValidator),
26 executeIfActivityPub(asyncMiddleware(accountFollowingController)) 26 executeIfActivityPub(asyncMiddleware(accountFollowingController))
27) 27)
diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts
index eedb518b9..e62125d85 100644
--- a/server/controllers/activitypub/inbox.ts
+++ b/server/controllers/activitypub/inbox.ts
@@ -30,7 +30,7 @@ inboxRouter.post('/inbox',
30 asyncMiddleware(inboxController) 30 asyncMiddleware(inboxController)
31) 31)
32 32
33inboxRouter.post('/:nameWithHost/inbox', 33inboxRouter.post('/account/:name/inbox',
34 signatureValidator, 34 signatureValidator,
35 asyncMiddleware(checkSignature), 35 asyncMiddleware(checkSignature),
36 localAccountValidator, 36 localAccountValidator,
@@ -59,7 +59,9 @@ async function inboxController (req: express.Request, res: express.Response, nex
59 } 59 }
60 60
61 // Only keep activities we are able to process 61 // Only keep activities we are able to process
62 logger.debug('Filtering activities...', { activities })
62 activities = activities.filter(a => isActivityValid(a)) 63 activities = activities.filter(a => isActivityValid(a))
64 logger.debug('We keep %d activities.', activities.length, { activities })
63 65
64 await processActivities(activities, res.locals.account) 66 await processActivities(activities, res.locals.account)
65 67
diff --git a/server/controllers/activitypub/index.ts b/server/controllers/activitypub/index.ts
index 6c7bafc6e..0c8574ef7 100644
--- a/server/controllers/activitypub/index.ts
+++ b/server/controllers/activitypub/index.ts
@@ -4,14 +4,14 @@ import { badRequest } from '../../helpers'
4import { inboxRouter } from './inbox' 4import { inboxRouter } from './inbox'
5import { activityPubClientRouter } from './client' 5import { activityPubClientRouter } from './client'
6 6
7const remoteRouter = express.Router() 7const activityPubRouter = express.Router()
8 8
9remoteRouter.use('/', inboxRouter) 9activityPubRouter.use('/', inboxRouter)
10remoteRouter.use('/', activityPubClientRouter) 10activityPubRouter.use('/', activityPubClientRouter)
11remoteRouter.use('/*', badRequest) 11activityPubRouter.use('/*', badRequest)
12 12
13// --------------------------------------------------------------------------- 13// ---------------------------------------------------------------------------
14 14
15export { 15export {
16 remoteRouter 16 activityPubRouter
17} 17}