Commit 26f23c0
authored
feat(agent): add Agent Tunnel configuration dialog (#1789)
## Summary
Adds an optional **Agent Tunnel** wizard step to the Devolutions Agent
MSI installer so admins can enrol the agent in a Gateway QUIC tunnel
during install — UI or unattended.
Three text fields in the dialog: enrolment string, advertise subnets,
advertise domains. The feature is opt-in (`isEnabled: false,
allowChange: true`); the dialog is skipped when the feature isn't
selected, and an empty enrolment string skips tunnel setup even if the
feature is on, so the installer remains usable for non-tunnel
deployments.
Smoke-tested end-to-end against a local DVLS + Gateway + Agent stack:
MSI built clean, agent enrolled successfully, RDP TCP traffic routed
through the agent tunnel to `IT-HELP-DC:3389`.
## MSI public properties (unattended install)
```
msiexec /i DevolutionsAgent.msi /qn ADDLOCAL="...,AgentTunnel" \
AGENT_TUNNEL_ENROLLMENT_STRING="dgw-enroll:v1:<base64>" \
AGENT_TUNNEL_ADVERTISE_SUBNETS="10.10.0.0/24" \
AGENT_TUNNEL_ADVERTISE_DOMAINS="corp.example.com"
```
## Custom action
`EnrollAgentTunnel` is deferred + elevated + `Impersonate=false`, runs
`Before StartServices`, gated by
`Features.AGENT_TUNNEL_FEATURE.BeingInstall()`. It:
1. Validates the `dgw-enroll:v1:` prefix, strips whitespace, pads
base64url, decodes JSON payload (`api_base_url`, `enrollment_token`,
optional `name`).
2. Shells out to `devolutions-agent.exe enroll <url> <token> <name>
[subnets]` with a 60s timeout; on timeout the child is killed.
3. Token is redacted (`***`) symmetrically across the command-line log
and child stdout/stderr.
4. After enrolment, advertise domains are patched into
`Tunnel.AdvertiseDomains` of
`%ProgramData%\Devolutions\Agent\agent.json`. This matches the design
that advertise domains live in config, not on the CLI (replaces the
closed #1774).
## Depends on
- #1773 — DVLS-signed JWT enrolment flow (`/jet/tunnel/enroll`)
- #1775 — agent cert renewal (referenced by the bundled agent binary)
Both merged to master 2026-05-20.
## Test plan
- [x] Cold MSI build clean, no errors (8 preexisting
`CNDL1138`/`CNDL1006` warnings from existing code, not introduced here)
- [x] Wizard order: Welcome → Features → AgentTunnel → InstallDir →
VerifyReady
- [x] AgentTunnel dialog skipped when feature not selected
- [x] Empty enrolment string skips enrolment (no failure)
- [x] Invalid `dgw-enroll:v1:` prefix → validation error in dialog
- [x] Invalid base64 → validation error in dialog (caught client-side,
not at CA time)
- [x] Smoke test against local DVLS-signed enrolment JWT — agent
registered, cert issued
- [x] Smoke test routing: RDP TCP through agent tunnel to
`IT-HELP-DC:3389` succeeds
## Review history
Pre-review and codex-review passes folded into the single commit.
Notable points addressed:
- Robust JSON payload parsing (`JObject`, `Value<string>()`,
`IsNullOrWhiteSpace` validation)
- Symmetric token redaction (cmdline + stdout + stderr)
- `WaitForExit(60_000)` return-value check with child kill on timeout
- Whitespace-stripped + padded base64url decoding on both dialog
validation and CA
- ADDLOCAL CSV value trimming for admin-supplied lists with whitespace
- Dropped 2 stray `InstallDirDlg*` strings leaked into en-us
- Added 5 missing fr-fr translations1 parent c606a52 commit 26f23c0
10 files changed
Lines changed: 790 additions & 4 deletions
File tree
- package/AgentWindowsManaged
- Actions
- Dialogs
- Properties
- Resources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
282 | 304 | | |
283 | 305 | | |
284 | 306 | | |
| |||
352 | 374 | | |
353 | 375 | | |
354 | 376 | | |
| 377 | + | |
355 | 378 | | |
356 | 379 | | |
357 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 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 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
321 | 513 | | |
322 | 514 | | |
323 | 515 | | |
| |||
0 commit comments