1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 09:49:20 +02:00

Serve audit logs to client

This commit is contained in:
Chocobozzz 2019-12-11 14:14:01 +01:00
parent 92e0f42e8c
commit 566c125d6e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
18 changed files with 287 additions and 87 deletions

View file

@ -9,6 +9,7 @@ import { User, VideoAbuse, VideoChannel, VideoDetails, VideoImport } from '../..
import { VideoComment } from '../../shared/models/videos/video-comment.model'
import { CustomConfig } from '../../shared/models/server/custom-config.model'
import { CONFIG } from '../initializers/config'
import { AUDIT_LOG_FILENAME } from '@server/initializers/constants'
function getAuditIdFromRes (res: express.Response) {
return res.locals.oauth.token.User.username
@ -29,7 +30,7 @@ const auditLogger = winston.createLogger({
levels: { audit: 0 },
transports: [
new winston.transports.File({
filename: path.join(CONFIG.STORAGE.LOG_DIR, 'peertube-audit.log'),
filename: path.join(CONFIG.STORAGE.LOG_DIR, AUDIT_LOG_FILENAME),
level: 'audit',
maxsize: 5242880,
maxFiles: 5,