Skip to content

fix: redeploy through a host unit, honest image prune, accurate disk use, stricter requests - #20

Merged
AmrMsCLL merged 1 commit into
mainfrom
fix/redeploy-images-accuracy
Nov 5, 2026
Merged

AmrMsCLL merged 1 commit into
mainfrom
fix/redeploy-images-accuracy

Conversation

@AmrMsCLL

@AmrMsCLL AmrMsCLL commented Nov 5, 2026

Copy link
Copy Markdown
Member

Fixes reported after the secret store went live.

Problem Cause Fix
Redeploy answers fetch failed The console called the agent's /reapply over HTTP Redeploy starts graphite-redeploy-<project>, a transient systemd unit running graphite-up <project> on the host through nsenter (as the host shell already does), and answers at once. The button polls GET /api/projects/<project>/redeploy for the unit's state and, on failure, its journal. The unit outlives the console, so redeploying the console works, and nothing waits on Cloudflare's 100 s limit. Moved to POST /api/projects/<slug>/redeploy (project access), with a button on every Project page.
"Required by compose, missing: IMAGE_TAG" Every ${NAME:?} in the applied compose counted as a secret Names the project's applied values file supplies are not secrets.
"Needs redeploy" stays after a redeploy A redeploy that recreates nothing left every container older than the env file Also counts /srv/graphite/<project>/.applied, which graphite-up touches after a successful rollout (Project-Graphite/platform#45).
"Remove dangling images" does nothing Only untagged images were pruned; the ones listed as unused are old sha- tags Removes every image no container uses, says how many and how much, and refreshes disk use at once instead of within 5 minutes.
Disk use reads low Total included the root-reserved blocks Used over used + available, as df shows.

Security: every response sends X-Frame-Options, Cross-Origin-Opener-Policy, Cross-Origin-Resource-Policy, Permissions-Policy, Referrer-Policy, nosniff and, in production, HSTS. A non-GET API request needs this console's Origin, or Sec-Fetch-Site: same-origin when there is none; a request with neither is refused. AGENT_URL and the use of /agent/CONSOLE_TOKEN are gone.

Checks: tsc (server and web), oxlint, npm run build, test/secrets.spec.ts, test/access.spec.ts, test/backups.spec.ts, test/alerts.spec.ts, test/host.spec.ts. The redeploy unit has not been run on the VPS.

…sk use and stricter requests

Redeploy runs graphite-up as a transient systemd unit through nsenter instead of
calling the agent, returns at once, and the page polls the unit's state and log,
so Cloudflare's 100 second limit and a redeploy of the console itself both work.
The missing-secret hint ignores names the project's values file supplies, and
the needs-redeploy hint counts graphite-up's .applied marker as a rollout.
Removing images now removes every unused image and refreshes disk use. Disk use
is reported as df does. Every response carries the security headers, and a write
needs this console's Origin or Sec-Fetch-Site same-origin.
@github-actions github-actions Bot added the size/l 201-600 changed lines, excluding lockfiles label Nov 5, 2026
@AmrMsCLL
AmrMsCLL merged commit 553e632 into main Nov 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l 201-600 changed lines, excluding lockfiles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant