Skip to content

Commit

Permalink
Remove 2 more locations that logged Plex tokens to console
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbenincasa committed Jun 10, 2024
1 parent 805471a commit 2dd9a9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/src/api/programmingApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
6 changes: 4 additions & 2 deletions server/src/ffmpeg/ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 2dd9a9e

Please sign in to comment.