mirror of
https://github.com/unraid/api.git
synced 2026-01-03 15:09:48 -06:00
fix: some redaction and fix constructor
This commit is contained in:
@@ -28,10 +28,25 @@ const stream =
|
||||
export const logger = pino(
|
||||
{
|
||||
level,
|
||||
timestamp: () => `,"time":"${new Date().toISOString()}"`,
|
||||
timestamp: () => `,"time":"${new Date().toISOString()}",`,
|
||||
formatters: {
|
||||
level: (label: string) => ({ level: label }),
|
||||
},
|
||||
redact: {
|
||||
paths: [
|
||||
'*.password',
|
||||
'*.pass',
|
||||
'*.secret',
|
||||
'*.token',
|
||||
'*.key',
|
||||
'*.Password',
|
||||
'*.Pass',
|
||||
'*.Secret',
|
||||
'*.Token',
|
||||
'*.Key',
|
||||
],
|
||||
censor: '***REDACTED***',
|
||||
},
|
||||
},
|
||||
stream
|
||||
);
|
||||
|
||||
@@ -49,14 +49,11 @@ export class RCloneApiService implements OnModuleInit, OnModuleDestroy {
|
||||
private rcloneSocketPath: string = '';
|
||||
private rcloneBaseUrl: string = '';
|
||||
private rcloneProcess: ChildProcess | null = null;
|
||||
private readonly rcloneUsername: string;
|
||||
private readonly rclonePassword: string;
|
||||
constructor(username?: string, password?: string) {
|
||||
this.rcloneUsername =
|
||||
username || process.env.RCLONE_USERNAME || crypto.randomBytes(12).toString('base64');
|
||||
this.rclonePassword =
|
||||
password || process.env.RCLONE_PASSWORD || crypto.randomBytes(24).toString('base64');
|
||||
}
|
||||
private readonly rcloneUsername: string =
|
||||
process.env.RCLONE_USERNAME || crypto.randomBytes(12).toString('base64');
|
||||
private readonly rclonePassword: string =
|
||||
process.env.RCLONE_PASSWORD || crypto.randomBytes(24).toString('base64');
|
||||
constructor() {}
|
||||
|
||||
async onModuleInit(): Promise<void> {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user