Files
Heimdall/skills/central-auto-updates/SKILL.md
T
arnaud.dartois 636154572b
Heimdall Gitea / Detect CI scope (push) Successful in 6s
Heimdall Gitea / Build and tests (push) Successful in 19m19s
Heimdall Gitea / Publish versioned release (push) Skipped
Heimdall Gitea / Build and scan server image (push) Successful in 6m13s
Heimdall Gitea / Build and scan agent image (push) Successful in 14m44s
Heimdall Gitea / Publish Docker Hub latest tags (push) Successful in 1m48s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 19m9s
Heimdall Gitea / CI policy (push) Successful in 10s
Complete remaining Heimdall features and acceptance
Merge pull request #138

Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-06 11:14:49 +01:00

6.8 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

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

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 API source is the global updates.releaseapiurl setting edited in Settings and read by UpdatesController; keep it empty until an operator configures an HTTPS API URL. 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 Gitea API endpoint used by Renovate through the Actions variable GITEA_API_ENDPOINT; do not embed the forge hostname in workflow YAML.
  • 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.

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. 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.