Skip to content

feat: route dokku invocations over ssh when DOKKU_HOST is set#223

Merged
josegonzalez merged 3 commits intomainfrom
204-add-dokku-host-ssh-transport-for-remote-execution
Apr 27, 2026
Merged

feat: route dokku invocations over ssh when DOKKU_HOST is set#223
josegonzalez merged 3 commits intomainfrom
204-add-dokku-host-ssh-transport-for-remote-execution

Conversation

@josegonzalez
Copy link
Copy Markdown
Member

@josegonzalez josegonzalez commented Apr 27, 2026

When DOKKU_HOST is set (or --host is passed to apply/plan), every dokku subprocess call is routed through an ssh subprocess wrapper instead of executing locally, so docket can manage a remote dokku server from a developer laptop or CI runner. Connections share one TCP+SSH handshake via OpenSSH ControlMaster multiplexing. SSH-level failures (connect, auth, host-key) render with an ssh: prefix while remote dokku failures render with dokku: so users can tell which side broke. The --sudo flag and DOKKU_SUDO=1 wrap the remote command in sudo -n; --accept-new-host-keys adds StrictHostKeyChecking=accept-new for CI hosts. The play header gains a (host: <name>) annotation when a remote target is in use. The doc generator now anchors its output path to the repo root via runtime.Caller so invocations from any cwd are safe.

Closes #204.

When `DOKKU_HOST` is set (or `--host` is passed to apply/plan), every
dokku subprocess call is routed through an `ssh` subprocess wrapper
instead of executing locally, so docket can manage a remote dokku
server from a developer laptop or CI runner. Connections share one
TCP+SSH handshake via OpenSSH `ControlMaster` multiplexing. SSH-level
failures (connect, auth, host-key) render with an `ssh:` prefix while
remote dokku failures render with `dokku:` so users can tell which
side broke. The `--sudo` flag and `DOKKU_SUDO=1` wrap the remote
command in `sudo -n`; `--accept-new-host-keys` adds
`StrictHostKeyChecking=accept-new` for CI hosts. The play header
gains a `(host: <name>)` annotation when a remote target is in use.
The doc generator now anchors its output path to the repo root via
`runtime.Caller` so invocations from any cwd are safe.
@josegonzalez josegonzalez force-pushed the 204-add-dokku-host-ssh-transport-for-remote-execution branch from b613640 to 6fdc174 Compare April 27, 2026 11:42
The dispatcher in `subprocess/exec.go` no longer reads `DOKKU_HOST` from
the environment. Hosts now flow through a new `ExecCommandInput.Host`
field, with a package-level default registered via `SetDefaultHost`
(mirroring `SetGlobalSensitive`) so tasks can keep building
transport-agnostic inputs while the commands layer decides which host
to target. The generator script reverts to its previous form now that
the docs directory layout is unchanged.
The plan probe in `dokku_app` (appExists) silently treats any non-zero
exit as "app missing", so a transport-level ssh failure during plan
does not propagate through the formatter. Apply unconditionally runs
at least one ssh-wrapped dokku command and routes the resulting
SSHError through ErrorContinuation, where the `ssh:` prefix is added.
@josegonzalez josegonzalez merged commit aa9d250 into main Apr 27, 2026
10 checks passed
@josegonzalez josegonzalez deleted the 204-add-dokku-host-ssh-transport-for-remote-execution branch April 27, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DOKKU_HOST SSH transport for remote execution

1 participant