Commit 617e8a9
committed
feat(gateway): let a ZT domain validate with dns-persist-01
A gateway CVM running dns-01 holds a Cloudflare token with write access to
the operator's whole zone. Attestation covers what the CVM runs, not what
becomes of a secret it holds, so that token is the widest credential in the
deployment and it exists only to write one TXT record per order.
dns-persist-01 removes it: control comes from a `_validation-persist` record
the operator publishes once, and the CVM never gets DNS write access at all.
`ZtDomainConfig.challenge` picks the method per domain and defaults to
dns-01, so records written before the field existed decode as the method
those deployments were using -- pinned by a test over both the named and the
legacy positional msgpack encodings. Such a domain needs no DNS credential,
and `validation_for` never looks one up for it.
`GetZtDomain` and `ListZtDomains` return the records to publish in
`required_dns_records`, rendered from the stored account URI with no ACME
round trip so the listing endpoints stay cheap; it comes back empty rather
than failing when no account exists yet.
Two operations cannot be self-service for such a domain, and say so rather
than failing silently:
- `SetCaa` skips it and logs the records instead. There is nothing to
reconcile without write access, and one such domain must not make the RPC
unusable for the dns-01 domains beside it; the summary reports how many
were left to the operator.
- `RotateAcmeCredentials` moves the cluster to a new account while every
`_validation-persist` record still names the old one, so orders for those
domains fail until the operator republishes. The response now carries the
new records in `required_dns_records`, rendered after the switch so they
name the account the cluster actually moved to, and `domains_updated`
counts only the domains whose CAA was re-pinned.1 parent eec801b commit 617e8a9
5 files changed
Lines changed: 325 additions & 54 deletions
File tree
- dstack/gateway
- rpc/proto
- src
- kv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
742 | 746 | | |
743 | 747 | | |
744 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
745 | 757 | | |
746 | 758 | | |
747 | 759 | | |
| |||
750 | 762 | | |
751 | 763 | | |
752 | 764 | | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
753 | 769 | | |
754 | 770 | | |
755 | 771 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | | - | |
116 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
554 | 556 | | |
555 | 557 | | |
556 | 558 | | |
| 559 | + | |
557 | 560 | | |
558 | 561 | | |
559 | 562 | | |
560 | 563 | | |
561 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
562 | 568 | | |
563 | 569 | | |
564 | 570 | | |
| |||
573 | 579 | | |
574 | 580 | | |
575 | 581 | | |
576 | | - | |
| 582 | + | |
| 583 | + | |
577 | 584 | | |
578 | 585 | | |
579 | 586 | | |
| |||
591 | 598 | | |
592 | 599 | | |
593 | 600 | | |
594 | | - | |
| 601 | + | |
| 602 | + | |
595 | 603 | | |
596 | 604 | | |
597 | 605 | | |
| |||
608 | 616 | | |
609 | 617 | | |
610 | 618 | | |
611 | | - | |
| 619 | + | |
| 620 | + | |
612 | 621 | | |
613 | 622 | | |
614 | 623 | | |
| |||
976 | 985 | | |
977 | 986 | | |
978 | 987 | | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
979 | 995 | | |
980 | 996 | | |
981 | 997 | | |
982 | 998 | | |
983 | 999 | | |
984 | 1000 | | |
| 1001 | + | |
985 | 1002 | | |
986 | 1003 | | |
987 | 1004 | | |
988 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
989 | 1010 | | |
990 | 1011 | | |
991 | 1012 | | |
992 | 1013 | | |
| 1014 | + | |
993 | 1015 | | |
994 | 1016 | | |
995 | 1017 | | |
| |||
1003 | 1025 | | |
1004 | 1026 | | |
1005 | 1027 | | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1006 | 1033 | | |
1007 | 1034 | | |
1008 | 1035 | | |
1009 | 1036 | | |
1010 | 1037 | | |
1011 | 1038 | | |
1012 | 1039 | | |
| 1040 | + | |
1013 | 1041 | | |
1014 | 1042 | | |
| 1043 | + | |
1015 | 1044 | | |
1016 | 1045 | | |
1017 | 1046 | | |
| |||
0 commit comments