import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo'
import { join } from 'path'
import { root } from '../helpers/core-utils'
+import { getEnabledResolutions } from '../lib/video-transcoding'
import { CONFIG, isEmailEnabled } from '../initializers/config'
import { getPreview, getVideoCaption } from './lazy-static'
import { VideoStreamingPlaylistType } from '@shared/models/videos/video-streaming-playlist.type'
import { MVideoFile, MVideoFullLight } from '@server/types/models'
import { getTorrentFilePath, getVideoFilePath } from '@server/lib/video-paths'
import { getThemeOrDefault } from '../lib/plugins/theme-utils'
-import { getEnabledResolutions, getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
+import { getRegisteredPlugins, getRegisteredThemes } from '@server/controllers/api/config'
import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
+import { serveIndexHTML } from '@server/lib/client-html'
const staticRouter = express.Router()
}
)
+staticRouter.all('/teapot',
+ getCup,
+ asyncMiddleware(serveIndexHTML)
+)
+
// security.txt service
staticRouter.get('/security.txt',
(_, res: express.Response) => {
async function generateNodeinfo (req: express.Request, res: express.Response) {
const { totalVideos } = await VideoModel.getStats()
const { totalLocalVideoComments } = await VideoCommentModel.getStats()
- const { totalUsers } = await UserModel.getStats()
+ const { totalUsers, totalMonthlyActiveUsers, totalHalfYearActiveUsers } = await UserModel.getStats()
let json = {}
if (req.params.version && (req.params.version === '2.0')) {
openRegistrations: CONFIG.SIGNUP.ENABLED,
usage: {
users: {
- total: totalUsers
+ total: totalUsers,
+ activeMonth: totalMonthlyActiveUsers,
+ activeHalfyear: totalHalfYearActiveUsers
},
localPosts: totalVideos,
localComments: totalLocalVideoComments
return Object.assign(playlist, { Video: video })
}
+
+function getCup (req: express.Request, res: express.Response, next: express.NextFunction) {
+ res.status(HttpStatusCode.I_AM_A_TEAPOT_418)
+ res.setHeader('Accept-Additions', 'Non-Dairy;1,Sugar;1')
+ res.setHeader('Safe', 'if-sepia-awake')
+
+ return next()
+}