bake

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bake makes an edge's ISO as fortressctl bake does, for tools outside this repository, such as the Terraform provider: check a fortress.yml as the edge would, and bake it into a release ISO. The same release and fortress.yml give the same bytes, whichever tool bakes them, on any OS, as long as it builds against the same version of this module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(fortressYML []byte) error

Check reports what is wrong with a fortress.yml, as the edge would.

func ISO

func ISO(dest, release string, fortressYML []byte) error

ISO writes dest: the release ISO at release with fortressYML in its initramfs, dated as the release. It refuses a fortress.yml that Check refuses.

func Keys added in v0.2.0

func Keys() []string

Keys lists fortress.yml's keys in the order of Config's fields.

func WriteISO

func WriteISO(dest, kernel, initramfs, isolinux, ldlinux string, at time.Time) error

WriteISO writes a release ISO as fortressctl iso does: a BIOS boot CD of the kernel, the initramfs, and the syslinux files, every date at.

Types

type Config added in v0.2.0

type Config struct {
	// ClientCA is the PEM CA certificate that signs the dark-node, operator,
	// and log-reader certificates: exactly one certificate. Required.
	ClientCA string `yaml:"client_ca"`
	// ACME is the ACME directory URL. Empty is Let's Encrypt.
	ACME string `yaml:"acme"`
	// ACMECA is the PEM CA that signed the ACME directory's HTTPS
	// certificate. Empty trusts the system roots.
	ACMECA string `yaml:"acme_ca"`
	// NTP are the time servers the edge keeps its clock to, each host or
	// host:port: several, so one that is wrong is outvoted. Empty is
	// pool.ntp.org.
	NTP []string `yaml:"ntp"`
	// RenewInterval is how often ACME certificates are checked, a duration
	// such as 4h. Empty is 4h.
	RenewInterval string `yaml:"renew_interval"`
	// QUIC lets dark nodes connect over QUIC on UDP 443 too.
	QUIC bool `yaml:"quic"`
	// Vault is the https URL of a Vault whose KV v2 path the edges that
	// serve the same names share their certificates in. Empty keeps them
	// on each edge's disk only. With it, all of VaultMount, VaultPath,
	// VaultRoleID, and VaultSecretID are required.
	Vault string `yaml:"vault"`
	// VaultCA is the PEM CA, or chain, that signed Vault's HTTPS
	// certificate: the only roots the connection trusts. Empty trusts the
	// system roots.
	VaultCA string `yaml:"vault_ca"`
	// VaultMount is the KV v2 mount, such as edge-certs.
	VaultMount string `yaml:"vault_mount"`
	// VaultPath is these edges' path in the mount, such as prod/public.
	VaultPath string `yaml:"vault_path"`
	// VaultRoleID and VaultSecretID are the AppRole the edge logs in with;
	// its policy should allow the path and nothing else.
	VaultRoleID   string `yaml:"vault_role_id"`
	VaultSecretID string `yaml:"vault_secret_id"`
}

Config is fortress.yml as fields, one per key, in the order YAML writes them. A field left at its zero value leaves its key out, so the edge uses the key's default.

func (Config) Check added in v0.2.0

func (c Config) Check() error

Check reports what is wrong with c, as the edge would. An error names the fortress.yml key it is about, as "fortress.yml: acme: ...".

func (Config) YAML added in v0.2.0

func (c Config) YAML() []byte

YAML is c as fortress.yml: the keys it sets, in Keys' order, strings quoted and PEM as block scalars. The same Config gives the same bytes, whatever YAML library another version of this package would use.

Jump to

Keyboard shortcuts

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