enhancement(metrics): allow disabling via config option
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
committed by
Tilman Vatteroth
parent
a349ddde56
commit
143864b8d9
@@ -179,5 +179,6 @@ module.exports = {
|
||||
// Generated id: "31-good-morning-my-friend---do-you-have-5"
|
||||
// 2nd appearance: "31-good-morning-my-friend---do-you-have-5-1"
|
||||
// 3rd appearance: "31-good-morning-my-friend---do-you-have-5-2"
|
||||
linkifyHeaderStyle: 'keep-case'
|
||||
linkifyHeaderStyle: 'keep-case',
|
||||
enableStatsApi: true
|
||||
}
|
||||
|
||||
@@ -157,5 +157,6 @@ module.exports = {
|
||||
allowEmailRegister: toBooleanConfig(process.env.CMD_ALLOW_EMAIL_REGISTER),
|
||||
allowGravatar: toBooleanConfig(process.env.CMD_ALLOW_GRAVATAR),
|
||||
openID: toBooleanConfig(process.env.CMD_OPENID),
|
||||
linkifyHeaderStyle: process.env.CMD_LINKIFY_HEADER_STYLE
|
||||
linkifyHeaderStyle: process.env.CMD_LINKIFY_HEADER_STYLE,
|
||||
enableStatsApi: toBooleanConfig(process.env.CMD_ENABLE_STATS_API)
|
||||
}
|
||||
|
||||
@@ -24,6 +24,9 @@ statusRouter.get('/_health', function (req, res) {
|
||||
|
||||
// get status
|
||||
statusRouter.get('/status', function (req, res, next) {
|
||||
if (!config.enableStatsApi) {
|
||||
return errors.errorForbidden(res)
|
||||
}
|
||||
realtime.getStatus(function (data) {
|
||||
res.set({
|
||||
'Cache-Control': 'private', // only cache by client
|
||||
|
||||
Reference in New Issue
Block a user