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:
parent
087e2c81cc
commit
54c7572447
@ -90,6 +90,13 @@ export const createDefaultServerTraefikConfig = () => {
|
||||
console.log("Default traefik config already exists");
|
||||
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 serviceURLDefault = `http://${appName}:${process.env.PORT || 3000}`;
|
||||
@ -184,13 +191,6 @@ export const createDefaultTraefikConfig = () => {
|
||||
const yamlStr = dump(configObject);
|
||||
mkdirSync(MAIN_TRAEFIK_PATH, { recursive: true });
|
||||
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 = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user