config

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyConfig added in v0.6.0

type APIKeyConfig struct {
	// Unique key identifier (1-32 chars, alphanumeric + hyphen, lowercase)
	ID string `yaml:"id" json:"id" required:"true"`

	// Secret portion of the token (user-provided, 32+ chars recommended)
	// If provided, the full token will be: mdn_<id>_<secret>
	Secret string `yaml:"secret,omitempty" json:"secret,omitempty"`

	// Full token (must be valid mdn_<id>_<secret> format)
	// Use this if you already have a complete token
	Token string `yaml:"token,omitempty" json:"token,omitempty"`

	// Human-readable description
	Description string `yaml:"description,omitempty" json:"description,omitempty"`

	// Permission scopes (e.g., "zones:read", "records:write", "admin")
	Scopes []string `yaml:"scopes" json:"scopes" required:"true"`

	// Authorized zones (e.g., ["example.com."] or ["*"] for all zones)
	Zones []string `yaml:"zones" json:"zones" required:"true"`
}

APIKeyConfig configures a bootstrap API key. Use either Secret (recommended) or Token to specify the credential.

type Config

type Config struct {
	// DNS server listen address
	DNSAddr string `yaml:"dnsAddr" json:"dnsAddr" default:":5353"`

	// gRPC API listen address (empty to disable)
	GRPCAddr string `yaml:"grpcAddr" json:"grpcAddr" default:":50051"`

	// Enable gRPC reflection (for debugging/grpcurl, disabled by default)
	GRPCReflection bool `yaml:"grpcReflection" json:"grpcReflection" default:"false"`

	// Storage configuration
	Storage StorageConfig `yaml:"storage" json:"storage"`

	// Zones to serve
	Zones []ZoneConfig `yaml:"zones" json:"zones"`

	// API keys for gRPC authentication (bootstrap)
	APIKeys []APIKeyConfig `yaml:"apiKeys,omitempty" json:"apiKeys,omitempty"`
}

Config is the mindns server configuration.

func Load added in v0.5.0

func Load(path string) (*Config, error)

Load reads and parses a config file.

type DNSSECConfig added in v0.5.0

type DNSSECConfig struct {
	// KSK private key file
	KSKFile string `yaml:"kskFile" json:"kskFile"`

	// ZSK private key file
	ZSKFile string `yaml:"zskFile" json:"zskFile"`

	// Algorithm (default: ECDSAP256SHA256)
	Algorithm string `yaml:"algorithm" json:"algorithm" enum:"ECDSAP256SHA256,ECDSAP384SHA384,ED25519" default:"ECDSAP256SHA256"`
}

DNSSECConfig configures DNSSEC signing for a zone.

type StorageConfig added in v0.5.0

type StorageConfig struct {
	// Database file path (empty for in-memory)
	Path string `yaml:"path" json:"path"`
}

StorageConfig configures the backing store.

type ZoneConfig added in v0.5.0

type ZoneConfig struct {
	// Zone origin (e.g., "example.com.")
	Name string `yaml:"name" json:"name" required:"true"`

	// Zone file path (if set, loads records from file)
	File string `yaml:"file" json:"file"`

	// SOA parameters (used when creating zone without file)
	PrimaryNS  string `yaml:"primaryNS" json:"primaryNS"`
	AdminEmail string `yaml:"adminEmail" json:"adminEmail"`
	DefaultTTL uint32 `yaml:"defaultTTL" json:"defaultTTL" default:"3600"`

	// DNSSEC signing (optional)
	DNSSEC *DNSSECConfig `yaml:"dnssec,omitempty" json:"dnssec,omitempty"`
}

ZoneConfig configures a DNS zone.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL