configgen

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(input GeneratorInput) ([]byte, error)

Generate produces a Nebula config.yml from the given input by marshaling a typed struct through gopkg.in/yaml.v3. Replaces the previous text/template-based generator (GHSA-7hp6 follow-up, issue #126).

Types

type AdvancedUnsafeRoute

type AdvancedUnsafeRoute struct {
	Route string
	Via   string
}

AdvancedUnsafeRoute mirrors models.UnsafeRoute for the generator input.

type FirewallRule

type FirewallRule struct {
	Port  string // "any", "22", "443"
	Proto string // "any", "tcp", "udp", "icmp"
	Group string // "any", "admin", etc.
}

FirewallRule represents a single firewall rule.

type GeneratorInput

type GeneratorInput struct {
	HostName         string
	NebulaIPs        []string
	IsLighthouse     bool
	IsRelay          bool
	CACertPath       string
	CertPath         string
	KeyPath          string
	ListenPort       int
	Lighthouses      []LighthouseInfo
	Relays           []string
	FirewallInbound  []FirewallRule
	FirewallOutbound []FirewallRule

	// Optional per-host overrides. Zero values mean "use the default".
	PunchyOverride *bool
	ListenHost     string
	MTU            int
	TunDevice      string
	UnsafeRoutes   []AdvancedUnsafeRoute

	// Optional inline PEM blocks. When CACertPEM is non-empty, CertPEM and
	// KeyPEM must also be non-empty; all three are emitted as literal-block
	// scalars in the pki section. When empty, the path-based fields above
	// are used instead. Mobile Nebula clients use the inline form since
	// they import a self-contained YAML config.
	CACertPEM string
	CertPEM   string
	KeyPEM    string
}

GeneratorInput contains all parameters needed to generate a Nebula config.

type LighthouseInfo

type LighthouseInfo struct {
	NebulaIPs  []string
	PublicAddr string // "1.2.3.4:4242"
}

LighthouseInfo describes a lighthouse node for config generation.

Jump to

Keyboard shortcuts

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