From 63cc575eb9f89e1365921ad49857a657407152e1 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Mon, 5 Oct 2026 21:35:27 +0200 Subject: [PATCH] the two volume-fill steps are block scalars, so their comments are comments --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab5c03e..af00336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,9 +217,18 @@ jobs: - name: Put the upstream config where the host daemon can see it env: COMPOSE_PROJECT_NAME: openwafci-image - run: + run: | set -eu VOL="${COMPOSE_PROJECT_NAME}_openwaf-upstream-conf" + # A run that died mid-scene leaves its bans in the stack's data volume: + # `compose down` keeps named volumes, and the runner reuses the same + # project name every push. Measured on run 2361, where the 502-upstream + # scene opened with the source already banned (expected 502, got 403) + # because runs 2350 and 2355 left state behind. The gate's own scenes + # rely on data outliving `compose down`, so the clean has to happen + # before the stack starts, not in its teardown. + docker volume rm "${COMPOSE_PROJECT_NAME}_openwaf-data" \ + "${COMPOSE_PROJECT_NAME}_openwaf-geoip" >/dev/null 2>&1 || true docker volume create "$VOL" >/dev/null docker run --rm -i -v "$VOL:/conf" busybox:1.37 sh -c 'cat > /conf/default.conf' < deploy/upstream.conf docker run --rm -v "$VOL:/conf" busybox:1.37 sh -c 'wc -c /conf/default.conf' @@ -349,9 +358,18 @@ jobs: - name: Put the upstream config where the host daemon can see it env: COMPOSE_PROJECT_NAME: openwafci-console - run: + run: | set -eu VOL="${COMPOSE_PROJECT_NAME}_openwaf-upstream-conf" + # A run that died mid-scene leaves its bans in the stack's data volume: + # `compose down` keeps named volumes, and the runner reuses the same + # project name every push. Measured on run 2361, where the 502-upstream + # scene opened with the source already banned (expected 502, got 403) + # because runs 2350 and 2355 left state behind. The gate's own scenes + # rely on data outliving `compose down`, so the clean has to happen + # before the stack starts, not in its teardown. + docker volume rm "${COMPOSE_PROJECT_NAME}_openwaf-data" \ + "${COMPOSE_PROJECT_NAME}_openwaf-geoip" >/dev/null 2>&1 || true docker volume create "$VOL" >/dev/null docker run --rm -i -v "$VOL:/conf" busybox:1.37 sh -c 'cat > /conf/default.conf' < deploy/upstream.conf docker run --rm -v "$VOL:/conf" busybox:1.37 sh -c 'wc -c /conf/default.conf'