]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/audit-logger.ts
Proxy youtube-dl format command too
[github/Chocobozzz/PeerTube.git] / server / helpers / audit-logger.ts
index a121f0b8a1420d0bc783fc331918ce09b3ebd8ab..9b258dc3ae86bca21c848953e27566ceeb5452a9 100644 (file)
@@ -4,15 +4,15 @@ 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 { UserModel } from '../models/account/user'
+import { CONFIG } from '../initializers/config'
+import { AUDIT_LOG_FILENAME } from '@server/initializers/constants'
 
 function getAuditIdFromRes (res: express.Response) {
-  return (res.locals.oauth.token.User as UserModel).username
+  return res.locals.oauth.token.User.username
 }
 
 enum AUDIT_TYPE {
@@ -30,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,