Files
Heimdall/skills/central-auto-updates/SKILL.md
T
arnaud.dartois c200f27461
Heimdall Gitea / Detect CI scope (push) Successful in 6s
Heimdall Gitea / Build and tests (push) Successful in 24m37s
Heimdall Gitea / Publish versioned release (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Successful in 6m4s
Heimdall Gitea / Build and scan server image (push) Successful in 9m39s
Heimdall Gitea / Publish Docker Hub latest tags (push) Successful in 2m32s
Heimdall Gitea / CI policy (push) Successful in 2s
Remove hardcoded service endpoints (#137)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-04 20:55:14 +01:00

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

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 scoped teardown. Never connect the recipe to a deployed Docker daemon or production data.