prop/.forgejo/workflows/build-base.yaml
Graham McIntire 0c3be97abb
Some checks failed
Build base image / Build and push base image (push) Successful in 3m10s
Build and Push / Build and Push Docker Image (push) Failing after 14s
Build prop-grid-rs / Test, build, push (push) Successful in 12m52s
fix: resolve 27 security, architecture, test, and performance audit findings
P0 (security-critical):
- Gate CSV/ADIF upload tabs behind authentication, add 30s cooldown to all upload handlers
- Cap CSV/ADIF imports at 2,000 rows server-side in both parsers
- Add submitter_verified boolean to contacts (client-cannot-set, anonymous=false)
- Create k8s/secret.example.yaml with placeholders, add LIVE_VIEW_SIGNING_SALT

P1 (high-priority):
- Add Mox.verify_on_exit!() to valkey_test.exs
- Replace DateTime.utc_now() truncation with static ~U literals in map_live_test.exs
- Replace Process.sleep with render_async in pskr_spots_live_test.exs (6 occurrences)
- Add MonitorLive.Show test coverage (4 tests: owner view, non-owner redirect, config success/error)
- Extract duct-detection and mechanism-classification logic from ContactLive.Show into Propagation.PathAnalysis
- Split ContactLive.Show render into 12 function components
- Update CLAUDE.md: remove stale ML model, mark HRDPS active, add backtest/pskr dirs
- Batch CSV import enrichment jobs via new enqueue_for_contacts/1

P2 (medium-priority):
- Set secure:true on session and remember-me cookies in production
- Change SMTP TLS from verify_none to verify_peer with public_key cacerts
- Make /metrics fail-closed in production when PROMETHEUS_AUTH_TOKEN unset
- Add RateLimiter (anon_limit:10, auth_limit:60) to /api/contacts/map
- Add content-security-policy-report-only header
- Add comment noting String.to_atom is compile-time safe in hrdps_client.ex
- Delegate duplicated haversine_km to canonical Microwaveprop.Geo.haversine_km/4
- Consolidate score-tier/color/verdict formatting into Microwaveprop.Format
- Update CLAUDE.md testing section to match actual raw-string-matching practice
- Batch HrrrPointEnqueuer Repo.insert_all calls to single round-trip
- Split weather.ex (1696→216 lines) and radio.ex (1285→54 lines) into purpose-based sub-facades

P3 (low-priority):
- Add LIVE_VIEW_SIGNING_SALT warning comment, extend filter_parameters
- Add host/community validation to snmp_client.ex
- Add raw/1 safety comment in algo_live.ex
- Add hex-audit and cargo-audit Makefile targets
- Add privacy_live smoke test
- Replace notify_listener busy-poll loop with Process.monitor/1 + assert_receive
- Add ContactCommonVolumeRadar changeset validation tests (5 tests)
2026-07-27 18:19:37 -05:00

91 lines
3.2 KiB
YAML

name: Build base image
on:
push:
branches:
- main
paths:
- 'Dockerfile.base'
- '.forgejo/workflows/build-base.yaml'
schedule:
- cron: '0 6 * * 0'
workflow_dispatch:
env:
REGISTRY: git.mcintire.me
OWNER: graham
IMAGE_NAME: prop-base
DOCKER_CLI_VERSION: '28.5.2'
BUILDX_VERSION: '0.35.0'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build-and-push:
name: Build and push base image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Docker CLI and buildx
run: |
set -euo pipefail
curl -fsSL --retry 3 --retry-delay 2 \
"https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_CLI_VERSION}.tgz" \
| tar xz --strip-components=1 -C /usr/local/bin docker/docker
# Docker 23+ routes `docker build` through buildx. The static tarball
# ships only the CLI, so the plugin has to be installed separately or
# DOCKER_BUILDKIT=1 fails with "buildx component is missing".
mkdir -p "$HOME/.docker/cli-plugins"
curl -fsSL --retry 3 --retry-delay 2 \
-o "$HOME/.docker/cli-plugins/docker-buildx" \
"https://github.com/docker/buildx/releases/download/v${BUILDX_VERSION}/buildx-v${BUILDX_VERSION}.linux-amd64"
chmod +x "$HOME/.docker/cli-plugins/docker-buildx"
docker version
docker buildx version
- name: Build and push
env:
REGISTRY_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
set -euo pipefail
IMAGE="${REGISTRY}/${OWNER}/${IMAGE_NAME}"
WGRIB2=$(grep -oP '^ARG WGRIB2_VERSION=\K.*' Dockerfile.base | head -1)
G2C=$(grep -oP '^ARG G2C_VERSION=\K.*' Dockerfile.base | head -1)
SHA_TAG="wgrib2-${WGRIB2}-g2c-${G2C}-${GITHUB_SHA::7}"
# ISO year+week, so the weekly cron re-executes the apt layers for
# Debian security updates but same-week reruns reuse the cache.
# This previously travelled via an `extra_args` input the build action
# never declared, and additionally contained a `$(date ...)` that a
# `with:` value never evaluates. It was doubly dead.
CACHE_BUST=$(date -u +%G-W%V)
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$OWNER" --password-stdin
DOCKER_BUILDKIT=1 docker build \
--file Dockerfile.base \
--build-arg "CACHE_BUST=${CACHE_BUST}" \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--cache-from "${IMAGE}:latest" \
--tag "${IMAGE}:${SHA_TAG}" \
--tag "${IMAGE}:latest" \
.
docker push "${IMAGE}:${SHA_TAG}"
docker push "${IMAGE}:latest"
{
echo "### Base image pushed"
echo ""
echo "- \`${IMAGE}:${SHA_TAG}\`"
echo "- \`${IMAGE}:latest\`"
echo "- cache-bust: \`${CACHE_BUST}\`"
} >> "$GITHUB_STEP_SUMMARY"
docker image rm "${IMAGE}:${SHA_TAG}" "${IMAGE}:latest" 2>/dev/null || true
docker logout "$REGISTRY" || true