mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor: no need to print safe args as it's already sanitized
This commit is contained in:
@@ -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.`);
|
||||
|
||||
Reference in New Issue
Block a user