mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge branch 'canary' into feat/better-auth-2
This commit is contained in:
@@ -54,10 +54,16 @@ export const initializePostgres = async () => {
|
||||
version: Number.parseInt(inspect.Version.Index),
|
||||
...settings,
|
||||
});
|
||||
|
||||
console.log("Postgres Started ✅");
|
||||
} catch (_error) {
|
||||
await docker.createService(settings);
|
||||
} catch (_) {
|
||||
try {
|
||||
await docker.createService(settings);
|
||||
} catch (error: any) {
|
||||
if (error?.statusCode !== 409) {
|
||||
throw error;
|
||||
}
|
||||
console.log("Postgres service already exists, continuing...");
|
||||
}
|
||||
console.log("Postgres Not Found: Starting ✅");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -52,8 +52,15 @@ export const initializeRedis = async () => {
|
||||
...settings,
|
||||
});
|
||||
console.log("Redis Started ✅");
|
||||
} catch (_error) {
|
||||
await docker.createService(settings);
|
||||
} catch (_) {
|
||||
try {
|
||||
await docker.createService(settings);
|
||||
} catch (error: any) {
|
||||
if (error?.statusCode !== 409) {
|
||||
throw error;
|
||||
}
|
||||
console.log("Redis service already exists, continuing...");
|
||||
}
|
||||
console.log("Redis Not Found: Starting ✅");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -127,8 +127,15 @@ export const initializeTraefik = async ({
|
||||
});
|
||||
|
||||
console.log("Traefik Started ✅");
|
||||
} catch (_error) {
|
||||
await docker.createService(settings);
|
||||
} catch (error) {
|
||||
try {
|
||||
await docker.createService(settings);
|
||||
} catch (error: any) {
|
||||
if (error?.statusCode !== 409) {
|
||||
throw error;
|
||||
}
|
||||
console.log("Traefik service already exists, continuing...");
|
||||
}
|
||||
console.log("Traefik Not Found: Starting ✅");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -122,13 +122,25 @@ export const createRouterConfig = async (
|
||||
if ((entryPoint === "websecure" && https) || !https) {
|
||||
// redirects
|
||||
for (const redirect of redirects) {
|
||||
const middlewareName = `redirect-${appName}-${redirect.uniqueConfigKey}`;
|
||||
let middlewareName = `redirect-${appName}-${redirect.uniqueConfigKey}`;
|
||||
if (domain.domainType === "preview") {
|
||||
middlewareName = `redirect-${appName.replace(
|
||||
/^preview-(.+)-[^-]+$/,
|
||||
"$1",
|
||||
)}-${redirect.uniqueConfigKey}`;
|
||||
}
|
||||
routerConfig.middlewares?.push(middlewareName);
|
||||
}
|
||||
|
||||
// security
|
||||
if (security.length > 0) {
|
||||
const middlewareName = `auth-${appName}`;
|
||||
let middlewareName = `auth-${appName}`;
|
||||
if (domain.domainType === "preview") {
|
||||
middlewareName = `auth-${appName.replace(
|
||||
/^preview-(.+)-[^-]+$/,
|
||||
"$1",
|
||||
)}`;
|
||||
}
|
||||
routerConfig.middlewares?.push(middlewareName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user