initcmd

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package initcmd implements the `coolify init` alpha WireGuard mesh bootstrap command tree (Coolify v5).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBootstrapCommand

func NewBootstrapCommand(flags *InitFlags) *cobra.Command

NewBootstrapCommand creates the `coolify init bootstrap` subcommand — the first-time mesh install. Runs every applicable action on every host and keeps the interactive alpha gate (unless --yes / non-TTY / env override).

func NewExtendCommand

func NewExtendCommand(flags *InitFlags) *cobra.Command

NewExtendCommand creates the `coolify init extend` subcommand. It adds the hosts listed in --new-hosts to an existing mesh: new hosts get the full first-time install; existing hosts get only peer-refresh actions (WG AllowedIPs update, corrosion config refresh, firewall unit reinstall if namespace list changed). Destructive actions on existing hosts are blocked unless --allow-replace is set.

func NewInitCommand

func NewInitCommand() *cobra.Command

NewInitCommand creates the parent `coolify init` command. The command tree is kept for tests and future v5 work but is not registered on the public root CLI. On bare invocation (no subcommand) it prints the alpha banner and help.

func NewPlanCommand

func NewPlanCommand(flags *InitFlags) *cobra.Command

NewPlanCommand creates the `coolify init plan` subcommand.

func NewUpgradeCommand

func NewUpgradeCommand(flags *InitFlags) *cobra.Command

NewUpgradeCommand creates the `coolify init upgrade` subcommand: bumps coold/corrosion/scheduler/builder binaries across every host. Does not touch WG config, podman networks, firewall rules, or the corrosion schema. Rejects "nightly" version tags unless --allow-nightly is set.

Types

type InitFlags

type InitFlags struct {
	common.SSHMeshFlags
	common.MeshNetFlags

	WGMgmtPool          string
	WGInterface         string
	WGListenPort        int
	SkipDefaultDeny     bool
	CooldVersion        string
	CorrosionVersion    string
	CorrosionGossipPort int
	CorrosionAPIPort    int
	Yes                 bool

	// CentralHost is the SSH address of the central VM (from --central flag).
	// When non-empty, phases 4+5 install the scheduler on that host and push
	// per-host JWTs to all other hosts. Default empty = no scheduler setup.
	CentralHost      string
	SchedulerVersion string

	// EnableBuilder is a cluster-wide shorthand: when true (and BuilderHosts
	// is empty), every host in Servers is enrolled as builder-capable. When
	// BuilderHosts is non-empty, EnableBuilder is ignored and only the
	// listed subset gets the capability.
	EnableBuilder bool

	// BuilderHosts is an explicit list of SSH addresses (subset of Servers)
	// to enroll with the builder capability. Empty = fall back to
	// EnableBuilder semantics. Mutually exclusive in practice with
	// EnableBuilder=false (leaves builder fully disabled).
	BuilderHosts       []string
	BuilderCapacity    int
	BuilderCPUQuota    string
	BuilderMemoryMax   string
	BuilderTimeoutSecs int

	// NewHosts is the extend-subcommand-only list of brand-new hosts. Must
	// be a subset of Servers. Existing hosts in Servers get only peer-refresh
	// actions; new hosts get the full first-time install.
	NewHosts []string

	// AllowReplace unlocks destructive-replace actions on existing hosts in
	// extend mode (e.g. recreating a podman bridge whose dns_enabled=true
	// pre-alpha drift would otherwise be blocked).
	AllowReplace bool

	// AllowNightly permits the upgrade subcommand to accept "nightly" as a
	// version tag. Rejected by default because nightly forces a re-install on
	// every run instead of only when the pinned version changes.
	AllowNightly bool

	// Intent selects the plan filter (bootstrap/extend/upgrade). Set by each
	// subcommand before calling runPlan/runApply; not bound to a flag.
	Intent string
}

InitFlags holds all flags shared between `plan` and `apply`.

Jump to

Keyboard shortcuts

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