feat: route dokku invocations over ssh when DOKKU_HOST is set#223
Merged
josegonzalez merged 3 commits intomainfrom Apr 27, 2026
Merged
Conversation
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.
b613640 to
6fdc174
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
DOKKU_HOSTis set (or--hostis passed to apply/plan), every dokku subprocess call is routed through ansshsubprocess 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 OpenSSHControlMastermultiplexing. SSH-level failures (connect, auth, host-key) render with anssh:prefix while remote dokku failures render withdokku:so users can tell which side broke. The--sudoflag andDOKKU_SUDO=1wrap the remote command insudo -n;--accept-new-host-keysaddsStrictHostKeyChecking=accept-newfor 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 viaruntime.Callerso invocations from any cwd are safe.Closes #204.