Merge branch 'canary' into 262-ssh-keys-are-not-reusable-after-a-dokploy-update

This commit is contained in:
Mauricio Siu
2024-07-25 02:10:51 -06:00
6 changed files with 39 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
import path from "node:path";
import type { CreateServiceOptions } from "dockerode";
import { dump } from "js-yaml";
@@ -86,6 +86,7 @@ export const initializeTraefik = async () => {
export const createDefaultServerTraefikConfig = () => {
const configFilePath = path.join(DYNAMIC_TRAEFIK_PATH, "dokploy.yml");
if (existsSync(configFilePath)) {
console.log("Default traefik config already exists");
return;
@@ -125,6 +126,11 @@ export const createDefaultServerTraefikConfig = () => {
export const createDefaultTraefikConfig = () => {
const mainConfig = path.join(MAIN_TRAEFIK_PATH, "traefik.yml");
const acmeJsonPath = path.join(DYNAMIC_TRAEFIK_PATH, "acme.json");
if (existsSync(acmeJsonPath)) {
chmodSync(acmeJsonPath, "600");
}
if (existsSync(mainConfig)) {
console.log("Main config already exists");
return;