Repository navigation
deploy stack ssh env setup
deploy-stack.sh carries no person's account name anywhere (the
2026-11-24 deploy-identity decision; spec:
DEPLOY_ENV_SPEC.md).
The stack host's ssh target (STACK_HOST) comes from an untracked
operator env file on your machine. This runbook takes a new operator
from zero to a deploy-ready workstation: ssh key, authorized key on the
stack host, the env file, and verification.
The deploy target is (the prod serving host β see the repo's SOP.md Host-roles section). Your account there must be provisioned with:
- membership of the group that can run
docker(compose build/up, container inspect/run); - write access to
/srv/cherokeedictionary(build context + compose); - write access to
/srv/caddy/caddy/Caddyfile(the blue-green flip).
Request the account provisioning in cherokeelanguage-devops first β it is not something the repo or this runbook can grant.
ls ~/.ssh/id_ed25519.pub 2>/dev/null || ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)"Accept the default location; a passphrase is strongly recommended. On
Windows, ssh-keygen ships with the OpenSSH client / Git Bash.
ssh-copy-id <deploy-user>@<stack-host><deploy-user> is your provisioned account name on the stack host (ask
whoever provisions the account). ssh-copy-id appends your public key
to the host's ~/.ssh/authorized_keys; it will ask for the password one
last time. If a different key name is wanted, use:
ssh-copy-id -i ~/.ssh/<key>.pub <deploy-user>@<stack-host>
The script checks both locations, first match wins:
| # | Path | Scope |
|---|---|---|
| 1 |
./deploy-stack.env (repo root) |
local checkout override |
| 2 | ~/.config/cherokeedictionary/deploy.env |
per-operator default |
Normal per-operator home is location 2:
mkdir -p ~/.config/cherokeedictionary
cp /path/to/cherokeedictionary/deploy-stack.env.example ~/.config/cherokeedictionary/deploy.env
chmod 600 ~/.config/cherokeedictionary/deploy.env
# edit: STACK_HOST=<deploy-user>@<stack-host>The file is plain KEY=value shell. STACK_HOST is required; the
optional gate/build knobs (GATE_BASE_URL, GATE_BOOT_TIMEOUT,
GATE_POLL, BUILD_TIMEOUT) may be overridden here too. Define only
the documented keys β the file is sourced as shell, so a stray variable
could shadow a script internal. A repo-local ./deploy-stack.env copy
is gitignored β never commit it (git status must not list it; a
force-added one defeats the ignore rule).
Do not use deploy-stack.sh as your first connectivity test: it
ships the build context and rebuilds on the host. Verify the pieces:
# (a) the env file parses and yields the target
bash -c 'set -a; . ~/.config/cherokeedictionary/deploy.env; set +a; echo "STACK_HOST=$STACK_HOST"'
# (b) the key authenticates without a prompt (BatchMode forbids one)
# β in a fresh shell, after the same source line as (a):
. ~/.config/cherokeedictionary/deploy.env
ssh -o BatchMode=yes "$STACK_HOST" 'echo ok'(Using a repo-local ./deploy-stack.env instead? Source
./deploy-stack.env in (b) and everything downstream is identical.)
Then confirm the deploy-grade privileges on the same target:
ssh -o BatchMode=yes "$STACK_HOST" \
'docker version --format "{{.Server.Version}}" && test -w /srv/cherokeedictionary && test -w /srv/caddy/caddy/Caddyfile && echo "deploy privileges: ok"'All three green β ./deploy-stack.sh will find your config (it prints
operator config: <path>) and can run.
-
ERROR: no operator deploy config β STACK_HOST is not setβ the script found neither file, or the file exists with noSTACK_HOST=line. Re-check the two paths above (repo-local name isdeploy-stack.env, the~/.configone isdeploy.env). -
Permission denied (publickey)in step 4 β the key was not copied (repeat Β§2), a non-default key file exists (repeat Β§2 with-i ~/.ssh/<key>.pub), or a passphrase is set without an unlocked agent: runssh-add, or configureAddKeysToAgent yesin~/.ssh/config. -
Password prompt in step 4 β
BatchModedisallows prompts, so a prompt means key auth is not working (fix per the previous bullet, diagnose withssh -v). -
Host key verification failedβ first-ever connect to the host: connect once interactively and accept the fingerprint. -
ERROR: operator config '...' is not valid KEY=value shellβ the env file must be plainKEY=valueshell lines (LF line endings; no non-shell syntax β e.g. a Windows-edited CRLF file fails here). -
cannot ... /srv/...in the privileges probe β the provisioned account lacks write access to the build/compose or Caddyfile path; back to the devops provisioning request.
- Repo spec: DEPLOY_ENV_SPEC.md
- Committed template: deploy-stack.env.example
- Operating index: SOP.md