Files
Heimdall/skills/central-auto-updates/SKILL.md
T
arnaud.dartois 383205b9fc
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 38m21s
Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Successful in 22m18s
Heimdall Gitea / Build and scan server image (push) Successful in 8m54s
Heimdall Gitea / Build and scan agent image (push) Successful in 6m40s
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 3s
Fix signed release metadata and Linux Agent deployment (#415)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-14 11:59:38 +01:00

9.5 KiB

name, description
name description
central-auto-updates Maintain Central server installation, Compose refresh, and Docker image auto-updates for Heimdall deployments.

Central installation and image updates

For credentials needed by an explicitly requested real deployment, follow Infisical secrets. Disposable Compose acceptance continues to use generated credentials and isolated resources.

Use this skill when changing the Linux or Windows Central installer, its generated Compose, or Central container update behavior.

For installer, Compose, image, and documentation work that can proceed independently, use parallel development with Orca. Keep shared deployment contracts and the final isolated acceptance run coordinated and integrated before recording evidence.

Central and release endpoints

  • The Central address embedded in generated Agent installation commands must come from the browser's exposed NavigationManager.BaseUri; do not store a deployment hostname in a Razor page or installer template. Preserve the path base and trim only its trailing slash.
  • The release source is the global updates.forgepublicurl setting edited in Settings. It stores only the public HTTPS Forgejo origin; ForgeReleaseApiAddress constructs the fixed Heimdall api/v1/repos/arnaud.dartois/Heimdall/releases/latest endpoint, which Settings displays read-only. Startup migrates legacy updates.releaseapiurl values to their origin and removes the old row. Agent release checks must go through the authenticated Central /api/updates/agent/latest endpoint, which returns the configured manifest and asset URLs.
  • Native Agent installers require an explicit Central URL, and Docker Agent configuration must pass Agent:CentralUrl from the generated command or deployment environment. Localhost defaults are permitted only in explicitly local development Compose/configuration.
  • Optional Agent public-IP discovery has no built-in provider hostname; configure Agent:PublicIpResolverUrl with an HTTPS endpoint or leave it empty to report no public IP. Validate the URL before creating the HTTP client.
  • Server-side API calls from Blazor circuits must prefer the process's Kestrel loopback binding over a retained browser Host; a public reverse-proxy host may not be reachable from inside the Central container. Normalize wildcard Kestrel binds (0.0.0.0, [::], and +) to loopback while preserving the bound port.
  • Installer scripts should embed the official Heimdall source base as their standalone default and allow HEIMDALL_SOURCE_BASE_URL to override it for reviewed revisions or mirrors. Use it only for Heimdall-owned source assets; keep vendor dependencies on their official distribution sources.
  • Configure the Forgejo API endpoint used by Renovate through the Actions variable FORGEJO_API_ENDPOINT; Forgejo reserves variable names beginning with GITEA_. Do not embed the forge hostname in workflow YAML. Track credential/run validation in its Gitea issue.
  • Keep Compose network names project-scoped by omitting a fixed networks.*.name, especially for disposable validation projects.

Deployment behavior

  • Keep the installer-generated core stack limited to PostgreSQL, Central, and the updater. Only Central receives the Watchtower enable label; do not update PostgreSQL automatically.
  • Use the maintained nickfedor/watchtower image at an explicit version, --label-enable, a 24-hour interval, and --cleanup. Cleanup removes superseded images after an update; it must never remove Docker volumes or database files.
  • Apply pull_policy: always to published Docker images in deployment Compose files so a manual docker compose up checks the registry. Leave local development-only images alone and keep the updater itself version-pinned.
  • The Docker socket mount grants Watchtower broad control of the host. Document this risk and the lack of staged rollout/rollback; do not describe automatic updates as a production-safe rollback system.
  • For each published Ubuntu-based Central, CPU Agent, or CUDA Agent runtime image, update the package index, apply the package security updates required by current Trivy findings, install runtime packages, and clear apt lists in one layer. Keep a broader OS upgrade only where that image already establishes the policy (the CUDA image); verify every final image with the pinned Trivy scanner at HIGH/CRITICAL severity. A passing application build does not clear OS package advisories.

Runtime image package security

  • The server and CPU Agent runtime images inherit Ubuntu 24.04 from the pinned ASP.NET image. When Trivy identifies a fixed Ubuntu package in the shared base, remediate both Dockerfiles and enforce the minimum patched version at build time. For CVE-2026-109518, explicitly upgrade apt and libapt-pkg6.0t64 to at least Ubuntu 2.8.4ubuntu0.1 before runtime packages. The NVIDIA Agent runtime keeps its existing full OS upgrade and asserts the patched APT version too.
  • Run Central + PostgreSQL from source in a disposable Compose project, verify health and native Agent asset URLs, then scan Central, CPU Agent, and any changed CUDA image with the same pinned Trivy scanner and HIGH/CRITICAL policy used by CI. Require no findings and perform exact-tag cleanup. See skills/container-image-security/SKILL.md.

Re-running the installer

  • A complete existing install can regenerate its Compose after validating the candidate. Keep a timestamped backup of the previous Compose before atomic replacement.
  • If the operator selects an existing optional service again, refresh its source assets through a temporary file and back up each replaced local asset.
  • Preserve .env, the PostgreSQL secret file, and Docker named volumes. Do not rotate existing credentials during an update.
  • When a newer Compose needs an absent env key, append a generated secret or documented default only if that key is missing. Never print secret values. Refuse to continue if the existing database URL or password file needed by PostgreSQL is missing.
  • If the user declines the Compose refresh, exit without changing the install. If only part of an install is present, stop and explain what is missing instead of creating a second set of credentials.

Live Linux deployment evidence

For an explicitly authorized host validation, inspect existing services and data before mutation, use only that environment's protected credentials, and scope reset to the named Heimdall Compose projects. Install Central and Agent through the released .sh installers. Record image digest, Agent version/identity/site association, /healthz, local Agent version endpoint, heartbeat status, credential modes, listener bindings, and sanitized logs. Restart Central and Agent and verify health and persisted volumes/site identity. Do not infer Windows, GPU, camera, multicast, TURN, backup, or long-load acceptance from a single Linux host.

Acceptance

Run bash -n install/install-server.sh, validate PowerShell syntax when pwsh is available, and run docker compose config --quiet for both the installer output and docker/docker-compose.prod.yml. Exercise a first install and a second run against an isolated temporary directory: confirm secrets and nondefault .env values are byte-for-byte unchanged, the old Compose is backed up, missing new variables are added once, and no volume removal command appears. For the Site Install UI, assert generated CPU/GPU Compose and docker run references use their corresponding immutable repository@sha256:digest Agent image, Compose sets pull_policy: always, Docker Run commands set --pull always, all paths mount /var/run/docker.sock, and the non-root Agent receives the socket group (DOCKER_GID in Compose; detected socket GID for Linux docker run). Keep signed digest validation for updates dispatched by Central. A signed Agent manifest always requires the CPU image repository and digest; GPU image metadata is optional for CPU-only releases, and must be present as a valid repository/digest pair when either field is supplied. Unit tests cover CPU-only and CPU+GPU signed manifests plus a malformed half-pair. Source-built Compose acceptance probes Central's latest-release API against the configured public Forgejo source and verifies the returned signature and required CPU digest; record whether the current release also carries GPU metadata. Then follow skills/compose-disposable-recipe/SKILL.md with a unique project, generated credentials, isolated ports/volumes, and an EXIT cleanup trap installed before build/start. Never connect the recipe to a deployed Docker daemon or production data.

When a runtime Dockerfile changes for OS security updates, source-build and health-check the corresponding Central/Agent image, then scan its saved image archive with the pinned Trivy version and the same HIGH,CRITICAL severities used by CI. Record the finding IDs and fixed package versions; do not hide a nonzero scan behind application acceptance.

If acceptance builds a local Central/helper image, record its project-unique tag before build and remove/verify that exact tag in the same cleanup trap, including on failure. Do not remove registry/base images or use --rmi all or broad image pruning; Watchtower's deployment --cleanup behavior is separate from disposable-test cleanup.

  • The Site Install UI must retain the CPU/GPU image digest returned by Central and generate immutable repository@sha256:digest references for both Compose and Docker Run. Never reduce a verified release image to a mutable :latest tag. Test with distinct CPU/GPU digests and reject malformed/missing digest values by disabling Docker install generation.