Overview
The provision command output includes a domains array listing the configured domain names for the deployed environment. When UDP trackers have domains configured (via the domain field in tracker.udp_trackers[].domain of the environment JSON), those domains are absent from the list. Only HTTP-based service domains appear.
Observed output (Hetzner demo deployment #405):
{
"domains": [
"http1.torrust-tracker-demo.com",
"http2.torrust-tracker-demo.com",
"api.torrust-tracker-demo.com",
"grafana.torrust-tracker-demo.com"
]
}
Expected — UDP domains should also appear:
{
"domains": [
"http1.torrust-tracker-demo.com",
"http2.torrust-tracker-demo.com",
"udp1.torrust-tracker-demo.com",
"udp2.torrust-tracker-demo.com",
"api.torrust-tracker-demo.com",
"grafana.torrust-tracker-demo.com"
]
}
The domains list is used as a DNS-setup reminder — it tells the operator which A/AAAA records need to point at the server IP. A missing UDP domain means the operator does not know they need to create that DNS record.
Root Cause
ProvisionDetailsData::from() in src/presentation/cli/views/commands/provision/view_data/provision_details.rs builds domains by calling services.tls_domain_names():
services
.tls_domain_names() // ← only returns TLS service domains
.iter()
.map(|s| (*s).to_string())
.collect()
tls_domain_names() in src/application/command_handlers/show/info/tracker.rs returns only the tls_domains vector — domains associated with HTTPS services (HTTP trackers with TLS proxy, API with TLS proxy, Grafana). UDP trackers are not TLS services and are never added to tls_domains.
The same issue exists in dns_reminder.rs which also calls tls_domain_names().
Proposed Fix
Add a method all_domain_names() -> Vec<&str> to ServiceInfo that returns both TLS service domain names and UDP tracker domain names (where UdpTrackerConfig::domain() is Some). Update provision_details.rs and dns_reminder.rs to call the new method.
Affected Files
src/application/command_handlers/show/info/tracker.rs — add all_domain_names() to ServiceInfo
src/presentation/cli/views/commands/provision/view_data/provision_details.rs — use all_domain_names()
src/presentation/cli/views/commands/provision/view_data/dns_reminder.rs — use all_domain_names()
Acceptance Criteria
provision output domains array includes UDP tracker domain names when the environment config supplies a domain for UDP trackers
provision output domains array does not include entries for UDP trackers that have no domain configured (IP-only UDP trackers)
- The DNS setup reminder shown after
provision also includes UDP tracker domains
tls_domain_names() is kept unchanged — the HTTPS-specific TLS hint is not affected
- Unit tests for
all_domain_names() cover both the UDP-with-domain and UDP-without-domain cases
- Pre-commit checks pass:
./scripts/pre-commit.sh
Spec
See docs/issues/ for the full issue specification.
Related
Overview
The
provisioncommand output includes adomainsarray listing the configured domain names for the deployed environment. When UDP trackers have domains configured (via thedomainfield intracker.udp_trackers[].domainof the environment JSON), those domains are absent from the list. Only HTTP-based service domains appear.Observed output (Hetzner demo deployment #405):
{ "domains": [ "http1.torrust-tracker-demo.com", "http2.torrust-tracker-demo.com", "api.torrust-tracker-demo.com", "grafana.torrust-tracker-demo.com" ] }Expected — UDP domains should also appear:
{ "domains": [ "http1.torrust-tracker-demo.com", "http2.torrust-tracker-demo.com", "udp1.torrust-tracker-demo.com", "udp2.torrust-tracker-demo.com", "api.torrust-tracker-demo.com", "grafana.torrust-tracker-demo.com" ] }The
domainslist is used as a DNS-setup reminder — it tells the operator whichA/AAAArecords need to point at the server IP. A missing UDP domain means the operator does not know they need to create that DNS record.Root Cause
ProvisionDetailsData::from()insrc/presentation/cli/views/commands/provision/view_data/provision_details.rsbuildsdomainsby callingservices.tls_domain_names():services .tls_domain_names() // ← only returns TLS service domains .iter() .map(|s| (*s).to_string()) .collect()tls_domain_names()insrc/application/command_handlers/show/info/tracker.rsreturns only thetls_domainsvector — domains associated with HTTPS services (HTTP trackers with TLS proxy, API with TLS proxy, Grafana). UDP trackers are not TLS services and are never added totls_domains.The same issue exists in
dns_reminder.rswhich also callstls_domain_names().Proposed Fix
Add a method
all_domain_names() -> Vec<&str>toServiceInfothat returns both TLS service domain names and UDP tracker domain names (whereUdpTrackerConfig::domain()isSome). Updateprovision_details.rsanddns_reminder.rsto call the new method.Affected Files
src/application/command_handlers/show/info/tracker.rs— addall_domain_names()toServiceInfosrc/presentation/cli/views/commands/provision/view_data/provision_details.rs— useall_domain_names()src/presentation/cli/views/commands/provision/view_data/dns_reminder.rs— useall_domain_names()Acceptance Criteria
provisionoutputdomainsarray includes UDP tracker domain names when the environment config supplies adomainfor UDP trackersprovisionoutputdomainsarray does not include entries for UDP trackers that have nodomainconfigured (IP-only UDP trackers)provisionalso includes UDP tracker domainstls_domain_names()is kept unchanged — the HTTPS-specific TLS hint is not affectedall_domain_names()cover both the UDP-with-domain and UDP-without-domain cases./scripts/pre-commit.shSpec
See docs/issues/ for the full issue specification.
Related
docs/deployments/hetzner-demo-tracker/commands/provision/bugs.md