Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Nov 14, 2025

Description

This PR fixes the url in password reset email. (regression from #11379)

Fixes #12050

Doc PR: apache/cloudstack-documentation#621

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.60%. Comparing base (4379666) to head (538344d).
⚠️ Report is 127 commits behind head on 4.22.

Files with missing lines Patch % Lines
.../java/com/cloud/utils/server/ServerProperties.java 0.00% 18 Missing ⚠️
.../cloudstack/user/UserPasswordResetManagerImpl.java 0.00% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              4.22   #12078       +/-   ##
============================================
+ Coverage     3.58%   17.60%   +14.01%     
- Complexity       0    15613    +15613     
============================================
  Files          445     5911     +5466     
  Lines        37536   529987   +492451     
  Branches      6905    64751    +57846     
============================================
+ Hits          1346    93278    +91932     
- Misses       36024   426209   +390185     
- Partials       166    10500    +10334     
Flag Coverage Δ
uitests 3.60% <ø> (+0.01%) ⬆️
unittests 18.66% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a regression in the password reset email URL functionality introduced in PR #11379. The URL construction was broken because the domain URL was being included twice in the email template.

Key changes:

  • Consolidated URL construction logic to build the complete reset link in code rather than in the email template
  • Added fallback to use ManagementServerAddresses when UserPasswordResetDomainURL is not configured
  • Added trailing slash removal to ensure clean URL formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15767

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks generally good, one question.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-14834)

@vladimirpetrov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@vladimirpetrov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14862)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 48886 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12078-t14862-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sureshanaparti sureshanaparti marked this pull request as ready for review December 2, 2025 10:28
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sureshanaparti

As discussed please add http before the domain or management IP to make sure the link is clickable

Please check the screenshot

with domainurl

Screenshot 2025-12-05 at 5 51 56 PM

Without domainurl

Screenshot 2025-12-05 at 5 57 02 PM

@davift
Copy link

davift commented Dec 6, 2025

Hi @sureshanaparti

As discussed please add http before the domain or management IP to make sure the link is clickable

Please check the screenshot

with domainurl

Screenshot 2025-12-05 at 5 51 56 PM Without domainurl Screenshot 2025-12-05 at 5 57 02 PM

dear @kiranchavala and @sureshanaparti ,

I appreciated the checks for the presence of http:// or https://, as well as the logic to apply a default when neither is provided. My recommendation would be to always default to https:// and require users to manually choose a less secure option if they really need it.

This mindset should be applied universally, as users tend to accept whatever the default is. Beyond the general risk of “rogue Wi-Fi” exposing password-reset links, browsers are increasingly moving toward HTTPS-first behavior, and email filters/inspection systems are becoming more suspicious of plain-text HTTP URLs.

Please understand this as purely constructive feedback.

@sureshanaparti
Copy link
Contributor Author

sureshanaparti commented Dec 8, 2025

Hi @sureshanaparti
As discussed please add http before the domain or management IP to make sure the link is clickable
Please check the screenshot
with domainurl

dear @kiranchavala and @sureshanaparti ,

I appreciated the checks for the presence of http:// or https://, as well as the logic to apply a default when neither is provided. My recommendation would be to always default to https:// and require users to manually choose a less secure option if they really need it.

This mindset should be applied universally, as users tend to accept whatever the default is. Beyond the general risk of “rogue Wi-Fi” exposing password-reset links, browsers are increasingly moving toward HTTPS-first behavior, and email filters/inspection systems are becoming more suspicious of plain-text HTTP URLs.

Please understand this as purely constructive feedback.

@davift thanks for the feedback. earlier the password reset link was defaulted to http://, so I've considered the same. Now, I updated the scheme based on the https.enabled flag in server.properties file in the management server (as SSL is enabled when it is set - https://docs.cloudstack.apache.org/en/4.22.0.0/installguide/optional_installation.html#ssl-optional).

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15945

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-14921)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59983 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12078-t14921-kvm-ol8.zip
Smoke tests completed. 143 look OK, 6 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_arping_in_ssvm Failure 5.21 test_diagnostics.py
test_uservm_host_control_state Failure 17.13 test_host_control_state.py
ContextSuite context=TestHostControlState>:teardown Error 32.77 test_host_control_state.py
test_02_list_cpvm_vm Failure 0.05 test_ssvm.py
test_04_cpvm_internals Failure 0.06 test_ssvm.py
test_01_vpn_usage Error 1.11 test_usage.py
test_02_unsecure_vm_migration Error 357.95 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 357.96 test_vm_life_cycle.py
test_08_migrate_vm Error 20.29 test_vm_life_cycle.py
test_01_migrate_vm_strict_tags_success Error 25.42 test_vm_strict_host_tags.py

return properties;
}

public static boolean isHttpsEnabled() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, it will be better to set a variable during initialization and just return that. Updating https and other things, require restarting server anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's already set in ServerDaemon, but not directly accessible. so checking it through server properties where the config is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vishesh92 update, please check.

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments.

@RosiKyu RosiKyu self-assigned this Jan 26, 2026
@kiranchavala kiranchavala self-assigned this Jan 27, 2026
@RosiKyu RosiKyu removed their assignment Jan 27, 2026
@kiranchavala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16555

Copy link
Member

@vishesh92 vishesh92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@vishesh92
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16559

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested with no value in user.password.reset.mail.domain.url

Screenshot 2026-01-28 at 2 10 29 PM

Tested with value user.password.reset.mail.domain.url set to kiranchavala.in

HTTP got appened

Screenshot 2026-01-28 at 2 10 22 PM

Tested with value user.password.reset.mail.domain.url to set to a port kiranchavala.in:908

Screenshot 2026-01-28 at 2 17 44 PM

Tested with value user.password.reset.mail.domain.url set to https

Screenshot 2026-01-28 at 2 19 12 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Password Reset Email Template Ignores {{domainUrl}} Variable in CloudStack 4.22]

9 participants