Compare views rebuilt: from the zone's view, in sections, one line per record
The Compare views tab and jarl zone diff compare a zone with the same zone in other views from the view you're on: a summary per view, what is answered differently (Use this everywhere), the names only some views have (Add to VIEW), and how many are the same. One name can be compared (jarl zone diff ZONE NAME [TYPE], a Compare button per record). The CLI prints one line per record, cut to the terminal (--wide shows it whole); the web UI cuts long values with the whole one on hover. GET /zones/{zone}/compare returns these sections, with ?with, ?name and ?type.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec16de875d
commit
b1719ce362
12 files changed
+656
-146
No files matched your search
+1
-1
@@ -363,7 +363,7 @@ and `linked_with` (the other views).
|
||||
| POST | `/zones/{zone}/fill-ptr` | Adds the PTR records a reverse zone lacks for its view's A and AAAA records ([reverse.md](reverse.md)) |
|
||||
| GET | `/reverse-zones/suggestions` | The reverse zones the private views lack: `view_id`, `view`, `prefix`, `zone`, `group` (`yours`, or `public`: only if the address is yours), `why`, `fill` (PTR records it would get), `samples` |
|
||||
| POST | `/reverse-zones/dismiss` | `{"view": "internal", "prefix": "185.199.108.153/32"}`: don't suggest it again (`/undismiss` brings it back). A view's `reverse_suggestions: false` (PATCH `/views/{id}`) stops its suggestions |
|
||||
| GET | `/zones/{zone}/compare` | The zone across the views that have it (`?views=a,b`; `?all=1` also the same rows): `views`, `linked`, `same` (count) and `rows` (name, type, `same`, per view `records`, `ids`, `linked`). The zone may be named without a view |
|
||||
| GET | `/zones/{zone}/compare` | The zone compared with the same zone in other views, from its own view ([views.md](views.md#comparing-views)): `?with=a,b` (default: all), `?name=www&type=A` (one name, the same records included), `?all=1`. Returns `base`, `views`, `linked`, `summary` (per other view: `different`, `only_base`, `only_other`, `same`), `different` and `only` (`views`, `rows`) rows (name, `fqdn`, type, per view `records`, `data`, `ids`, `ttl`, `linked`), `same`, `same_rows`. A zone named without its view is compared from the first view that has it |
|
||||
|
||||
`POST /zones` takes `"link_with": "VIEW"` to create a zone linked with
|
||||
that view's zone of the same name.
|
||||
|
||||
+2
-1
@@ -227,7 +227,8 @@ jarl zone unlink adbraun.lol --view vps
|
||||
jarl record add adbraun.lol nas A 10.0.10.20 --view internal --local # this view only
|
||||
jarl record set adbraun.lol www A 10.0.10.5 --view internal --local # override the shared www A here
|
||||
jarl record update 1234 --local | --shared
|
||||
jarl zone diff adbraun.lol [--view V --view W] [--all] # what differs between the views
|
||||
jarl zone diff adbraun.lol [--view V] [--with W] [--all] [--wide] # compared with the same zone in other views
|
||||
jarl zone diff adbraun.lol nas [A] # just one name
|
||||
```
|
||||
|
||||
When a zone exists in several views, add `--view NAME` to commands that
|
||||
|
||||
+48
-14
@@ -209,20 +209,6 @@ each view (Jarl lists them). Share the right version afterwards. Unlinking
|
||||
keeps every record, all local; a link left with one zone is dissolved, as
|
||||
when the other zone is deleted.
|
||||
|
||||
**Comparing the views.** The zone's **Compare views** tab, or `jarl zone
|
||||
diff adbraun.lol`, lines the views up and shows each name and type that
|
||||
differs: a view's own records, or a name one view lacks. **Use this
|
||||
version** (`jarl record update ID --shared`) makes one view's version
|
||||
every view's. It works for zones that aren't linked too, to see what
|
||||
linking them would keep local.
|
||||
|
||||
```
|
||||
$ jarl zone diff adbraun.lol
|
||||
NAME TYPE INTERNAL EXTERNAL
|
||||
nas A 10.0.10.20 [local, id 812] 203.0.113.20 [local, id 790]
|
||||
5 names and types differ, 21 are the same; linked
|
||||
```
|
||||
|
||||
`--local` also works on a zone that isn't linked (its records are local
|
||||
anyway), so scripts don't need to know; `--shared` there is refused.
|
||||
|
||||
@@ -246,6 +232,54 @@ as it is: linked zones can differ per view, keep their own options, and
|
||||
don't depend on the view order (`in-view` can only use a view defined
|
||||
before it).
|
||||
|
||||
## Comparing views
|
||||
|
||||
A zone's **Compare views** tab, or `jarl zone diff`, compares it with the
|
||||
same zone in another view (or all of them), from the view you're on:
|
||||
|
||||
```
|
||||
$ jarl zone diff adbraun.lol --view internal
|
||||
adbraun.lol in internal, compared with external
|
||||
linked: a difference is a view's own records, there on purpose
|
||||
external: 1 answered differently, 24 only in internal, 2 only in external, 31 the same
|
||||
|
||||
ANSWERED DIFFERENTLY (1)
|
||||
nas A
|
||||
internal 10.0.10.20 [local, id 812]
|
||||
external 203.0.113.20 [local, id 790]
|
||||
|
||||
ONLY IN INTERNAL (24)
|
||||
printer A 10.0.10.30
|
||||
router A 10.0.10.1
|
||||
...
|
||||
|
||||
ONLY IN EXTERNAL (2)
|
||||
_acme-challenge TXT "…"
|
||||
...
|
||||
|
||||
31 names and types are the same (--all lists them)
|
||||
```
|
||||
|
||||
* **Answered differently**: names and types more than one view has, with
|
||||
different records. In linked zones that is a view's own (local)
|
||||
records, there on purpose; between zones that aren't linked, it is a
|
||||
difference that crept in. **Use this everywhere** gives every view one
|
||||
view's records (in linked zones by sharing them: `jarl record update ID
|
||||
--shared`).
|
||||
* **Only in …**: names and types some views lack. **Add to external**
|
||||
gives that view the same records, its own.
|
||||
* **The same**: how many; `--all` (or "List them") shows them.
|
||||
|
||||
One line per record: the CLI cuts long values to fit the terminal
|
||||
(`--wide` shows them whole); the web UI shows the whole value on hover.
|
||||
The apex NS records are left out, since views often list their name
|
||||
servers differently on purpose.
|
||||
|
||||
**One name.** `jarl zone diff adbraun.lol nas` (and a type: `... @ TXT`)
|
||||
shows just that name in every view, the same records included. In the
|
||||
web UI, a record's **Compare** button does the same. `--with external`
|
||||
(repeat it) picks the views to compare with.
|
||||
|
||||
## Living with views
|
||||
|
||||
* Commands that name a zone that exists in several views need `--view`
|
||||
|
||||
Reference in new issue
Block a user