From 7a55eef1e28bc55c9b89e42343ed68d1170c4d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= Date: Tue, 24 Mar 2026 15:20:46 -0300 Subject: [PATCH 1/7] Fix default user password reset email template --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index a8a3d3f7bd4f..2bd29471fb64 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -33,3 +33,6 @@ UPDATE `cloud`.`alert` SET type = 34 WHERE name = 'ALERT.VR.PRIVATE.IFACE.MTU'; -- Update configuration 'kvm.ssh.to.agent' description and is_dynamic fields UPDATE `cloud`.`configuration` SET description = 'True if the management server will restart the agent service via SSH into the KVM hosts after or during maintenance operations', is_dynamic = 1 WHERE name = 'kvm.ssh.to.agent'; + +-- Update `user.password.reset.mail.template` configuration value to follow new logic +UPDATE configuration SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' WHERE value REGEXP '^Hello \\{\\{username\\}\\}!\\nYou have requested to reset your password\\. Please click the following link to reset your password:\\n(http://\\{\\{\\{resetLink\\}\\}\\}|\\{\\{\\{domainUrl\\}\\}\\}\\{\\{\\{resetLink\\}\\}\\})\\nIf you did not request a password reset, please ignore this email\\.\\n\\nRegards,\\nThe CloudStack Team$'; \ No newline at end of file From 34cb3b6d39b1a3083fa50c6b318a70943cf42137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= Date: Tue, 24 Mar 2026 15:32:12 -0300 Subject: [PATCH 2/7] improve readabilty --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index 2bd29471fb64..9648ea94c11d 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -35,4 +35,7 @@ UPDATE `cloud`.`alert` SET type = 34 WHERE name = 'ALERT.VR.PRIVATE.IFACE.MTU'; UPDATE `cloud`.`configuration` SET description = 'True if the management server will restart the agent service via SSH into the KVM hosts after or during maintenance operations', is_dynamic = 1 WHERE name = 'kvm.ssh.to.agent'; -- Update `user.password.reset.mail.template` configuration value to follow new logic -UPDATE configuration SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' WHERE value REGEXP '^Hello \\{\\{username\\}\\}!\\nYou have requested to reset your password\\. Please click the following link to reset your password:\\n(http://\\{\\{\\{resetLink\\}\\}\\}|\\{\\{\\{domainUrl\\}\\}\\}\\{\\{\\{resetLink\\}\\}\\})\\nIf you did not request a password reset, please ignore this email\\.\\n\\nRegards,\\nThe CloudStack Team$'; \ No newline at end of file +UPDATE configuration +SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' +WHERE value + REGEXP '^Hello \\{\\{username\\}\\}!\\nYou have requested to reset your password\\. Please click the following link to reset your password:\\n(http://\\{\\{\\{resetLink\\}\\}\\}|\\{\\{\\{domainUrl\\}\\}\\}\\{\\{\\{resetLink\\}\\}\\})\\nIf you did not request a password reset, please ignore this email\\.\\n\\nRegards,\\nThe CloudStack Team$'; \ No newline at end of file From 29e28c2e23d9a1c3f2c8c9c3d0d0c08826d3eedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= Date: Tue, 24 Mar 2026 15:49:00 -0300 Subject: [PATCH 3/7] change update query --- .../resources/META-INF/db/schema-42200to42210.sql | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index 9648ea94c11d..313f3283c7f1 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -34,8 +34,10 @@ UPDATE `cloud`.`alert` SET type = 34 WHERE name = 'ALERT.VR.PRIVATE.IFACE.MTU'; -- Update configuration 'kvm.ssh.to.agent' description and is_dynamic fields UPDATE `cloud`.`configuration` SET description = 'True if the management server will restart the agent service via SSH into the KVM hosts after or during maintenance operations', is_dynamic = 1 WHERE name = 'kvm.ssh.to.agent'; --- Update `user.password.reset.mail.template` configuration value to follow new logic -UPDATE configuration -SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' -WHERE value - REGEXP '^Hello \\{\\{username\\}\\}!\\nYou have requested to reset your password\\. Please click the following link to reset your password:\\n(http://\\{\\{\\{resetLink\\}\\}\\}|\\{\\{\\{domainUrl\\}\\}\\}\\{\\{\\{resetLink\\}\\}\\})\\nIf you did not request a password reset, please ignore this email\\.\\n\\nRegards,\\nThe CloudStack Team$'; \ No newline at end of file +-- Update `user.password.reset.mail.template` configuration value to match new logic +update configuration +set value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' +where value in ( + 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', + 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{domainUrl}}}{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' +) \ No newline at end of file From 4c6157bae3ab0c2564d36d2496697d6b5890c59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= <89930804+erikbocks@users.noreply.github.com> Date: Thu, 26 Mar 2026 09:44:20 -0300 Subject: [PATCH 4/7] Apply suggestion from @GaOrtiga Co-authored-by: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com> --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index ace89cff32e4..c699afe0b997 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -37,9 +37,9 @@ UPDATE `cloud`.`configuration` SET description = 'True if the management server UPDATE `cloud`.`vm_template` SET guest_os_id = 99 WHERE name = 'kvm-default-vm-import-dummy-template'; -- Update `user.password.reset.mail.template` configuration value to match new logic -update configuration -set value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' -where value in ( +UPDATE configuration +SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' +WHERE value IN ( 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{domainUrl}}}{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' ) \ No newline at end of file From d9bd43e0bf3b50ff72a84a45689d826c7b6f9145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= <89930804+erikbocks@users.noreply.github.com> Date: Thu, 26 Mar 2026 10:13:11 -0300 Subject: [PATCH 5/7] Add newline at the end of file Co-authored-by: Suresh Kumar Anaparti --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index c699afe0b997..ebe49a46443b 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -42,4 +42,4 @@ SET value = 'Hello {{username}}!\nYou have requested to reset your password. Ple WHERE value IN ( 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{domainUrl}}}{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' -) \ No newline at end of file +) From 29cb0b9def3eb374dd3debcd9ec6e8f1cffacb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= <89930804+erikbocks@users.noreply.github.com> Date: Thu, 26 Mar 2026 13:26:05 -0300 Subject: [PATCH 6/7] Specify database for update Co-authored-by: Suresh Kumar Anaparti --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index ebe49a46443b..7947eb39603d 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -37,7 +37,7 @@ UPDATE `cloud`.`configuration` SET description = 'True if the management server UPDATE `cloud`.`vm_template` SET guest_os_id = 99 WHERE name = 'kvm-default-vm-import-dummy-template'; -- Update `user.password.reset.mail.template` configuration value to match new logic -UPDATE configuration +UPDATE `cloud`.`configuration` SET value = 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' WHERE value IN ( 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', From c7c48f18da3ddec0c10dcc9815eb89690023ae44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20B=C3=B6ck?= <89930804+erikbocks@users.noreply.github.com> Date: Fri, 27 Mar 2026 15:16:48 -0300 Subject: [PATCH 7/7] Address Ortiga's review Co-authored-by: GaOrtiga <49285692+GaOrtiga@users.noreply.github.com> --- .../src/main/resources/META-INF/db/schema-42200to42210.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql index 7947eb39603d..e8528d8a80f6 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-42200to42210.sql @@ -42,4 +42,4 @@ SET value = 'Hello {{username}}!\nYou have requested to reset your password. Ple WHERE value IN ( 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\nhttp://{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team', 'Hello {{username}}!\nYou have requested to reset your password. Please click the following link to reset your password:\n{{{domainUrl}}}{{{resetLink}}}\nIf you did not request a password reset,please ignore this email.\n\nRegards,\nThe CloudStack Team' -) +);