Commit Graph
7 Commits
Author SHA1 Message Date
dong.nguyen eee662a62d infra: htpasswd write mode 600 → 644 (spec-v6 D16 follow-up) — nginx worker (uid 101) opens auth_basic_user_file per request; 600 answered 13: Permission denied on /api/content/ 2026-10-28 12:15:03 +07:00
dong.nguyen a5ff55bacf infra: Basic-auth file leaves the repository (spec-v6 D16) — deploy/htpasswd gitignored, written on the VPS from the HTPASSWD_CONTENT secret; Gitea mirrors brought to full parity (permissions, STACK_DIR/CONTAINER_NAME guards) 2026-10-28 11:57:23 +07:00
dong.nguyen cff981c5f3 ci: move both pipelines to GitHub Actions (spec-v6)
GitHub becomes the primary repository host; the site keeps its VPS + nginx + Dockge host, the three-job pipeline and the same concurrency, so what moves is the CI host and the write-path target. .github/workflows/{deploy,deploy-infra}.yml are ports of the Gitea files with permissions: contents: read on every job. .gitea/workflows/ stays until the first green GitHub run (D9); its infra test step carries the new template variable names because the template it validates is the one this repository now ships.

The write-path values are renamed GITEA_TOKEN / GITEA_CONTENTS_API -> CONTENT_API_TOKEN / CONTENT_API_BASE and the upstream header becomes Bearer — in nginx.conf, in the compose envsubst filter and in the dev proxy, so dev and production send the identical header (D4). draft.ts learns GitHub's answer to a stale blob sha (409) while keeping the 422 "does not match" and 412 legs; smoke-draft.ts check 14 drives a stubbed proxy that answers 409 with GitHub's body and asserts the conflict refreshes the base, keeps the draft and never stops the save sequence.

Both workflows read the stack directory and the compose service / container name from the STACK_DIR and CONTAINER_NAME repository variables instead of hard-coding them, and each job refuses a missing, relative, trailing-slash or compose-disagreeing value in its first step, before any artifact download or rsync reaches the VPS (D15).

Verified: tsc -b and oxlint pass with no new warnings; validate:content, smoke-draft (14 checks) and smoke-generated-ids (7 checks) pass; both workflows parse, every run/script block passes bash -n with the variables substituted, and the guard refuses every bad value against the real compose.yaml. Owner-side variables, secrets, the write token and the VPS config rewrite stay open in spec-v6 §6.
2026-10-26 20:49:34 +07:00
dong.nguyen a5a525ff14 fix(infra): envsubst filter as |-regex; test placeholder as resolvable IP
Run 3 failed at the test step: nginx's official entrypoint matches NGINX_ENVSUBST_FILTER as a regex against variable names (^filter$), so the comma form GITEA_TOKEN,GITEA_CONTENTS_API matched nothing — ${…} tokens stayed in the rendered config and nginx -t failed with 'unknown "gitea_contents_api" variable'. A literal hostname in proxy_pass is resolved during the config test, so the test placeholder must be a resolvable literal IP. Both reproduced and fixed locally against the repo files: the exact test-step container now passes nginx -t (exit 0). compose.yaml + deploy-infra.yml use GITEA_TOKEN|GITEA_CONTENTS_API (quoted in the shell script) and http://127.0.0.1:1. Spec rev.8: status line, D11, §4 sketch + resolved note, rows 2/4.
2026-10-23 23:59:32 +07:00
dong.nguyen 773000a42a fix(ci): drop -R from infra rsync; per-step remote_path (action prefixes GITHUB_WORKSPACE)
Run 2026-10-23 shipped files to dong-site/workspace/dong.nguyen/cv/… on the VPS: the action builds the rsync source as "/" (entrypoint.sh) and -R mirrors that absolute path; deploy/htpasswd also landed as a directory. Each step now uses plain -avz with an explicit remote_path (dong-site/ for nginx.conf + compose.yaml, dong-site/deploy/ for htpasswd). Spec §4 sketch/notes resolved, §8 rows 2/4 record both run outcomes and the owner-side VPS cleanup before the next dispatch.
2026-10-23 23:45:39 +07:00
dong.nguyen 6d7cae40d4 fix(ci): deploy-infra rsync as three single-path steps (action quotes path input)
First real run 2026-10-23: burnett01/rsync-deployments passes the comma-list path input to rsync as one quoted argument — link_stat "nginx.conf,compose.yaml,deploy/htpasswd" failed, nothing shipped, live container untouched. Apply the spec §4 fallback: one rsync step per file with full remote_* config, -avzR kept. Spec: §4 sketch + inference note resolved, §6 paths-filter risk annotated, §8 rows 2/4 record the run outcome and the re-run-via-dispatch step.
2026-10-23 23:15:03 +07:00
dong.nguyen 5e9c76c62b feat(ci): deploy-infra pipeline + env-driven site identity (spec-v4-deploy-infra rev.6-7)
Repo side of spec-v4-deploy-infra: deploy-infra.yml (paths-filtered nginx redeploy, test-before-touch, health probe); compose.yaml rename + secrets/site_config entrypoint override; site identity externalized - SITE_URL/SITE_NAME read from env (site.ts, vite site-identity plugin, index.html tokens, generated robots.txt); nginx.conf/vite dev proxy read GITEA_CONTENTS_API; .env.example; AGENTS.md + specs updated. Rev.7: site identity delivered as Gitea Actions variables (vars. context, public values) instead of secrets; upload-artifact unified to v7 across jobs.
2026-10-23 22:34:23 +07:00