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 ¶
const DefaultSQLitePath = "/app/db/prod.db"
DefaultSQLitePath is the path inside the coolify container.
Variables ¶
This section is empty.
Functions ¶
func ExtractSQLite ¶
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.
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).