- CLI: enroll, run, status, version, help (core.Main with a role factory); the agent binaries use a placeholder factory until the BIND and Kea roles are wired in. - Enrollment: local ECDSA P-256 key and CSR, TLS 1.3 to the agent API with the server chain pinned to the CA fingerprint. - ServerSource: mTLS gRPC with keepalive, Connect stream (Hello, Welcome, heartbeats, apply and renew commands), reconnect with exponential backoff and jitter, GetDesiredState polling as fallback, certificate renewal after half of the lifetime. - Apply pipeline: fetch, bundle verification with replay protection, store, Validate, Activate, Health with retries, rollback to the last good revision; outcomes succeeded/rejected/rolled_back/failed are queued in state.json and reported; failed revisions are retried only by a newer revision or an explicit push. - Lease reporting with change detection, persistent sequence and full snapshots at start, per connection and periodically. - Tests with fake roles, a fake source and an in-process fake AgentService over real mTLS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
559 B
Go
22 lines
559 B
Go
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Command ddi-agent-dhcp manages a Kea DHCPv4 server on behalf of the DDI suite.
|
|
package main
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
|
|
"git.beugsiud.de/beug.k/DDI/agent/core"
|
|
"git.beugsiud.de/beug.k/DDI/internal/brand"
|
|
)
|
|
|
|
func main() {
|
|
os.Exit(core.Main(brand.AgentDHCPBinary, core.KindDHCP, newRole, os.Args[1:], os.Stdout, os.Stderr))
|
|
}
|
|
|
|
// newRole is a placeholder until the DHCP role package is wired in.
|
|
func newRole(func(v any) error) (core.Role, error) {
|
|
return nil, errors.New("DHCP role not available in this build")
|
|
}
|