X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=server%2Fhelpers%2Faudit-logger.ts;h=f536da43917345545c5c0df13c0ca0563460a07c;hb=1a12f66d631d28a5a58ebbcd274426f2e6e5d203;hp=db20df20fb53b0638f337a30916bf71c739e4a00;hpb=9a12f169c15b638fe78cf6e85a1993550a25e404;p=oweals%2Fpeertube.git diff --git a/server/helpers/audit-logger.ts b/server/helpers/audit-logger.ts index db20df20f..f536da439 100644 --- a/server/helpers/audit-logger.ts +++ b/server/helpers/audit-logger.ts @@ -1,13 +1,18 @@ import * as path from 'path' +import * as express from 'express' import { diff } from 'deep-object-diff' import { chain } from 'lodash' import * as flatten from 'flat' import * as winston from 'winston' -import { CONFIG } from '../initializers' import { jsonLoggerFormat, labelFormatter } from './logger' -import { VideoDetails, User, VideoChannel, VideoAbuse, VideoImport } from '../../shared' +import { User, VideoAbuse, VideoChannel, VideoDetails, VideoImport } from '../../shared' import { VideoComment } from '../../shared/models/videos/video-comment.model' import { CustomConfig } from '../../shared/models/server/custom-config.model' +import { CONFIG } from '../initializers/config' + +function getAuditIdFromRes (res: express.Response) { + return res.locals.oauth.token.User.username +} enum AUDIT_TYPE { CREATE = 'create', @@ -111,7 +116,8 @@ const videoKeysToKeep = [ 'channel-uuid', 'channel-name', 'support', - 'commentsEnabled' + 'commentsEnabled', + 'downloadEnabled' ] class VideoAuditView extends EntityAuditView { constructor (private video: VideoDetails) { @@ -234,6 +240,7 @@ const customConfigKeysToKeep = [ 'cache-captions-size', 'signup-enabled', 'signup-limit', + 'signup-requiresEmailVerification', 'admin-email', 'user-videoQuota', 'transcoding-enabled', @@ -254,6 +261,8 @@ class CustomConfigAuditView extends EntityAuditView { } export { + getAuditIdFromRes, + auditLoggerFactory, VideoImportAuditView, VideoChannelAuditView,