setup

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AeroflareTheme

func AeroflareTheme() *huh.Theme

AeroflareTheme returns a huh form theme with brand colors and rounded borders, applied consistently across the init wizard and settings command.

func DisplaySummary

func DisplaySummary(cfg *InitConfig) (bool, error)

DisplaySummary shows a configuration summary and asks for confirmation.

func RunProvision

func RunProvision(cfg *InitConfig) error

RunProvision executes the infrastructure provisioning pipeline. Each step is idempotent where possible.

Types

type GitProvider

type GitProvider string

GitProvider represents the Git hosting provider for CI/CD integration.

const (
	GitNone   GitProvider = "none"
	GitGitHub GitProvider = "github"
	GitGitLab GitProvider = "gitlab"
)

func (GitProvider) String

func (g GitProvider) String() string

String returns a human-readable label.

type InitConfig

type InitConfig struct {
	CacheName  string
	Registry   string
	Repository string

	GitProvider GitProvider

	CloudflareAccountID string
	CloudflareToken     string

	GitToken    string
	GitUsername string

	WorkerName string

	// WorkerToken is an optional registry PAT stored on the Worker as the
	// NIXCACHE_TOKEN secret. When set, the Worker uses it directly as the GHCR
	// bearer token (skipping the token exchange: faster, fewer requests) and can
	// reach private repositories. Empty means the Worker authenticates
	// anonymously, which only works for public caches.
	WorkerToken string

	// Internal fields populated during provisioning.
	OCIToken    string
	ScriptTag   string // Worker script tag returned by the Cloudflare deploy API; reserved for a future Workers Builds integration, not yet read elsewhere.
	CfTokenID   string // Cloudflare API token ID; reserved for a future Workers Builds integration, not yet read elsewhere.
	GitCloneURL string // Clone URL (with embedded credentials) for pushing to the created git repository.
}

InitConfig holds all parameters collected by the setup wizard.

func RunWizard

func RunWizard() (*InitConfig, error)

RunWizard collects all configuration from the user through an interactive wizard. No infrastructure changes are made during this phase.

func (*InitConfig) DeriveDefaults

func (c *InitConfig) DeriveDefaults()

DeriveDefaults populates computed fields (Repository, WorkerName) from the cache name and registry the user already supplied. Must be called after CacheName/Registry are set and before the values are used elsewhere (e.g. by the credentials prompt or provisioning).

Jump to

Keyboard shortcuts

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