Commit 474486b
committed
bca1a2a fix: [#412] include UDP tracker domains in provision output and DNS reminder (Jose Celano)
Pull request description:
## 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
- [x] `provision` output `domains` array includes UDP tracker domain names when configured
- [x] `provision` output `domains` array does **not** include IP-only UDP trackers
- [x] DNS setup reminder also includes UDP tracker domains
- [x] `tls_domain_names()` is unchanged
- [x] Unit tests pass for both UDP-with-domain and UDP-without-domain cases
- [x] 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:
```json
"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).
ACKs for top commit:
josecelano:
ACK bca1a2a
Tree-SHA512: f0daddf56123107282f4ff3461642376cb5572aa08005b351660c20684629c7c42cb7b68446016af303331e7a4e11c4cc643e4645c835f857132197d5a44bda2
3 files changed
Lines changed: 126 additions & 4 deletions
File tree
- src
- application/command_handlers/show/info
- presentation/cli/views/commands/provision/view_data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
332 | 373 | | |
333 | 374 | | |
334 | 375 | | |
| |||
519 | 560 | | |
520 | 561 | | |
521 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
522 | 619 | | |
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | 161 | | |
164 | | - | |
| 162 | + | |
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
| |||
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
241 | 266 | | |
242 | 267 | | |
243 | 268 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments