- keepalived: pg_role='standby' hat Vorrang vor role für BACKUP-Bestimmung - keepalived-master.sh: gecrasht Dienste beim MASTER-Übergang starten (nicht nur reload) - confighash: ip_addresses per Interface-Name hashen statt per FK (Cross-Node-Drift-Fix) - TOTP/2FA: RFC 6238 — Setup-Flow, QR-Code, Admin-Disable; two-step Login - Firewall-UI: Enterprise-Design — auto-Beschreibung, icon-only Actions, zero-hit Indikator - fe80-Filter: Link-local IPv6 aus NTP/DNS Listen-Dropdowns entfernen - VIP-Dashboard, Dual-Path VRRP, GW-Tracking (Migrations 0033/0034) - Forward Proxy + DNS erweiterte Einstellungen (Migrations 0031/0032) - unbound-control: edgeguard in unbound-Gruppe via postinst Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
60 lines
3.2 KiB
Go
60 lines
3.2 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
// DNSZone is one Unbound zone:
|
|
// - zone_type='local': authoritative, records aus dns_records
|
|
// - zone_type='forward': stub-zone, forward_to ist Komma-Liste
|
|
// von upstream-IPs (z.B. "10.0.0.53, 8.8.8.8")
|
|
type DNSZone struct {
|
|
ID int64 `gorm:"primaryKey" json:"id"`
|
|
Name string `gorm:"column:name;uniqueIndex" json:"name"`
|
|
ZoneType string `gorm:"column:zone_type" json:"zone_type"`
|
|
Description *string `gorm:"column:description" json:"description,omitempty"`
|
|
ManagedBy string `gorm:"column:managed_by" json:"managed_by"`
|
|
ForwardTo *string `gorm:"column:forward_to" json:"forward_to,omitempty"`
|
|
Active bool `gorm:"column:active" json:"active"`
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (DNSZone) TableName() string { return "dns_zones" }
|
|
|
|
// DNSRecord — A/AAAA/CNAME/TXT/MX/SRV/NS/PTR/CAA. Value ist die
|
|
// RDATA in Textform (für MX: "10 mail.example.com").
|
|
type DNSRecord struct {
|
|
ID int64 `gorm:"primaryKey" json:"id"`
|
|
ZoneID int64 `gorm:"column:zone_id" json:"zone_id"`
|
|
Name string `gorm:"column:name" json:"name"`
|
|
RecordType string `gorm:"column:record_type" json:"record_type"`
|
|
Value string `gorm:"column:value" json:"value"`
|
|
TTL int `gorm:"column:ttl" json:"ttl"`
|
|
Active bool `gorm:"column:active" json:"active"`
|
|
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (DNSRecord) TableName() string { return "dns_records" }
|
|
|
|
// DNSSettings ist eine Single-Row-Tabelle mit globalen Resolver-
|
|
// Optionen. Default kommt aus der Migration (alle Werte sinnvoll
|
|
// für die typische LAN-Resolver-Rolle).
|
|
type DNSSettings struct {
|
|
ID int64 `gorm:"primaryKey" json:"id"`
|
|
ListenAddresses string `gorm:"column:listen_addresses" json:"listen_addresses"`
|
|
ListenPort int `gorm:"column:listen_port" json:"listen_port"`
|
|
UpstreamForwards string `gorm:"column:upstream_forwards" json:"upstream_forwards"`
|
|
AccessACL string `gorm:"column:access_acl" json:"access_acl"`
|
|
DNSSEC bool `gorm:"column:dnssec" json:"dnssec"`
|
|
QNameMinimisation bool `gorm:"column:qname_minimisation" json:"qname_minimisation"`
|
|
CacheMinTTL int `gorm:"column:cache_min_ttl" json:"cache_min_ttl"`
|
|
CacheMaxTTL int `gorm:"column:cache_max_ttl" json:"cache_max_ttl"`
|
|
Prefetch bool `gorm:"column:prefetch" json:"prefetch"`
|
|
ServeExpired bool `gorm:"column:serve_expired" json:"serve_expired"`
|
|
MsgCacheSizeMB int `gorm:"column:msg_cache_size_mb" json:"msg_cache_size_mb"`
|
|
RRSetCacheSizeMB int `gorm:"column:rrset_cache_size_mb" json:"rrset_cache_size_mb"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
|
|
}
|
|
|
|
func (DNSSettings) TableName() string { return "dns_settings" }
|