Merge pull request #138 Co-authored-by: Arnaud Dartois <admin@tordais.cc>
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.releaseapiurlsetting edited in Settings and read byUpdatesController; keep it empty until an operator configures an HTTPS API URL. Agent release checks must go through the authenticated Central/api/updates/agent/latestendpoint, which returns the configured manifest and asset URLs. - Native Agent installers require an explicit Central URL, and Docker Agent configuration must pass
Agent:CentralUrlfrom 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:PublicIpResolverUrlwith 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_URLto 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/watchtowerimage 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: alwaysto published Docker images in deployment Compose files so a manualdocker compose upchecks 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 upgradeaptandlibapt-pkg6.0t64to at least Ubuntu2.8.4ubuntu0.1before 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.