feat(docker): decouple container restarts, add auto-update timer, and relocate chaos workloads (#271) #277

Merged
nimmo merged 10 commits from feat/issue-271-container-auto-update into main 2026-10-07 06:16:03 +01:00
Owner

Summary

Resolves #271.

This PR implements two core enhancements and relocates container workloads away from decommissioned host chaos:

  1. Decouple container restartTriggers from configurationRevision (#271):

    • Removed restartTriggers = [ (pkgs.writeText "<name>-configuration-revision" configurationRevision) ]; across all modules in modules/containers/ (killarr, paseo-relay, paseo-webui, plexdrome, rangarr, slskd, synthseek).
    • Config file hashing (builtins.hashFile "sha256") or standard systemd unit definition changes now govern service restarts instead of every single Git commit SHA update causing container restarts across the fleet.
  2. Nightly Docker & Compose auto-update timer:

    • Added modules/virtualization/docker-auto-update.nix with a systemd timer running daily at 02:00.
    • Automatically inspects declarative OCI containers and /srv/stacks/*/docker-compose.yml compose projects, pulls updated images, and restarts only containers whose images changed.
  3. Chaos workload relocation to Lyra and Vega:

    • Relocated music stack (slskd, synthseek, plexdrome) to hosts/lyra/default.nix.
    • Relocated management stack (killarr, rangarr, paseo-webui) to hosts/vega/default.nix.
    • Restored persistent configs/databases from Backrest backups on both hosts.
    • Fixed slskd state directory creation for incomplete downloads.
    • Updated Pangolin targets (75 for SynthSeek HTTP, 76 for Soulseek TCP) to point to Lyra (siteId: 17, lyra-nixos).

Validation

  • nix flake check passed cleanly on all hosts (electra, lena, vega, lyra, chaos).
  • Tested live activation on Vega (just test): docker-rangarr, docker-killarr, docker-paseo-webui, and docker-auto-update.timer are all active and healthy.
  • Tested live activation on Lyra (just test): docker-synthseek, docker-plexdrome, docker-slskd, and docker-auto-update.timer are all active and healthy.
  • Verified seek.nimmog.uk via curl -sI https://seek.nimmog.uk (HTTP/2 200 OK) and SynthSeek MCP API (synthseek.get_system_health reports all subsystems healthy).
## Summary Resolves #271. This PR implements two core enhancements and relocates container workloads away from decommissioned host `chaos`: 1. **Decouple container `restartTriggers` from `configurationRevision` (#271):** - Removed `restartTriggers = [ (pkgs.writeText "<name>-configuration-revision" configurationRevision) ];` across all modules in `modules/containers/` (`killarr`, `paseo-relay`, `paseo-webui`, `plexdrome`, `rangarr`, `slskd`, `synthseek`). - Config file hashing (`builtins.hashFile "sha256"`) or standard systemd unit definition changes now govern service restarts instead of every single Git commit SHA update causing container restarts across the fleet. 2. **Nightly Docker & Compose auto-update timer:** - Added `modules/virtualization/docker-auto-update.nix` with a systemd timer running daily at 02:00. - Automatically inspects declarative OCI containers and `/srv/stacks/*/docker-compose.yml` compose projects, pulls updated images, and restarts only containers whose images changed. 3. **Chaos workload relocation to Lyra and Vega:** - Relocated music stack (`slskd`, `synthseek`, `plexdrome`) to `hosts/lyra/default.nix`. - Relocated management stack (`killarr`, `rangarr`, `paseo-webui`) to `hosts/vega/default.nix`. - Restored persistent configs/databases from Backrest backups on both hosts. - Fixed `slskd` state directory creation for incomplete downloads. - Updated Pangolin targets (`75` for SynthSeek HTTP, `76` for Soulseek TCP) to point to Lyra (`siteId: 17`, `lyra-nixos`). ## Validation - `nix flake check` passed cleanly on all hosts (`electra`, `lena`, `vega`, `lyra`, `chaos`). - Tested live activation on Vega (`just test`): `docker-rangarr`, `docker-killarr`, `docker-paseo-webui`, and `docker-auto-update.timer` are all active and healthy. - Tested live activation on Lyra (`just test`): `docker-synthseek`, `docker-plexdrome`, `docker-slskd`, and `docker-auto-update.timer` are all active and healthy. - Verified `seek.nimmog.uk` via `curl -sI https://seek.nimmog.uk` (HTTP/2 200 OK) and SynthSeek MCP API (`synthseek.get_system_health` reports all subsystems healthy).
- Move slskd, synthseek, and plexdrome containers to Lyra
- Move killarr, rangarr, and paseo-webui containers to Vega
- Re-target .sops.yaml for slskd, synthseek, and plexdrome secrets to Lyra
- Add updatekeys-provisioning recipe to justfiles/secrets.just
- Add modules/virtualization/docker-auto-update.nix with docker-auto-update.timer
  scheduled at 02:00:00 daily (with 15m randomized delay) to check and pull updated
  container images for declarative OCI units and /srv/stacks compose projects, restarting
  containers only when a newer image was downloaded.
- Strip restartTriggers referencing configurationRevision from all container declarations
  (killarr, paseo-relay, paseo-webui, plexdrome, rangarr, slskd, synthseek) to prevent
  spurious restarts during normal nixos-rebuild switch operations.
- Fixes #271
fix(slskd): create stateDir/incomplete directory in preStart
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m31s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m52s
09867d67a4
slskd validates that its configured incomplete download directory exists
on startup. Ensure it is created idempotently during service preStart
so it does not rely solely on system activation tmpfiles.
Author
Owner

Automated code review

Reviewed commit: 81771f05015aa3821c4fbbd50786d8b486d6c4ef

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The PR migrates container workloads from the decommissioned chaos host to lyra and vega, updates SOPS secrets to reflect new host keys, and introduces a nightly Docker auto-update mechanism. The changes include removing configuration revision-based restart triggers in favor of image ID comparison for auto-updates, adding robust error handling, and ensuring directory existence via tmpfiles rules.

Blocking findings

None.

Important findings

  • Docker auto-update script includes unused dependency (modules/virtualization/docker-auto-update.nix:20; high confidence)
    The updateScript definition includes pkgs.docker-compose in runtimeInputs. However, the script logic explicitly checks for docker compose (CLI plugin) first and falls back to docker-compose only if the plugin is missing. The script does not use docker-compose directly as a command but relies on the compose_exec wrapper which detects availability at runtime. More critically, if docker compose is available, docker-compose binary is never invoked. If it's not available, the script skips stacks entirely. Thus, pkgs.docker-compose is effectively dead code in the standard path.
    Impact: Increases build time and closure size unnecessarily by including the standalone docker-compose package even when only the CLI plugin is used or needed.
    Suggested fix: Remove pkgs.docker-compose from runtimeInputs. The script's fallback logic handles the absence of the binary correctly without needing it in the closure if the plugin is present. If the standalone binary is strictly required for some edge case not covered by the plugin, ensure the wrapper explicitly uses it and document why.

Suggestions

  • Compose stack image detection fallback may trigger false positives (modules/virtualization/docker-auto-update.nix:135; medium confidence)
    The logic elif [ -z "$stack_images" ] && echo "$pull_output" | grep -qE "(Downloaded newer image|Pulled|pulled)"; then updated=true allows updating if stack_images is empty (e.g., due to config error or no images defined) but the pull output suggests activity. This can lead to unnecessary container recreation if the compose file is malformed or has no services, yet Docker reports 'Downloaded newer image' for some other reason (e.g., base image pull).
    Impact: Potential spurious restarts of containers in stacks with configuration issues or empty service definitions.
    Suggested fix: Add a check to ensure stack_images is not empty before relying on the grep fallback, or log a warning if stack_images is empty but pull output indicates activity.

Tests and validation

  • No configured deterministic checks.

Questions

  • Has the docker-auto-update script been tested on hosts where only the docker compose CLI plugin is installed (without the standalone docker-compose binary) to ensure the fallback logic does not fail silently or include unnecessary dependencies?
  • Are there any compose stacks in /srv/stacks that might have empty service definitions or configuration errors that could trigger the false-positive update path?

Review limitations

  • I cannot run nix flake check or just test to validate the configuration.
  • I cannot verify the live health of services on lyra and vega.
  • I cannot inspect the actual content of SOPS-encrypted files to confirm key rotation beyond the diff provided.

Diff coverage

  • .sops.yaml: reviewed — included in a context-limited batch
  • hosts/chaos/default.nix: reviewed — included in a context-limited batch
  • hosts/lyra/default.nix: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • justfiles/secrets.just: reviewed — included in a context-limited batch
  • modules/containers/killarr.nix: reviewed — included in a context-limited batch
  • modules/containers/paseo-relay.nix: reviewed — included in a context-limited batch
  • modules/containers/paseo-webui.nix: reviewed — included in a context-limited batch
  • modules/containers/plexdrome.nix: reviewed — included in a context-limited batch
  • modules/containers/rangarr.nix: reviewed — included in a context-limited batch
  • modules/containers/slskd.nix: reviewed — included in a context-limited batch
  • modules/containers/synthseek.nix: reviewed — included in a context-limited batch
  • modules/virtualization/docker-auto-update.nix: reviewed — included in a context-limited batch
  • modules/virtualization/docker.nix: reviewed — included in a context-limited batch
  • secrets/plexdrome.yaml: reviewed — included in a context-limited batch
  • secrets/slskd.yaml: reviewed — included in a context-limited batch
  • secrets/synthseek.yaml: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 9
  • Previous automated review: updated
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `81771f05015aa3821c4fbbd50786d8b486d6c4ef` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The PR migrates container workloads from the decommissioned `chaos` host to `lyra` and `vega`, updates SOPS secrets to reflect new host keys, and introduces a nightly Docker auto-update mechanism. The changes include removing configuration revision-based restart triggers in favor of image ID comparison for auto-updates, adding robust error handling, and ensuring directory existence via tmpfiles rules. ### Blocking findings None. ### Important findings - **Docker auto-update script includes unused dependency** (modules/virtualization/docker-auto-update.nix:20; high confidence) The `updateScript` definition includes `pkgs.docker-compose` in `runtimeInputs`. However, the script logic explicitly checks for `docker compose` (CLI plugin) first and falls back to `docker-compose` only if the plugin is missing. The script does not use `docker-compose` directly as a command but relies on the `compose_exec` wrapper which detects availability at runtime. More critically, if `docker compose` is available, `docker-compose` binary is never invoked. If it's not available, the script skips stacks entirely. Thus, `pkgs.docker-compose` is effectively dead code in the standard path. Impact: Increases build time and closure size unnecessarily by including the standalone docker-compose package even when only the CLI plugin is used or needed. Suggested fix: Remove `pkgs.docker-compose` from `runtimeInputs`. The script's fallback logic handles the absence of the binary correctly without needing it in the closure if the plugin is present. If the standalone binary is strictly required for some edge case not covered by the plugin, ensure the wrapper explicitly uses it and document why. ### Suggestions - **Compose stack image detection fallback may trigger false positives** (modules/virtualization/docker-auto-update.nix:135; medium confidence) The logic `elif [ -z "$stack_images" ] && echo "$pull_output" | grep -qE "(Downloaded newer image|Pulled|pulled)"; then updated=true` allows updating if `stack_images` is empty (e.g., due to config error or no images defined) but the pull output suggests activity. This can lead to unnecessary container recreation if the compose file is malformed or has no services, yet Docker reports 'Downloaded newer image' for some other reason (e.g., base image pull). Impact: Potential spurious restarts of containers in stacks with configuration issues or empty service definitions. Suggested fix: Add a check to ensure `stack_images` is not empty before relying on the grep fallback, or log a warning if `stack_images` is empty but pull output indicates activity. ### Tests and validation - No configured deterministic checks. ### Questions - Has the `docker-auto-update` script been tested on hosts where only the `docker compose` CLI plugin is installed (without the standalone `docker-compose` binary) to ensure the fallback logic does not fail silently or include unnecessary dependencies? - Are there any compose stacks in `/srv/stacks` that might have empty service definitions or configuration errors that could trigger the false-positive update path? ### Review limitations - I cannot run `nix flake check` or `just test` to validate the configuration. - I cannot verify the live health of services on `lyra` and `vega`. - I cannot inspect the actual content of SOPS-encrypted files to confirm key rotation beyond the diff provided. ### Diff coverage - `.sops.yaml`: **reviewed** — included in a context-limited batch - `hosts/chaos/default.nix`: **reviewed** — included in a context-limited batch - `hosts/lyra/default.nix`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `justfiles/secrets.just`: **reviewed** — included in a context-limited batch - `modules/containers/killarr.nix`: **reviewed** — included in a context-limited batch - `modules/containers/paseo-relay.nix`: **reviewed** — included in a context-limited batch - `modules/containers/paseo-webui.nix`: **reviewed** — included in a context-limited batch - `modules/containers/plexdrome.nix`: **reviewed** — included in a context-limited batch - `modules/containers/rangarr.nix`: **reviewed** — included in a context-limited batch - `modules/containers/slskd.nix`: **reviewed** — included in a context-limited batch - `modules/containers/synthseek.nix`: **reviewed** — included in a context-limited batch - `modules/virtualization/docker-auto-update.nix`: **reviewed** — included in a context-limited batch - `modules/virtualization/docker.nix`: **reviewed** — included in a context-limited batch - `secrets/plexdrome.yaml`: **reviewed** — included in a context-limited batch - `secrets/slskd.yaml`: **reviewed** — included in a context-limited batch - `secrets/synthseek.yaml`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/nova-remote-builder.md, README.md - Commits considered: 9 - Previous automated review: updated - Findings: 2 </details>
fix(docker): harden container auto-update image detection and ensure rangarr/killarr directories
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m28s
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m43s
81bf4c0c23
Author
Owner

Addressed the findings from the automated code review in commit 81bf4c0:

  1. Rangarr & Killarr configuration directory creation:

    • Added module-level systemd.tmpfiles.rules (d ${builtins.dirOf cfg.configFile} 0755 ${user} users -) to both modules/containers/rangarr.nix and modules/containers/killarr.nix so the parent directory is guaranteed to exist regardless of host-level tmpfiles rules.
    • Added preStart scripts to docker-rangarr.service and docker-killarr.service ensuring mkdir -p is run and touching the config file if absent to prevent Docker daemon bind-mount fallback from creating empty directories.
  2. Docker auto-update image detection hardening:

    • Switched from stdout grep patterns to comparing Docker image IDs (docker inspect --format '{{.Id}}' "$image") before and after docker pull. Container units are restarted only when the image ID changes.
    • Added proper error handling and logging (echo "WARNING: Failed to pull image..." >&2) so pull failures surface in the systemd journal rather than failing silently.
    • Added error handling to Compose stack pulls in /srv/stacks.
  3. Validation:

    • nix flake check passed cleanly across all hosts.
Addressed the findings from the automated code review in commit `81bf4c0`: 1. **Rangarr & Killarr configuration directory creation:** - Added module-level `systemd.tmpfiles.rules` (`d ${builtins.dirOf cfg.configFile} 0755 ${user} users -`) to both `modules/containers/rangarr.nix` and `modules/containers/killarr.nix` so the parent directory is guaranteed to exist regardless of host-level tmpfiles rules. - Added `preStart` scripts to `docker-rangarr.service` and `docker-killarr.service` ensuring `mkdir -p` is run and touching the config file if absent to prevent Docker daemon bind-mount fallback from creating empty directories. 2. **Docker auto-update image detection hardening:** - Switched from stdout grep patterns to comparing Docker image IDs (`docker inspect --format '{{.Id}}' "$image"`) before and after `docker pull`. Container units are restarted only when the image ID changes. - Added proper error handling and logging (`echo "WARNING: Failed to pull image..." >&2`) so pull failures surface in the systemd journal rather than failing silently. - Added error handling to Compose stack pulls in `/srv/stacks`. 3. **Validation:** - `nix flake check` passed cleanly across all hosts.
fix(docker): support both docker compose plugin and docker-compose binary in auto-update
Some checks failed
AI pull-request review / review (pull_request) Failing after 1m58s
Build and Push Attic Cache / test (pull_request) Successful in 1m27s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
7b8240c59d
Author
Owner

Addressed the updated automated review finding in commit 7b8240c:

  • Compose CLI plugin / binary detection:
    • Added a compose_exec shell wrapper in modules/virtualization/docker-auto-update.nix that detects whether docker compose (CLI plugin interface) or docker-compose (standalone binary) is available on the system, gracefully falling back between them and logging a notice if neither is found before inspecting /srv/stacks.
  • Validation:
    • nix flake check passed cleanly across all configurations and checks.
Addressed the updated automated review finding in commit `7b8240c`: - **Compose CLI plugin / binary detection:** - Added a `compose_exec` shell wrapper in `modules/virtualization/docker-auto-update.nix` that detects whether `docker compose` (CLI plugin interface) or `docker-compose` (standalone binary) is available on the system, gracefully falling back between them and logging a notice if neither is found before inspecting `/srv/stacks`. - **Validation:** - `nix flake check` passed cleanly across all configurations and checks.
fix(docker): execute compose in stack dir, run pre-up hook, and prune dangling images
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m27s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m37s
4be5178979
fix(docker): add error status check and warning for compose pre-up hook
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m26s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m30s
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
6c1f898705
Author
Owner

Addressed the findings from the automated code review update:

  1. SOPS Recipient Verification (Clarification on Important Finding):

    • The encrypted secret files (secrets/slskd.yaml, secrets/synthseek.yaml, secrets/plexdrome.yaml) were verified directly. The old chaos key (age1zxvzxl2ffph32hpl3f5v226nvppm903ef6943uqy0l2jgk28t37sd4tv6k) is not present in any of the files.
    • All three files are strictly encrypted for:
      • lyra (age1sxaj9le979k69925p7emxr34m6r78xd9ksnzeuytxm9szzymrgdqhm26kh)
      • Admin YubiKeys (age1yubikey...)
      • Master provisioning key (age1vlc2eans...)
    • The diff entry showed - recipient: age1zxvz... being replaced by + recipient: age1sxaj..., confirming the chaos key was stripped upon re-encryption with sops updatekeys.
  2. Pre-up Hook Error Handling (6c1f898):

    • In modules/virtualization/docker-auto-update.nix, updated the execution of stack pre-up.sh hooks to check exit status and emit a warning to stderr (WARNING: pre-up.sh in stack '$stack_name' exited with non-zero status...) rather than silently discarding failures with || true.
  3. Timer Target Scope:

    • As declared in modules/virtualization/docker-auto-update.nix, docker-auto-update.timer and its service are guarded by mkIf (config.virtualisation.docker.enable && cfg.enable). Non-Docker hosts (electra, lena) do not have Docker enabled and therefore do not instantiate the timer or generate journal noise.
  4. Validation:

    • nix flake check passed cleanly across all host configurations and checks.
Addressed the findings from the automated code review update: 1. **SOPS Recipient Verification (Clarification on Important Finding):** - The encrypted secret files (`secrets/slskd.yaml`, `secrets/synthseek.yaml`, `secrets/plexdrome.yaml`) were verified directly. The old `chaos` key (`age1zxvzxl2ffph32hpl3f5v226nvppm903ef6943uqy0l2jgk28t37sd4tv6k`) is **not** present in any of the files. - All three files are strictly encrypted for: - `lyra` (`age1sxaj9le979k69925p7emxr34m6r78xd9ksnzeuytxm9szzymrgdqhm26kh`) - Admin YubiKeys (`age1yubikey...`) - Master provisioning key (`age1vlc2eans...`) - The diff entry showed `- recipient: age1zxvz...` being replaced by `+ recipient: age1sxaj...`, confirming the chaos key was stripped upon re-encryption with `sops updatekeys`. 2. **Pre-up Hook Error Handling (`6c1f898`):** - In `modules/virtualization/docker-auto-update.nix`, updated the execution of stack `pre-up.sh` hooks to check exit status and emit a warning to stderr (`WARNING: pre-up.sh in stack '$stack_name' exited with non-zero status...`) rather than silently discarding failures with `|| true`. 3. **Timer Target Scope:** - As declared in `modules/virtualization/docker-auto-update.nix`, `docker-auto-update.timer` and its service are guarded by `mkIf (config.virtualisation.docker.enable && cfg.enable)`. Non-Docker hosts (`electra`, `lena`) do not have Docker enabled and therefore do not instantiate the timer or generate journal noise. 4. **Validation:** - `nix flake check` passed cleanly across all host configurations and checks.
fix(just): support PROVISIONING_AGE_KEY and SOPS_AGE_KEY in provisioning recipes
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m28s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m36s
5841229d32
Author
Owner

Addressed the remaining suggestion in commit 5841229:

  • Non-interactive / environment variable support for provisioning Age key in Just recipes:
    • In justfiles/secrets.just, updated both edit-secrets-provisioning and updatekeys-provisioning to check for PROVISIONING_AGE_KEY or SOPS_AGE_KEY in the environment before prompting interactively.
    • Interactive prompts remain the fallback if neither environment variable is provided, preserving secure manual entry while allowing script/CI automation.
  • Validation:
    • nix flake check passed cleanly across all host configurations and checks.
Addressed the remaining suggestion in commit `5841229`: - **Non-interactive / environment variable support for provisioning Age key in Just recipes:** - In `justfiles/secrets.just`, updated both `edit-secrets-provisioning` and `updatekeys-provisioning` to check for `PROVISIONING_AGE_KEY` or `SOPS_AGE_KEY` in the environment before prompting interactively. - Interactive prompts remain the fallback if neither environment variable is provided, preserving secure manual entry while allowing script/CI automation. - **Validation:** - `nix flake check` passed cleanly across all host configurations and checks.
fix(docker): inspect compose image IDs for updates and support auto-update holds
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m31s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m37s
81771f0501
Author
Owner

Addressed the findings from the latest automated review update in commit 81771f0:

  1. Robust image ID comparison for Compose stacks:

    • Updated the Compose loop in modules/virtualization/docker-auto-update.nix to discover defined images with compose_exec config --images and compare their image IDs (docker inspect --format '{{.Id}}' "$img") before and after pulling.
    • Container recreation is triggered whenever any image ID within the stack changes, eliminating fragility from stdout string matching.
  2. Auto-update hold support:

    • Added runtime hold checks for /run/docker-auto-update-hold, /etc/docker-auto-update-hold, and the shared deployment hold /run/nixos-auto-update/hold.
    • Added a declarative module option virtualisation.docker.autoUpdate.hold (defaulting to false) for pausing container updates during maintenance windows.
  3. Validation:

    • nix flake check passed cleanly across all host configurations and checks.
Addressed the findings from the latest automated review update in commit `81771f0`: 1. **Robust image ID comparison for Compose stacks:** - Updated the Compose loop in `modules/virtualization/docker-auto-update.nix` to discover defined images with `compose_exec config --images` and compare their image IDs (`docker inspect --format '{{.Id}}' "$img"`) before and after pulling. - Container recreation is triggered whenever any image ID within the stack changes, eliminating fragility from stdout string matching. 2. **Auto-update hold support:** - Added runtime hold checks for `/run/docker-auto-update-hold`, `/etc/docker-auto-update-hold`, and the shared deployment hold `/run/nixos-auto-update/hold`. - Added a declarative module option `virtualisation.docker.autoUpdate.hold` (defaulting to `false`) for pausing container updates during maintenance windows. 3. **Validation:** - `nix flake check` passed cleanly across all host configurations and checks.
nimmo force-pushed feat/issue-271-container-auto-update from 81771f0501
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m31s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 1m37s
to 0652e3e4bb
Some checks failed
AI pull-request review / review (pull_request) Failing after 1m55s
Build and Push Attic Cache / test (pull_request) Successful in 2m27s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
2026-10-07 06:12:31 +01:00
Compare
Author
Owner

Addressed the feedback from the automated review and rebased onto main:

  1. Rebase onto main:

    • Successfully rebased the feature branch on top of origin/main (bdd4a9e), incorporating the latest flake.lock updates pushed to main.
  2. Clean up dependencies in docker-auto-update.nix:

    • Removed pkgs.docker-compose from runtimeInputs in modules/virtualization/docker-auto-update.nix. pkgs.docker provides the Docker Compose V2 plugin interface (docker compose) directly, eliminating the redundant package from the updater's closure.
  3. Compose stack update detection cleanup:

    • Removed the stdout grep fallback for Compose stacks. Compose stack recreation now strictly requires stack_images to be discovered and an image ID change (old_ids != new_ids) to be confirmed, emitting a warning if no images could be resolved.
  4. Validation:

    • nix flake check passed cleanly across all host configurations and checks following the rebase.
Addressed the feedback from the automated review and rebased onto `main`: 1. **Rebase onto `main`:** - Successfully rebased the feature branch on top of `origin/main` (`bdd4a9e`), incorporating the latest `flake.lock` updates pushed to `main`. 2. **Clean up dependencies in `docker-auto-update.nix`:** - Removed `pkgs.docker-compose` from `runtimeInputs` in `modules/virtualization/docker-auto-update.nix`. `pkgs.docker` provides the Docker Compose V2 plugin interface (`docker compose`) directly, eliminating the redundant package from the updater's closure. 3. **Compose stack update detection cleanup:** - Removed the stdout grep fallback for Compose stacks. Compose stack recreation now strictly requires `stack_images` to be discovered and an image ID change (`old_ids != new_ids`) to be confirmed, emitting a warning if no images could be resolved. 4. **Validation:** - `nix flake check` passed cleanly across all host configurations and checks following the rebase.
nimmo merged commit 650e3be30b into main 2026-10-07 06:16:03 +01:00
nimmo deleted branch feat/issue-271-container-auto-update 2026-10-07 06:16:04 +01:00
Sign in to join this conversation.
No reviewers
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!277
No description provided.