Files
archy/.github/workflows/ci.yml
T
archipelagoandClaude Opus 5 cbfda30579
Demo images / Build & push demo images (push) Failing after 2m22s
fix(update): never advertise a downgrade as an update; clear every stale BTCPay pin
The app store offered "update to 2.3.9" on a node already running 2.4.2 — the
release that fixes an actively exploited 2FA bypass. Taking it would have
rolled the node back onto the vulnerable version.

Root cause: available_update_for_images compared tags for inequality only.
Same repo + different tag meant "update available", with no ordering. Every
version claim upstream of it can go stale — the signed catalog, a legacy
catalog entry, the image-versions.sh baseline pin — and any one of them
lagging turned into a backwards Update button.

Guard added: when both tags parse as dotted-numeric versions, a lower pinned
version is never offered. Tags that cannot be ordered (RELEASE.2024-11-07…,
14-vectorchord0.4.3) keep the previous behaviour rather than silently losing
updates. This makes stale data fail safe, which matters more than any single
pin being correct.

Four sources still named 2.3.9, three of them able to act on it:
- releases/app-catalog.json — a LEGACY `btcpay` entry, distinct from
  `btcpay-server`, carrying a concrete 2.3.9 image. catalog_primary_image
  treats that as authoritative, so this is what drove the button. Fixed, but
  held back from this commit: it needs re-signing.
- scripts/image-versions.sh — the baseline pin used when the catalog does not
  cover an app.
- stacks.rs — the legacy BTCPay installer, twice. The fallback install path
  would have deployed 2.3.9 outright.
- neode-ui curatedApps/marketplaceData and public/catalog.json — the store's
  displayed version, hardcoded rather than read from the catalog, which is why
  it still showed 2.3.9 after the update landed.

Audited every other installer for the same shape. The remaining literals are
the immich stack, which currently agrees with its manifests; hits in
set_config.rs and app_catalog.rs are test fixtures. To keep it that way,
scripts/check-installer-image-pins.py asserts that any installer literal
naming the same repository as an app manifest carries the same tag, and runs
blocking in CI. Verified it catches a simulated revert to 2.3.9.

Tests: 13/13 in image_versions including the exact BTCPay case, a genuine
upgrade still offered, equal versions silent, prerelease suffixes ordered on
their numbers, and opaque tags unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-07 12:42:11 -04:00

124 lines
3.7 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
RUST_VERSION: stable
NODE_VERSION: 20
jobs:
rust:
name: Rust
runs-on: ubuntu-latest
defaults:
run:
working-directory: core
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy
- name: Format
run: cargo fmt --all -- --check
# KEY-05 layer (b) is enforced HERE, with no step of its own: core/clippy.toml
# bans the defaulted RNG entry points, and `-D warnings` already turns a
# `disallowed_methods` hit into a build failure. `--all-targets` covers tests
# too, deliberately. See docs/security/KEY-05-ENTROPY-ENFORCEMENT.md
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
# KEY-05 layer (c) — see core/deny.toml for the policy and its rationale.
#
# The version is pinned deliberately. EmbarkStudios/cargo-deny-action exposes
# no input to pin the cargo-deny version, and an unpinned supply-chain checker
# is a contradiction in terms, so the tool is installed from crates.io — the
# source actually vetted at the 10-06 Task 5 legitimacy checkpoint — rather
# than by adding another unvetted action to this workflow.
#
# `check bans` ONLY: the advisories gate is not enabled (bans-only policy).
- name: Supply chain (cargo-deny)
run: |
cargo install --locked cargo-deny --version 0.20.2
cargo deny check bans
- name: Test
run: cargo test --all-features
frontend:
name: Frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: neode-ui
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: neode-ui/package-lock.json
- name: Install
run: npm ci
- name: Type check
run: npm run type-check
- name: Test
run: npm test
- name: Build
run: npm run build
manifests:
name: App Manifests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install YAML parser
run: python3 -m pip install --quiet pyyaml
- name: Validate manifests
run: |
for manifest in apps/*/manifest.yml; do
./scripts/validate-app-manifest.sh --repo-audit "$manifest"
done
# The signed catalog overrides on-disk manifests on every node, so a
# catalog naming a registry host the deployed fleet does not trust breaks
# every install fleet-wide. Blocking, and cheap.
- name: Catalog registry trust floor
run: python3 scripts/check-catalog-registry-trust.py
# A stale image literal on the fallback install path deploys an old
# image after the manifest has moved on — how a withdrawn, vulnerable
# release gets installed post-fix. Blocking.
- name: Installer image pins
run: python3 scripts/check-installer-image-pins.py
# Advisory: shows where the release catalog has fallen behind the
# manifests in this repo. Not blocking, because the catalog can only be
# updated through the signing ceremony, so drift is expected between a
# manifest landing and the next signed release.
- name: Catalog drift (advisory)
continue-on-error: true
run: python3 scripts/check-app-catalog-drift.py --catalog releases/app-catalog.json --release