]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/controllers/api/server/debug.ts
Add new plugin/peertube version notifs
[github/Chocobozzz/PeerTube.git] / server / controllers / api / server / debug.ts
CommitLineData
fae6e4da 1import { InboxManager } from '@server/lib/activitypub/inbox-manager'
5d79474c
C
2import * as express from 'express'
3import { UserRight } from '../../../../shared/models/users'
a1587156 4import { authenticate, ensureUserHasRight } from '../../../middlewares'
5d79474c
C
5
6const debugRouter = express.Router()
7
8debugRouter.get('/debug',
9 authenticate,
10 ensureUserHasRight(UserRight.MANAGE_DEBUG),
a1587156 11 getDebug
5d79474c
C
12)
13
14// ---------------------------------------------------------------------------
15
16export {
17 debugRouter
18}
19
20// ---------------------------------------------------------------------------
21
a1587156 22function getDebug (req: express.Request, res: express.Response) {
5d79474c 23 return res.json({
fae6e4da
C
24 ip: req.ip,
25 activityPubMessagesWaiting: InboxManager.Instance.getActivityPubMessagesWaiting()
26 })
5d79474c 27}