Edit Technitium zones: switch off and on, and their options

An Edit zone panel on the open zone of a Technitium provider switches the zone
off and on (its records stay) and edits who may ask it (query access), who may
copy it (zone transfer, with the TSIG keys the server has) and who is told when
it changes (notify). Only the groups that apply to the kind of zone are shown,
a mode that goes by a list needs it, and entries must be addresses or networks;
only groups that differ are sent, each whole, and the zone is read again
afterwards so anything else that moved is named on the page and in the audit
log. The server's own zones are not touched. Administrators only, audited.
Zones in the list show when they are off and what kind they are.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-01 23:20:19 +01:00
1 parent 082c524125
commit 6f144b4e36
12 files changed
+1110 -10

No files matched your search

+37
View File
@@ -679,6 +679,8 @@ export interface DnsProviderSummary {
canCreateZones: boolean;
/** Whether zones can be deleted on it from here (Technitium). */
canDeleteZones: boolean;
/** Whether zones can be switched off and on and their options edited from here (Technitium). */
canEditZones: boolean;
}
/** A zone to be made: a Primary one, a Secondary one from the servers that hold it, or a Forwarder one that passes questions on. */
@@ -692,6 +694,37 @@ export interface DnsZone {
name: string;
syncedAt: string | null;
recordCount: number;
/** Primary, Secondary, Forwarder … when the provider says. */
type?: string;
/** Switched off, when the provider says. */
disabled?: boolean;
}
/** How a zone is set now (Technitium): whether it is on, who may ask it, who may copy it, who is told when it changes. */
export interface DnsZoneOptionsInfo {
name: string;
type: string;
internal: boolean;
disabled: boolean;
queryAccess: string | null;
queryAccessNetworkACL: string[];
zoneTransfer: string | null;
zoneTransferNetworkACL: string[];
zoneTransferTsigKeyNames: string[];
notify: string | null;
notifyNameServers: string[];
availableTsigKeyNames: string[];
}
/** What an edit of a zone's options asks for; what is left out is not asked to change. */
export interface DnsZoneOptionsChange {
queryAccess?: string;
queryAccessNetworkACL?: string[];
zoneTransfer?: string;
zoneTransferNetworkACL?: string[];
zoneTransferTsigKeyNames?: string[];
notify?: string;
notifyNameServers?: string[];
}
export interface DnsRecord {
@@ -3927,6 +3960,10 @@ export const api = {
},
zones: {
list: (providerId: number) => request<{ zones: DnsZone[] }>(`/api/dns/providers/${providerId}/zones`),
options: (providerId: number, zoneId: string) => request<{ options: DnsZoneOptionsInfo }>(`/api/dns/providers/${providerId}/zones/${encodeURIComponent(zoneId)}/options`),
updateOptions: (providerId: number, zoneId: string, change: DnsZoneOptionsChange) =>
request<{ changed: string[]; unexpected: string[]; options: DnsZoneOptionsInfo | null }>(`/api/dns/providers/${providerId}/zones/${encodeURIComponent(zoneId)}/options`, { method: "PATCH", body: JSON.stringify(change) }),
setEnabled: (providerId: number, zoneId: string, enabled: boolean) => request<{ enabled: boolean; changed: boolean }>(`/api/dns/providers/${providerId}/zones/${encodeURIComponent(zoneId)}/enabled`, { method: "POST", body: JSON.stringify({ enabled }) }),
remove: (providerId: number, zoneId: string, name: string) => request<void>(`/api/dns/providers/${providerId}/zones/${encodeURIComponent(zoneId)}`, { method: "DELETE", body: JSON.stringify({ name }) }),
create: (providerId: number, body: NewDnsZoneInput) => request<{ zone: { id: string; name: string } }>(`/api/dns/providers/${providerId}/zones`, { method: "POST", body: JSON.stringify(body) }),
},