Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Do not display stream path/key in logs

Chocobozzz9bc627a076ba
diff --git a/server/core/lib/live/live-manager.ts b/server/core/lib/live/live-manager.ts
index ce92e60e7e..1e10c1cccf 100644
--- a/server/core/lib/live/live-manager.ts
+++ b/server/core/lib/live/live-manager.ts
@@ -73,11 +73,12 @@ class LiveManager {
init () {
const events = this.getContext().nodeEvent
events.on('postPublish', (sessionId: string, streamPath: string) => {
- logger.debug('RTMP received stream', { id: sessionId, streamPath, ...lTags(sessionId) })
+ // Don't log streamPath: it contains the stream key, which is a long lived secret
+ logger.debug('RTMP received stream', { id: sessionId, ...lTags(sessionId) })
const splittedPath = streamPath.split('/')
if (splittedPath.length !== 3 || splittedPath[1] !== VIDEO_LIVE.RTMP.BASE_PATH) {
- logger.warn('Live path is incorrect.', { streamPath, ...lTags(sessionId) })
+ logger.warn('Live path is incorrect.', { ...lTags(sessionId) })
return this.abortSession(sessionId)
}
@@ -258,25 +259,26 @@ class LiveManager {
const videoLive = await VideoLiveModel.loadByStreamKey(streamKey)
if (!videoLive) {
- logger.warn('Unknown live video with stream key %s.', streamKey, lTags(sessionId))
+ // Don't log the stream key, which is a long lived secret
+ logger.warn('Unknown live video stream key.', lTags(sessionId))
return this.abortSession(sessionId)
}
const video = videoLive.Video
if (video.isBlacklisted()) {
- logger.warn('Video is blacklisted. Refusing stream %s.', streamKey, lTags(sessionId, video.uuid))
+ logger.warn('Video is blacklisted. Refusing stream of video %s.', video.uuid, lTags(sessionId, video.uuid))
return this.abortSession(sessionId)
}
const user = await UserModel.loadByLiveId(videoLive.id)
if (user.blocked) {
- logger.warn('User is blocked. Refusing stream %s.', streamKey, lTags(sessionId, video.uuid))
+ logger.warn('User is blocked. Refusing stream of video %s.', video.uuid, lTags(sessionId, video.uuid))
return this.abortSession(sessionId)
}
if (this.videoSessions.has(video.uuid)) {
logger.warn(
- `Video ${video.uuid} has already a live session ${this.videoSessions.get(video.uuid)}. Refusing stream ${streamKey}.`,
+ `Video ${video.uuid} has already a live session ${this.videoSessions.get(video.uuid)}. Refusing stream.`,
lTags(sessionId, video.uuid)
)
return this.abortSession(sessionId)
@@ -286,7 +288,7 @@ class LiveManager {
try {
if (videoLive.saveReplay && await isUserQuotaValid({ channelUserId: user.id, uploadSize: 1000 }) !== true) {
- logger.warn('User quota exceeded. Refusing stream %s.', streamKey, lTags(sessionId, video.uuid))
+ logger.warn('User quota exceeded. Refusing stream of video %s.', video.uuid, lTags(sessionId, video.uuid))
try {
await this.saveEndingSession({ videoUUID: video.uuid, error: LiveVideoError.QUOTA_EXCEEDED })
diff --git a/server/core/lib/live/shared/muxing-session.ts b/server/core/lib/live/shared/muxing-session.ts
index 838f1726bf..7dbf6f336a 100644
--- a/server/core/lib/live/shared/muxing-session.ts
+++ b/server/core/lib/live/shared/muxing-session.ts
@@ -437,7 +437,8 @@ class MuxingSession extends EventEmitter implements MuxingSession {
private onTranscodedEnded () {
this.emit('transcoding-end', { videoUUID: this.videoUUID })
- logger.info('RTMP transmuxing for video %s ended. Scheduling cleanup', this.inputLocalUrl, this.lTags())
+ // Don't log the input URL, which contains the stream key (a long lived secret)
+ logger.info('RTMP transmuxing for video %s ended. Scheduling cleanup', this.videoUUID, this.lTags())
setTimeout(() => {
// Wait latest segments generation, and close watchers