feat: HA-Cluster v1.2.x — Split-Brain, TOTP, Enterprise-FW, Drift-Fix, VIP-Recovery
- 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>
This commit is contained in:
@@ -22,19 +22,37 @@ func NewGenerator(repo *Repo) *Generator { return &Generator{Repo: repo} }
|
||||
// Render schreibt /etc/edgeguard/ip-addresses.conf (Format: dev|addr/prefix)
|
||||
// und triggert das apply-Skript via sudo.
|
||||
func (g *Generator) Render(ctx context.Context) error {
|
||||
return g.render(ctx, false)
|
||||
}
|
||||
|
||||
// RenderSecondary wie Render, aber schließt Ethernet-Interface-IPs aus.
|
||||
// Auf einem Secondary-Node werden eth0-IPs (Public-IP + VIP) von
|
||||
// cloud-init bzw. Keepalived verwaltet — edgeguard soll sie nicht
|
||||
// überschreiben oder entfernen.
|
||||
func (g *Generator) RenderSecondary(ctx context.Context) error {
|
||||
return g.render(ctx, true)
|
||||
}
|
||||
|
||||
func (g *Generator) render(ctx context.Context, excludeEthernet bool) error {
|
||||
type addrRow struct {
|
||||
dev string
|
||||
addr string
|
||||
prefix int
|
||||
}
|
||||
|
||||
rows, err := g.Repo.Pool.Query(ctx, `
|
||||
q := `
|
||||
SELECT ni.name, ia.address, ia.prefix
|
||||
FROM ip_addresses ia
|
||||
JOIN network_interfaces ni ON ni.id = ia.interface_id
|
||||
WHERE ia.active = true
|
||||
ORDER BY ni.name, ia.address`,
|
||||
)
|
||||
WHERE ia.active = true`
|
||||
if excludeEthernet {
|
||||
q += `
|
||||
AND ni.type != 'ethernet'`
|
||||
}
|
||||
q += `
|
||||
ORDER BY ni.name, ia.address`
|
||||
|
||||
rows, err := g.Repo.Pool.Query(ctx, q)
|
||||
if err != nil {
|
||||
return fmt.Errorf("query: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user