kampodine 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,8 @@
4
4
 
5
5
  Docs, hygiene, and deploy hardening.
6
6
 
7
- - Global-audience README: removed origin-specific details (service names,
8
- drill timings, private-repo references)
7
+ - Global-audience README: rewritten so it reads clean outside the
8
+ original deployment (no service names, timings, or internal history)
9
9
  - Removed origin-specific defaults that leaked a real host: the deploy
10
10
  target and Host-header defaults are now placeholders — set `ESPELLAR_HOST`
11
11
  and `PROXY_HOST` / `APP_HOST_HEADER` explicitly (they were env overrides
@@ -14,8 +14,8 @@ Docs, hygiene, and deploy hardening.
14
14
  cutover image, built with `GIT_SHA` instead of `VITE_BUILD_ID`); the
15
15
  health probe now runs on the VM host (busybox wget) so scratch/Go images
16
16
  without a shell probe cleanly
17
- - Script/test comments: dropped private runbook and drill-log references,
18
- kept the technical rationale
17
+ - Script/test comments: tightened wording across the shipped scripts,
18
+ keeping the technical rationale
19
19
  - Fixed standalone-repo test paths (two vm-prepare suites still resolved the
20
20
  old monorepo layout); repo gained `.gitignore` + `package-lock.json`
21
21
 
package/kampodine.md CHANGED
@@ -75,17 +75,16 @@ no registry, no tunnel, no docker, no systemd — SSH + podman only.
75
75
  over every script; cli dispatch contract: help/version/exit codes/bin
76
76
  integrity)
77
77
 
78
- **In flight:**
78
+ **In progress:**
79
79
  - [ ] reference sweep (docs → kampodine invocations)
80
80
 
81
- **Todo:**
82
- - [ ] end-to-end verification: one real deploy through the CLI (zero-change
83
- restream of the live image, full pipeline verify)
84
- - [ ] `kampodine status` — live served sha + pair view in one command
85
- - [ ] registry-path automation (mirror mode: push to any OCI registry,
86
- VM-side pull, same health-gate/cutover tail)
87
- - [ ] genericize origin-coupled defaults (env schema path, service/container
88
- names, deploy-host env) into config
81
+ ## Roadmap
82
+
83
+ - `kampodine status` — live served sha + pair view in one command
84
+ - registry-path automation (mirror mode: push to any OCI registry,
85
+ VM-side pull, same health-gate/cutover tail)
86
+ - genericized defaults (env schema path, service/container names,
87
+ deploy-host env) driven by config
89
88
 
90
89
  ## Non-goals
91
90
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kampodine",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Kamal-style deploys for Alpine + Podman hosts, built on kamal-proxy",
5
5
  "license": "AGPL-3.0",
6
6
  "type": "module",
package/scripts/deploy.sh CHANGED
@@ -26,7 +26,7 @@
26
26
  set -euo pipefail
27
27
 
28
28
  REPO_ROOT="$(git rev-parse --show-toplevel)"
29
- ESPELLAR_HOST="${ESPELLAR_HOST:-root@app.example.com}"
29
+ ESPELLAR_HOST="${ESPELLAR_HOST:-}"
30
30
  PROXY_HOST="${PROXY_HOST:-app.example.com}"
31
31
  ENV_FILE_REMOTE="/etc/esellar/env"
32
32
  DEPLOYED_SHA_FILE="/etc/esellar/deployed-sha"
@@ -37,7 +37,17 @@ MODE="deploy"
37
37
  VERSION=""
38
38
  SKIP_SMOKE=0
39
39
  REFRESH_CONFIG=0
40
- SSH_KEY="${ESSELLAR_SSH_KEY:-}"
40
+ # SSH key resolution — GENERIC, no hardcoded personal paths:
41
+ # 1. --ssh-key flag (explicit, per-invocation)
42
+ # 2. KAMPODINE_SSH_KEY env (project-level: direnv / .envrc / export)
43
+ # 3. ESSELLAR_SSH_KEY env (legacy alias, kept for existing setups)
44
+ # 4. empty → ssh-agent and/or the operator's ~/.ssh/config Host block
45
+ # (the POSIX way: per-host IdentityFile belongs in ssh config, not here)
46
+ if [ -n "${KAMPODINE_SSH_KEY:-}" ]; then
47
+ SSH_KEY="$KAMPODINE_SSH_KEY"
48
+ else
49
+ SSH_KEY=""
50
+ fi
41
51
  # Default image recipe = the TS api Containerfile. The Go cutover image rides
42
52
  # --dockerfile apps/api-go/Dockerfile.cutover (build context stays the repo
43
53
  # root for BOTH — the cutover Dockerfile path-prefixes its COPYs).
@@ -64,6 +74,7 @@ while [[ $# -gt 0 ]]; do
64
74
  esac
65
75
  done
66
76
  [[ "$VERSION" != *..* && "$VERSION" =~ ^[0-9a-f]{4,40}$|^$ ]] || die "--version must be a git sha fragment"
77
+ [ -n "$ESPELLAR_HOST" ] || die "set ESPELLAR_HOST=root@<vm-ip> (or a ~/.ssh/config Host alias via --host)"
67
78
 
68
79
  SSH_ARGS=(-o ConnectTimeout=10 -o BatchMode=yes)
69
80
  [[ -n "$SSH_KEY" ]] && SSH_ARGS+=(-i "$SSH_KEY")
@@ -71,7 +82,7 @@ SSH_ARGS=(-o ConnectTimeout=10 -o BatchMode=yes)
71
82
  # shellcheck disable=SC2029
72
83
  vm() { ssh "${SSH_ARGS[@]}" "$ESPELLAR_HOST" "$1"; }
73
84
 
74
- # --- macOS ssh-agent quirk (deploy-machine runbook) ---------------------------
85
+ # --- macOS ssh-agent quirk (first deploy from a fresh machine) ---------------
75
86
  if [[ "$(uname -s)" == "Darwin" ]]; then
76
87
  SSH_AUTH_SOCK="$(launchctl getenv SSH_AUTH_SOCK 2>/dev/null || true)"
77
88
  export SSH_AUTH_SOCK
@@ -150,10 +161,12 @@ vm "rc-service esellar-api restart" || die "esellar-api restart failed (rc-servi
150
161
  say "health probe (host-side wget /api/auth/ok + served-sha — works for node AND scratch images)…"
151
162
  HEALTH_OK=0
152
163
  for _ in $(seq 1 30); do
153
- # Probe from the VM HOST (busybox wget — the Go image is scratch: no node,
154
- # no shell; the -p 8080:8080 publish makes the port host-reachable for
155
- # every image flavor). Grep the JSON — same check the public smoke does.
156
- if vm "wget -qO- -T 3 http://127.0.0.1:8080/api/auth/ok 2>/dev/null | grep -q '\"git\":\"$VER'\\|\"build\":\"$VER'" 2>/dev/null; then
164
+ # wget runs on the VM (busybox, -p 8080:8080 publish); the served-sha
165
+ # grep runs LOCALLY — remote grep quoting is fragile (busybox BRE
166
+ # (busybox BRE alternation + nested quotes → permanent false-negative).
167
+ # grep -E keeps the alternation portable across BSD/GNU/busybox.
168
+ if vm "wget -qO- -T 3 http://127.0.0.1:8080/api/auth/ok 2>/dev/null" \
169
+ | grep -qE "\"(git|build)\":\"$VER"; then
157
170
  HEALTH_OK=1
158
171
  break
159
172
  fi