refactor: no need to print safe args as it's already sanitized
This commit is contained in:
parent
b8ae10b316
commit
51ed47c30f
1 changed files with 6 additions and 9 deletions
|
|
@ -37,8 +37,9 @@ const mount = async (config: BackendConfig, path: string) => {
|
|||
const password = await cryptoUtils.decrypt(config.password);
|
||||
|
||||
const source = `//${config.server}/${config.share}`;
|
||||
const baseOptions = [
|
||||
const options = [
|
||||
`user=${config.username}`,
|
||||
`pass=${password}`,
|
||||
`vers=${config.vers}`,
|
||||
`port=${config.port}`,
|
||||
"uid=1000",
|
||||
|
|
@ -46,22 +47,18 @@ const mount = async (config: BackendConfig, path: string) => {
|
|||
];
|
||||
|
||||
if (config.domain) {
|
||||
baseOptions.push(`domain=${config.domain}`);
|
||||
options.push(`domain=${config.domain}`);
|
||||
}
|
||||
|
||||
if (config.readOnly) {
|
||||
baseOptions.push("ro");
|
||||
options.push("ro");
|
||||
}
|
||||
|
||||
const baseArgs = ["-t", "cifs", "-o"];
|
||||
const args = ["-t", "cifs", "-o", options.join(","), source, path];
|
||||
|
||||
logger.debug(`Mounting SMB volume ${path}...`);
|
||||
const safeOptions = [...baseOptions, "pass=***"];
|
||||
const safeArgs = [...baseArgs, safeOptions.join(","), source, path];
|
||||
logger.info(`Executing mount: mount ${safeArgs.join(" ")}`);
|
||||
logger.info(`Executing mount: mount ${args.join(" ")}`);
|
||||
|
||||
const options = [...baseOptions, `pass=${password}`];
|
||||
const args = [...baseArgs, options.join(","), source, path];
|
||||
await executeMount(args);
|
||||
|
||||
logger.info(`SMB volume at ${path} mounted successfully.`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue