mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-13 15:35:17 +00:00
fix(settings): simplify letsEncryptEmail assignment and ensure router rule is always updated with new host
This commit is contained in:
@@ -225,9 +225,7 @@ export const settingsRouter = createTRPCRouter({
|
|||||||
}
|
}
|
||||||
const user = await updateUser(ctx.user.ownerId, {
|
const user = await updateUser(ctx.user.ownerId, {
|
||||||
host: input.host,
|
host: input.host,
|
||||||
...(input.letsEncryptEmail && {
|
letsEncryptEmail: input.letsEncryptEmail,
|
||||||
letsEncryptEmail: input.letsEncryptEmail,
|
|
||||||
}),
|
|
||||||
certificateType: input.certificateType,
|
certificateType: input.certificateType,
|
||||||
https: input.https,
|
https: input.https,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,11 +23,18 @@ export const updateServerTraefik = (
|
|||||||
config.http.routers = config.http.routers || {};
|
config.http.routers = config.http.routers || {};
|
||||||
config.http.services = config.http.services || {};
|
config.http.services = config.http.services || {};
|
||||||
|
|
||||||
|
// Get or create router config, but always update the rule with newHost
|
||||||
const currentRouterConfig = config.http.routers[`${appName}-router-app`] || {
|
const currentRouterConfig = config.http.routers[`${appName}-router-app`] || {
|
||||||
rule: `Host(\`${newHost}\`)`,
|
|
||||||
service: `${appName}-service-app`,
|
service: `${appName}-service-app`,
|
||||||
entryPoints: ["web"],
|
entryPoints: ["web"],
|
||||||
|
rule: `Host(\`${newHost}\`)`,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Always update the rule with the new host
|
||||||
|
if (newHost) {
|
||||||
|
currentRouterConfig.rule = `Host(\`${newHost}\`)`;
|
||||||
|
}
|
||||||
|
|
||||||
config.http.routers[`${appName}-router-app`] = currentRouterConfig;
|
config.http.routers[`${appName}-router-app`] = currentRouterConfig;
|
||||||
|
|
||||||
config.http.services = {
|
config.http.services = {
|
||||||
|
|||||||
Reference in New Issue
Block a user