Treats each ecosystem scan as the authoritative full set for that (agent, ecosystem) pair. Packages absent from a successful scan that are still in a waiting state (pending/approved) are closed to installed with out-of-band provenance — no operator action required. State machine: - Added pending/approved → installed edges (out-of-band resolution path) - Added installed → pending edge (reactivation when a new version reappears) - ReconcileFromScan updated to match: installed now reopens, ignored/failed preserved Server (ReportUpdates): - closeScanAbsentRows goroutine: diff waiting rows against reported set, transition absent rows via transitionStatus (guarded UPDATE, idempotent) - Provenance stamping: redflag_receipt if a consumed capability token exists, out_of_band otherwise - System event emitted per closure for audit trail - scanEcosystemSupported gate: dnf/apt only; failed/partial scans never close rows Agent: - UpdateReport extended with Ecosystem + ScanSucceeded fields - APT/DNF scan handlers now always report on successful scan (even 0 updates) - HandleScanAPT/DNF/Updates: report failure is non-fatal (transport problem, scan succeeded locally) Queries: - GetTrackedNonResting: scoped to pending/approved only — in-flight states (checking_dependencies, pending_dependencies, installing) are orchestrator-owned - TransitionByID: routes closure through the state machine - HasConsumedTokenForUpdate: provenance check for the reconciler - UpdateCurrentStateInTx SQL CASE: installed now reopens to pending on re-scan Tests: reconcile_test.go (5 unit tests including load-bearing TestWaitingStatesResolveOutOfBand), reconcile_test.go handler tests (7 sub-tests). Bump: v0.2.6.1
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: redflag-postgres
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./config/.env:/shared/.env:z
|
|
ports:
|
|
- "31338:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U redflag"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./config/.env
|
|
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: ./server/Dockerfile
|
|
args:
|
|
BUILD_VERSION: ${BUILD_VERSION:-0.2.6.1}
|
|
container_name: redflag-server
|
|
volumes:
|
|
- server-config:/app/config
|
|
- server-data:/app/data
|
|
- ./config/.env:/shared/.env:z
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "31337:8080"
|
|
command: ["./redflag-server"]
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./config/.env
|
|
|
|
web:
|
|
build:
|
|
context: ./web
|
|
dockerfile: Dockerfile
|
|
container_name: redflag-web
|
|
ports:
|
|
- "31336:80"
|
|
depends_on:
|
|
- server
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres-data:
|
|
server-data:
|
|
server-config:
|