config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package config parses instigator's YAML configuration into validated, strongly typed values: addresses as netip types, MACs parsed, service toggles and ports defaulted.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Name string
	MAC  net.HardwareAddr
	IP   netip.Addr
}

Client is one machine instigator answers.

type Config

type Config struct {
	ServerIP    netip.Addr
	Netmask     netip.Prefix
	Clients     []Client
	InstallSets []InstallSet
	Services    Services
	Ports       Ports
	Credentials []Credential
	// CacheDir is where a fetched or extracted remote source is cached;
	// empty means the caller (serve) supplies its own default.
	CacheDir string
}

Config is a validated instigator configuration.

func Parse

func Parse(b []byte) (*Config, error)

Parse decodes and validates a configuration.

type Credential added in v0.2.0

type Credential struct {
	Host, Username, Password string
}

Credential is HTTP Basic auth offered to one host when a layer's Source is fetched over https. Password is expanded from a "${VAR}" environment reference at parse time, so the config file itself never carries a secret in the clear.

type InstallSet

type InstallSet struct {
	Name       string
	Enabled    bool
	Layers     []Layer
	Collisions map[string]string
}

InstallSet is one served IRIX install tree, assembled by layering Layers in the given order. Every configured set is always built and served (browsable); Enabled controls only whether the set is offered in the generated command file and Inst> instructions. Collisions records, for a full logical path written by more than one layer, which layer's copy wins.

type Layer

type Layer struct {
	Name   string
	Source string
	Base   string
	Dist   string
	Stand  string
	Sha256 string
	Boot   bool
}

Layer is one directory, image, or remote archive contributing files to an install set. Source names it: a local path (a disc image or a directory) or an http(s) URL (a raw image, fetched by byte-range or whole, or a tar/gz archive extracted into the cache). Base, when set, selects a subtree of Source rather than serving it whole - the layer's files are those under Base, rebased to the layer's root. Sha256, when set, is the digest a whole-file fetch of Source is verified against.

Dist is the distribution directory inside that source, defaulting to "dist"; whatever it is called there, it merges into the set's own dist. A version-stub disc names its real catalog instead ("dist6.5", or "dist/dist6.5" where the disc hides it behind a .redirect), which rebases it so inst only ever sees /<set>/dist.

Stand names the stand directory inside Source, defaulting like Dist to the layer's own "stand". Boot marks the layer whose stand directory is served at /<set>/stand, where the PROM fetches fx.64. At most one layer per set may set it, and only a set an operator actually netboots needs one at all.

type Ports

type Ports struct {
	BOOTP int
	TFTP  int
	RSH   int
}

Ports holds the listening ports, overridable for unprivileged runs.

type Services

type Services struct {
	BOOTP bool
	TFTP  TFTPService
	RSH   bool
}

Services holds the per-protocol toggles.

type TFTPService

type TFTPService struct {
	Enabled   bool
	PortRange [2]int
}

TFTPService holds the tftp toggle and its transfer port range.

Jump to

Keyboard shortcuts

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