diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-14 17:31:26 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 350e31d6b64e4973dfa5e9f7b46841cb09aeb1ad (patch) | |
tree | f4191f3c04a5230fcf8ca3d6ca3248643fc4151d /server/controllers/activitypub | |
parent | e34c85e527100c0b5c44567bd951e95be41b8d7e (diff) | |
download | PeerTube-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.ts | 4 | ||||
-rw-r--r-- | server/controllers/activitypub/inbox.ts | 4 | ||||
-rw-r--r-- | server/controllers/activitypub/index.ts | 10 |
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 | ||
19 | activityPubClientRouter.get('/account/:nameWithHost/followers', | 19 | activityPubClientRouter.get('/account/:name/followers', |
20 | executeIfActivityPub(localAccountValidator), | 20 | executeIfActivityPub(localAccountValidator), |
21 | executeIfActivityPub(asyncMiddleware(accountFollowersController)) | 21 | executeIfActivityPub(asyncMiddleware(accountFollowersController)) |
22 | ) | 22 | ) |
23 | 23 | ||
24 | activityPubClientRouter.get('/account/:nameWithHost/following', | 24 | activityPubClientRouter.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 | ||
33 | inboxRouter.post('/:nameWithHost/inbox', | 33 | inboxRouter.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' | |||
4 | import { inboxRouter } from './inbox' | 4 | import { inboxRouter } from './inbox' |
5 | import { activityPubClientRouter } from './client' | 5 | import { activityPubClientRouter } from './client' |
6 | 6 | ||
7 | const remoteRouter = express.Router() | 7 | const activityPubRouter = express.Router() |
8 | 8 | ||
9 | remoteRouter.use('/', inboxRouter) | 9 | activityPubRouter.use('/', inboxRouter) |
10 | remoteRouter.use('/', activityPubClientRouter) | 10 | activityPubRouter.use('/', activityPubClientRouter) |
11 | remoteRouter.use('/*', badRequest) | 11 | activityPubRouter.use('/*', badRequest) |
12 | 12 | ||
13 | // --------------------------------------------------------------------------- | 13 | // --------------------------------------------------------------------------- |
14 | 14 | ||
15 | export { | 15 | export { |
16 | remoteRouter | 16 | activityPubRouter |
17 | } | 17 | } |