Linked zones: shared records kept in step across views
Zones of the same name in different views can be linked. Shared records
are kept in step: a change in one view reaches the others in the same
changeset, as explicit operations, so the diff, permission checks,
history and undo cover every view. Records local to a view override the
shared records of that name and type there; removing the override brings
the shared ones back, and sharing a view's version makes it every view's.
Each zone keeps its own options, serial and file.
Linking existing zones changes no answer: what is the same everywhere
becomes shared, the rest stays local. Unlinking keeps every record, all
local. ACME challenges are written once per link, and --view all changes
a link once. jarl zone link/unlink, zone create --link-with, record
--local/--shared, LINK column, web UI controls, POST /zones/{zone}/link
and /unlink, validation checks linked_*, store migration 11, docs and
e2e.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6313fa51f8
commit
057433c198
31 files changed
+1729
-55
No files matched your search
@@ -388,6 +388,40 @@ expect_dig "unsigned from here: the internal view" "127.0.0.1" ns1.adbraun.test
|
||||
expect_dig "signed with the external view's key" "203.0.113.1" -k $E/external.key ns1.adbraun.test A
|
||||
run "view key shows a dig command" 0 $J view key external
|
||||
contains "dig -y hmac-sha256:jarl-view-external:"
|
||||
# Linked zones (docs/views.md#linked-zones): the same zone in both views,
|
||||
# shared records kept in step, local ones per view.
|
||||
run "zone link: what is the same is shared" 0 $J zone link adbraun.test --view internal --with external
|
||||
contains "differ between the views and stay local"
|
||||
run "zone show names the link" 0 $J zone show adbraun.test --view external
|
||||
contains "Linked with: *internal"
|
||||
run "record list shows shared and local" 0 $J record list adbraun.test --view external
|
||||
contains "ns1 *[0-9]*\\* *A *local *203.0.113.1"
|
||||
contains "@ *[0-9]*\\* *NS *shared"
|
||||
run "a shared add in internal" 0 $J record add adbraun.test linked A 198.51.100.7 --view internal
|
||||
expect_dig "reaches the external view" "198.51.100.7" -k $E/external.key linked.adbraun.test A
|
||||
expect_dig "and is in the internal view" "198.51.100.7" linked.adbraun.test A
|
||||
run "a local override in internal" 0 $J record add adbraun.test linked A 10.1.1.1 --view internal --local
|
||||
expect_dig "internal answers its own" "10.1.1.1" linked.adbraun.test A
|
||||
expect_dig "external keeps the shared one" "198.51.100.7" -k $E/external.key linked.adbraun.test A
|
||||
LID=$($J record list adbraun.test --view internal --name linked -o id)
|
||||
run "share internal's version" 0 $J record update $LID --shared
|
||||
expect_dig "now every view's" "10.1.1.1" -k $E/external.key linked.adbraun.test A
|
||||
run "--view all changes a link once" 0 $J record set adbraun.test linked A 10.1.1.2 --view all
|
||||
contains "linked with internal"
|
||||
expect_dig "both views" "10.1.1.2" -k $E/external.key linked.adbraun.test A
|
||||
run "a shared delete" 0 $J record delete adbraun.test linked A --view external -y
|
||||
expect_dig "gone from internal too" "" linked.adbraun.test A
|
||||
run "zone unlink" 0 $J zone unlink adbraun.test --view external
|
||||
run "unlinked: no link column" 0 $J record list adbraun.test --view external
|
||||
not_contains "shared"
|
||||
run "zone create --link-with: a linked copy" 0 $J zone create linkcopy.test --view internal --ns ns1.adbraun.test.
|
||||
run "a record in it" 0 $J record add linkcopy.test www A 192.0.2.80 --view internal
|
||||
run "copy it into external, linked" 0 $J zone create linkcopy.test --view external --link-with internal
|
||||
expect_dig "the copy answers" "192.0.2.80" -k $E/external.key www.linkcopy.test A
|
||||
run "delete the copy" 0 $J zone delete linkcopy.test --view external -y
|
||||
run "the other is unlinked again" 0 $J zone show linkcopy.test --view internal
|
||||
not_contains "Linked with"
|
||||
run "delete the other" 0 $J zone delete linkcopy.test --view internal -y
|
||||
# Internet exposure (docs/exposure.md): external lets in anyone, internal
|
||||
# only homelab.
|
||||
run "exposure" 0 $J exposure
|
||||
|
||||
Reference in new issue
Block a user