Help us shape the future of Go! Take the 2026 Go Developer Survey

coolify

package
v0.54.18 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package coolify relocates Coolify workloads with the pinned coolify-mirror fork in third_party/coolify-mirror. StackKits runs the engine as a separate process on the server it is installed on and accepts only the pinned build.

Index

Constants

View Source
const DefaultBackupDir = "/data/coolify-mirror/backups/kombify-relocate"

DefaultBackupDir is where send writes its backups (the engine's own folder).

View Source
const DefaultEnginePath = "/usr/local/lib/stackkit/coolify-mirror"

DefaultEnginePath is where StackKits installs the engine on a node.

View Source
const DefaultSharePort = 8123

DefaultSharePort is the engine's direct HTTPS share port.

View Source
const EngineEnv = "STACKKIT_COOLIFY_MIRROR"

EngineEnv overrides where the engine binary is looked up.

Variables

View Source
var Pinned = workloadrelocation.Engine{
	Name:           "coolify-mirror",
	Version:        "1.9.3",
	UpstreamCommit: "f46fa093644268759fc0802e7d098e9e45dee984",
	ForkRevision:   "kombify.5",
}

Pinned engine build. Keep in step with third_party/coolify-mirror (internal/engine/manifest.go and KOMBIFY-FORK.md).

Functions

func DrainRecordPath

func DrainRecordPath(workspace, transferID string) string

DrainRecordPath is where the source keeps its drain record between drain, send and the end of the move: the workspace's relocation state.

Types

type ReceiveOptions

type ReceiveOptions struct {
	ReceiptPath  string // node-owned durable engine result, never caller supplied
	TransferID   string
	ExpectedPlan []byte // checked secret-free source closure, never credentials
	From         string // source HOST[:PORT]
	OnConflict   string // copy or skip
	NoStart      bool
	SetDomains   []string
	// Wait is how long to wait for the source's share to accept connections,
	// so both sides of a move can start together; 0 tries once.
	Wait time.Duration
}

ReceiveOptions control the destination side of a move.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner is the pinned engine on this server.

func Locate

func Locate(ctx context.Context, explicit string) (*Runner, error)

Locate finds the engine (explicit path, EngineEnv, DefaultEnginePath, then PATH) and refuses any build other than the pinned one.

func (*Runner) Abort added in v0.54.10

func (r *Runner) Abort(ctx context.Context, plan []byte, transferID, receiptPath string) (json.RawMessage, error)

func (*Runner) Check

func (r *Runner) Check(ctx context.Context, plan []byte) (*workloadrelocation.Check, error)

Check verifies on this (destination) server whether plan can be restored. A blocked move is a valid result (Ready false), not an error.

func (*Runner) Drain

func (r *Runner) Drain(ctx context.Context, plan []byte, recordPath, transferID string) (json.RawMessage, error)

Drain stops the applications and services of plan on this (source) server; databases keep running for a consistent final backup. The record is written to recordPath even for a partial drain, so Undrain can restart what was stopped. It returns the engine's drain record unchanged.

func (*Runner) Observe added in v0.54.10

func (r *Runner) Observe(ctx context.Context, receipt []byte, phase, workspace string) (time.Time, error)

func (*Runner) Plan

func (r *Runner) Plan(ctx context.Context, sel Selection) (json.RawMessage, error)

Plan inventories the selection on this (source) server and returns the engine's plan document unchanged, ready to hand to Check on the destination.

func (*Runner) Receive

func (r *Runner) Receive(ctx context.Context, secrets TransferSecrets, opt ReceiveOptions, out io.Writer) (json.RawMessage, error)

Receive downloads the shared backup from the source and restores it here.

func (*Runner) Resume added in v0.54.10

func (r *Runner) Resume(ctx context.Context, plan []byte, transferID, record string) error

func (*Runner) Send

func (r *Runner) Send(ctx context.Context, secrets TransferSecrets, opt SendOptions, out io.Writer) (json.RawMessage, error)

Send backs up the selection with the derived archive key and shares the file until the destination has downloaded it once.

func (*Runner) Undrain

func (r *Runner) Undrain(ctx context.Context, recordPath, transferID string) (json.RawMessage, error)

Undrain starts again on this server what the drain at recordPath stopped and removes the record once everything runs.

type Selection

type Selection struct {
	Full     bool
	All      bool
	Projects []string
	Domains  []string
	UUIDs    []string
	NoDeps   bool
	Images   string
}

Selection chooses what to relocate (mirrors the engine's backup flags).

type SendOptions

type SendOptions struct {
	ExpectedPlan []byte
	TransferID   string
	Selection    Selection
	File         string // reuse an existing backup made with the same secrets
	OutputDir    string // where a new backup is written
	Host         string // address the destination reaches this server on
	Port         int
	OpenFirewall bool
	TTL          string
	// Drained is the active drain record, if any: drained resources restore
	// running on the destination although they are stopped here.
	Prepared func(json.RawMessage) error
	Drained  string
}

SendOptions control the source side of a move.

type TransferSecrets

type TransferSecrets struct {
	// contains filtered or unexported fields
}

TransferSecrets are the per-move secrets both servers derive from the same Wallet item: the archive key encrypts the backup file, the share secret authenticates the download and pins its TLS certificate.

func DeriveTransferSecrets

func DeriveTransferSecrets(value []byte) (TransferSecrets, error)

DeriveTransferSecrets derives both secrets from a Wallet item value.

func DeriveTransferSecretsForOperation added in v0.54.10

func DeriveTransferSecretsForOperation(value []byte, operationID string) (TransferSecrets, error)

Jump to

Keyboard shortcuts

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