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 ¶
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 ¶
LighthouseInfo describes a lighthouse node for config generation.
Click to show internal directories.
Click to hide internal directories.