mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
check if exist
Check if the file already exist, if yes modify its mode
This commit is contained in:
@@ -90,6 +90,13 @@ export const createDefaultServerTraefikConfig = () => {
|
|||||||
console.log("Default traefik config already exists");
|
console.log("Default traefik config already exists");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const acmeJsonPath = "/etc/dokploy/traefik/dynamic/acme.json";
|
||||||
|
if (existsSync(acmeJsonPath)) {
|
||||||
|
chmodSync(acmeJsonPath, '600');
|
||||||
|
} else {
|
||||||
|
console.error(`File not found: ${acmeJsonPath}`);
|
||||||
|
}
|
||||||
|
|
||||||
const appName = "dokploy";
|
const appName = "dokploy";
|
||||||
const serviceURLDefault = `http://${appName}:${process.env.PORT || 3000}`;
|
const serviceURLDefault = `http://${appName}:${process.env.PORT || 3000}`;
|
||||||
@@ -184,13 +191,6 @@ export const createDefaultTraefikConfig = () => {
|
|||||||
const yamlStr = dump(configObject);
|
const yamlStr = dump(configObject);
|
||||||
mkdirSync(MAIN_TRAEFIK_PATH, { recursive: true });
|
mkdirSync(MAIN_TRAEFIK_PATH, { recursive: true });
|
||||||
writeFileSync(mainConfig, yamlStr, "utf8");
|
writeFileSync(mainConfig, yamlStr, "utf8");
|
||||||
|
|
||||||
const acmeJsonPath = "/etc/dokploy/traefik/dynamic/acme.json";
|
|
||||||
if (existsSync(acmeJsonPath)) {
|
|
||||||
chmodSync(acmeJsonPath, '600');
|
|
||||||
} else {
|
|
||||||
console.error(`File not found: ${acmeJsonPath}`);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createDefaultMiddlewares = () => {
|
export const createDefaultMiddlewares = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user