fix: ssh permission

This commit is contained in:
Lorenzo Migliorero
2024-07-26 10:11:38 +02:00
parent 7e39be4ca1
commit bda0689e18

View File

@@ -1,3 +1,4 @@
import { spawnSync } from "node:child_process";
import { chmodSync, existsSync, mkdirSync } from "node:fs"; import { chmodSync, existsSync, mkdirSync } from "node:fs";
import { import {
APPLICATIONS_PATH, APPLICATIONS_PATH,
@@ -33,7 +34,17 @@ export const setupDirectories = () => {
try { try {
createDirectoryIfNotExist(dir); createDirectoryIfNotExist(dir);
if (dir === SSH_PATH) { if (dir === SSH_PATH) {
chmodSync(SSH_PATH, "600"); /* Changing SSH Keys permission to 600 keeping the SSH folder writable */
spawnSync("find", [
SSH_PATH,
"-type",
"f",
"-exec",
"chmod",
"600",
"{}",
";",
]);
} }
} catch (error) { } catch (error) {
console.log(error, " On path: ", dir); console.log(error, " On path: ", dir);