diff --git a/server/src/api/programmingApi.ts b/server/src/api/programmingApi.ts index 328752e75..5d246d915 100644 --- a/server/src/api/programmingApi.ts +++ b/server/src/api/programmingApi.ts @@ -141,7 +141,7 @@ export const programmingApi: RouterPluginAsyncCallback = async (fastify) => { if (isAxiosError(e) && e.response?.status === 404) { logger.error( 'Error retrieving thumb from Plex at url: %s. Status: 404', - result, + result.replaceAll(server.accessToken, 'REDACTED_TOKEN'), ); return res.status(404).send(); } diff --git a/server/src/ffmpeg/ffmpeg.ts b/server/src/ffmpeg/ffmpeg.ts index efeb334e3..5c42eb29c 100644 --- a/server/src/ffmpeg/ffmpeg.ts +++ b/server/src/ffmpeg/ffmpeg.ts @@ -826,8 +826,10 @@ export class FFMPEG extends (events.EventEmitter as new () => TypedEventEmitter< return; } - // TODO: Redact Plex tokens here - this.logger.debug(`Starting ffmpeg with args: "${ffmpegArgs.join(' ')}"`); + const argsWithTokenRedacted = ffmpegArgs + .join(' ') + .replaceAll(/(.*X-Plex-Token=)([A-z0-9_\\-]+)(.*)/g, '$1REDACTED$3'); + this.logger.debug(`Starting ffmpeg with args: "%s"`, argsWithTokenRedacted); this.ffmpeg = spawn(this.ffmpegPath, ffmpegArgs, { stdio: ['ignore', 'pipe', 'pipe'],