From 3fb1f3ca6ed7e680afca43aa8e7b17d4fc376317 Mon Sep 17 00:00:00 2001 From: oqyude Date: Sat, 24 Oct 2026 02:19:39 +0300 Subject: [PATCH] fix(ci): drop the stale 3x-ui whitelist entry and the wrong helper name (T43) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check #1 allows `:latest` images listed in LATEST_ALLOWLIST. The list still carried `ghcr.io/mhsanaei/3x-ui:latest` with the comment "panel frozen on :latest", but the panel has been pinned to `ghcr.io/mhsanaei/3x-ui:v3.10.2` since 2026-10-20 (modules/containers/3x-ui.nix:62, R1.5). The entry matched nothing, and the comment stated the opposite of the invariant it cited. Consequence of the stale entry: if someone reverted the pin to `:latest`, the check would have stayed green and said nothing. Verified by mutation — with v3.10.2 temporarily replaced by :latest the check now reports "Images using :latest (not in whitelist): ghcr.io/mhsanaei/3x-ui:latest"; before this commit the same mutation passed silently. Also: check #4's description named `mkServiceStorage`, while the guard the consumers actually call is `mkStorageGuard` (lib/xlib/helpers.nix:180). Both names exist in that file and mean different things, so the comment pointed at the wrong helper. Now it names the right one and says so explicitly. `bash .ci/checks.sh --no-build` -> PASS 3 / FAIL 0, before and after; the current tree contains exactly two `:latest` images, both tape-rotation, both still whitelisted. Not pushed. --- .ci/checks.sh | 14 +++++++++----- .pre-commit-config.yaml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.ci/checks.sh b/.ci/checks.sh index 31fd9ad..babc1e1 100755 --- a/.ci/checks.sh +++ b/.ci/checks.sh @@ -13,12 +13,15 @@ # Checks implemented: # #2 nix flake check (all outputs evaluate) # #7 secrets/ files match .sops.yaml path_regex -# #1 no `:latest` in container images (with R1.5 whitelist: 3x-ui is frozen on :latest) +# #1 no `:latest` in container images (whitelist: tape-rotation only; +# 3x-ui is pinned to v3.10.2 since 2026-10-20, R1.5) # #8 every import reference resolves (no dangling imports) — added 2026-10-24 # # Not yet implemented (candidates from analysis-report.md §5): # #3 coredns domains ↔ nginx vhosts bidirectional match -# #4 mkServiceStorage consumers have existing External dir +# #4 mkStorageGuard consumers have an existing External dir +# (lib/xlib/helpers.nix:180 — note the helper is mkStorageGuard, not +# mkServiceStorage; the two names referred to the same idea historically) # #5 last nftables chain rule is explicit (drop/reject/policy) # #6 listen.addr is interface, not network (e.g. 0.0.0.0 is OK, 192.168.0.0/24 is not) @@ -28,9 +31,10 @@ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$REPO_ROOT" LATEST_ALLOWLIST=( - # R1.5: 3x-ui panel frozen on :latest; Xray version is panel state (R1.8) - "ghcr.io/mhsanaei/3x-ui:latest" - # tape-rotation: data on External (storage-guarded); manual updates + # tape-rotation: data on External (storage-guarded); manual updates. + # The 3x-ui panel used to be whitelisted here as "frozen on :latest". + # It is pinned to ghcr.io/mhsanaei/3x-ui:v3.10.2 since 2026-10-20 (R1.5), + # so a `:latest` for it must now fail this check instead of being allowed. "docker.io/elizaroveugene/taperotation-backend:latest" "docker.io/elizaroveugene/taperotation-frontend:latest" ) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 07483d5..c8ab5a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: name: nixos flake invariant checks description: | Runs .ci/checks.sh: sops path_regex compliance, no - `:latest` in container images (with R1.5/R1.8 whitelist), + `:latest` in container images (whitelist: tape-rotation only), and `nix flake check` (skippable via --no-build). entry: bash .ci/checks.sh --no-build language: script