socketproxy

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package socketproxy lets Mooring MANAGE its own read-only docker-socket-proxy (plan §3) so the operator never runs a docker command — they only ever write mooring.yaml. The proxy compose is EMBEDDED in the binary (never operator input); at boot Mooring writes it under the data dir and brings it up idempotently.

The proxy is the READ-plane security boundary: the raw docker socket is mounted ONLY into the proxy (read-only), and Mooring polls container state through it on loopback. Write-plane actions never use it — they shell out to `docker compose`.

Index

Constants

View Source
const Project = "mooring-socket-proxy"

Project is the fixed compose project name for the managed proxy.

Variables

This section is empty.

Functions

func Compose

func Compose() []byte

Compose returns the embedded, Mooring-owned proxy compose bytes.

func EnsureRunning

func EnsureRunning(ctx context.Context, runner *dockerexec.Runner, dataDir string, onLine func(string)) error

EnsureRunning materializes the embedded proxy compose and brings it up idempotently (`docker compose up -d`). It is UNGATED (the read plane must work on a small box) and best-effort: a docker error is returned for the caller to log, never treated as fatal — the read plane simply reports "unavailable" until the proxy is up. The compose is embedded, so nothing operator-controlled ever reaches the docker argv.

func Materialize

func Materialize(dataDir string) (composePath string, err error)

Materialize writes the embedded proxy compose under dataDir/socket-proxy (dir 0700, file 0600) and returns its path. It is pure I/O (no docker), so it is unit-testable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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