discover

package
v0.0.0-...-16f1f8d Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package discover finds a running coolify v3 stack on the local Docker daemon and extracts the bits the migrater needs without the user supplying them:

  • the COOLIFY_SECRET_KEY (read from the `coolify` container's env)
  • the path to v3's SQLite file (`/app/db/prod.db` inside the container, extracted via docker cp to a local temp dir)
  • the runtime config of every v3-managed app and DB container, indexed by the v3 row id from container labels / env.

Index

Constants

View Source
const DefaultSQLitePath = "/app/db/prod.db"

DefaultSQLitePath is the path inside the coolify container.

Variables

This section is empty.

Functions

func ExtractSQLite

func ExtractSQLite(ctx context.Context, dc *client.Client, coolifyID string) (string, error)

ExtractSQLite copies /app/db/prod.db out of the `coolify` container to a temp dir on the host. v3 must be stopped before calling (otherwise the file may be mid-write). Returns the local path; caller deletes when done.

Types

type V3Stack

type V3Stack struct {
	CoolifyContainerID string
	FluentBitID        string
	TraefikID          string
	SecretKey          string // raw COOLIFY_SECRET_KEY from coolify env
	WorkloadContainers []V3Workload
}

V3Stack is the result of inspecting a running v3 install.

func Inspect

func Inspect(ctx context.Context, dc *client.Client) (*V3Stack, error)

Inspect discovers the v3 stack on the local Docker daemon.

type V3Workload

type V3Workload struct {
	Labels        map[string]string
	PortBindings  map[int]int // host port → container port; populated from Docker HostConfig
	ContainerID   string
	ContainerName string
	Image         string
	Networks      []string
	Volumes       []container.MountPoint
	Env           []string
	Running       bool
}

V3Workload is a single user-owned container managed by v3 — either an app container or a database container. Identified by the v3 row id discovered either via the container name (v3 uses `<name>-<id>` for apps) or a heuristic fallback on labels/env (v3 doesn't set as clean a label set as we'd like).

Jump to

Keyboard shortcuts

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