refactor: no need to print safe args as it's already sanitized

This commit is contained in:
Nicolas Meienberger
2025-12-06 10:06:03 +01:00
parent c45b760abc
commit 70c72f0f9a

View File

@@ -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.`);