mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-16 04:35:24 +02: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, {
|
||||
host: input.host,
|
||||
...(input.letsEncryptEmail && {
|
||||
letsEncryptEmail: input.letsEncryptEmail,
|
||||
}),
|
||||
letsEncryptEmail: input.letsEncryptEmail,
|
||||
certificateType: input.certificateType,
|
||||
https: input.https,
|
||||
});
|
||||
|
||||
@@ -23,11 +23,18 @@ export const updateServerTraefik = (
|
||||
config.http.routers = config.http.routers || {};
|
||||
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`] || {
|
||||
rule: `Host(\`${newHost}\`)`,
|
||||
service: `${appName}-service-app`,
|
||||
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.services = {
|
||||
|
||||
Reference in New Issue
Block a user