feat: initial commit

This commit is contained in:
Mauricio Siu
2024-04-28 23:57:52 -06:00
parent 8857a20344
commit be56ba046c
412 changed files with 60777 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
import { existsSync, mkdirSync } from "node:fs";
import {
APPLICATIONS_PATH,
BASE_PATH,
CERTIFICATES_PATH,
LOGS_PATH,
MONITORING_PATH,
SSH_PATH,
DYNAMIC_TRAEFIK_PATH,
MAIN_TRAEFIK_PATH,
} from "../constants";
const createDirectoryIfNotExist = (dirPath: string) => {
if (!existsSync(dirPath)) {
mkdirSync(dirPath, { recursive: true });
console.log(`Directory created: ${dirPath}`);
}
};
export const setupDirectories = () => {
const directories = [
BASE_PATH,
MAIN_TRAEFIK_PATH,
DYNAMIC_TRAEFIK_PATH,
LOGS_PATH,
APPLICATIONS_PATH,
SSH_PATH,
CERTIFICATES_PATH,
MONITORING_PATH,
];
for (const dir of directories) {
try {
createDirectoryIfNotExist(dir);
} catch (error) {
console.log(error, " On path: ", dir);
}
}
};