mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-09-12 19:51:00 +05:00
fix: redact SFTP key passphrases
This commit is contained in:
parent
28cc54a6f2
commit
66c1ceb7ce
@ -1,12 +1,11 @@
|
||||
/**
|
||||
* Redacts credentials from rclone command strings before they reach logs or
|
||||
* user-facing error output. Handles both the existing S3 flags and the
|
||||
* provider-specific FTP/SFTP password flags generated by the destination
|
||||
* builder.
|
||||
* provider-specific FTP/SFTP credential flags used by backup destinations.
|
||||
*/
|
||||
export const redactRcloneCredentials = (command: string): string => {
|
||||
return command.replace(
|
||||
/(--(?:s3-access-key-id|s3-secret-access-key|ftp-pass|sftp-pass)=)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s]+)/g,
|
||||
/(--(?:s3-access-key-id|s3-secret-access-key|ftp-pass|sftp-pass|sftp-key-file-pass)=)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s]+)/g,
|
||||
'$1"[REDACTED]"',
|
||||
);
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user