Skip to content

fix: [#412] include UDP tracker domains in provision output and DNS reminder#419

Merged
josecelano merged 1 commit intotorrust:mainfrom
josecelano:412-fix-udp-tracker-domains-missing-from-provision-output
Apr 6, 2026
Merged

fix: [#412] include UDP tracker domains in provision output and DNS reminder#419
josecelano merged 1 commit intotorrust:mainfrom
josecelano:412-fix-udp-tracker-domains-missing-from-provision-output

Conversation

@josecelano
Copy link
Copy Markdown
Member

Summary

Fixes #412 — UDP tracker domains were missing from the provision command output domains array and the DNS setup reminder.

Root Cause

ProvisionDetailsData and DnsReminderView::extract_all_domains both called ServiceInfo::tls_domain_names(), which only returns domains for TLS-enabled HTTP services. UDP trackers are not TLS services, so their domains were never included.

Changes

src/application/command_handlers/show/info/tracker.rs

  • Added all_domain_names() -> Vec<&str> to ServiceInfo: returns TLS service domains plus UDP tracker domains (when a domain name is configured). IP-only UDP trackers (no domain field) are excluded.
  • Added private helper extract_host_from_udp_url().
  • tls_domain_names() is unchanged — the HTTPS-specific hint still uses it correctly.
  • Added two unit tests:
    • it_should_return_all_domain_names_including_udp
    • it_should_exclude_udp_trackers_without_domain_from_all_domain_names

src/presentation/cli/views/commands/provision/view_data/provision_details.rs

  • From<&Environment<Provisioned>>: replaced tls_domain_names() call with all_domain_names().

src/presentation/cli/views/commands/provision/view_data/dns_reminder.rs

  • extract_all_domains(): replaced tls_domain_names() call with all_domain_names().
  • Added unit test it_should_include_udp_tracker_domains_in_extract_all_domains.

Acceptance Criteria

  • provision output domains array includes UDP tracker domain names when configured
  • provision output domains array does not include IP-only UDP trackers
  • DNS setup reminder also includes UDP tracker domains
  • tls_domain_names() is unchanged
  • Unit tests pass for both UDP-with-domain and UDP-without-domain cases
  • Pre-commit checks pass (./scripts/pre-commit.sh)

Manual E2E Verification

Provisioned a local LXD VM with two UDP trackers each having a domain configured. The provision JSON output returned:

"domains": [
  "udp1.torrust-tracker-demo.com",
  "udp2.torrust-tracker-demo.com"
]

Before the fix this array was empty (no HTTP/TLS services in the test config).

@josecelano josecelano self-assigned this Apr 6, 2026
@josecelano
Copy link
Copy Markdown
Member Author

ACK bca1a2a

@josecelano josecelano merged commit 474486b into torrust:main Apr 6, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: UDP Tracker Domains Missing from provision Output

1 participant