Route every current_package_state status change through one transitionStatus path: read the observed status, validate against PackageStatusTransitions, run a status-guarded UPDATE, record terminal history. Replaces ten raw-SQL transition functions whose WHERE guards validated nothing and silently no-op'd on an illegal state. ApproveUpdate, the Reject/Install/Set* family, BulkApprove and UpdatePackageStatus now share the core; illegal moves return a named from->to error instead of a silent miss, and concurrent callers are caught by the guarded row count. Migration 047 renames the terminal success state updated -> installed in current_package_state and update_version_history, realigning both CHECK constraints with the Go PackageStatus/HistoryStatus constants. UpdateStats updated_updates -> installed_updates to match. UpdateCurrentStateInTx documents its reconcile CASE as the SQL twin of models.ReconcileFromScan so the two stay in lockstep. Dashboard: vulnerable-package count surfaced in AttentionPanel, plus a Vulnerable quick-filter on the Updates view.
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.2.0}
|
|
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:
|