15 Commits
Author SHA1 Message Date
adguard-cidre-ci fba41f5da7 Bump build version to 1.5.5 [skip ci] 2026-11-28 04:07:49 +00:00
Boteex Bot ec7fef42df Pin python Docker tag to 0f9552b (#30)
CI / build-and-scan (push) Successful in 48s
2026-11-28 05:03:27 +01:00
Djeex d4869064e6 Use the shared cicdeex actions (#29)
CI / build-and-scan (push) Successful in 32s
Co-authored-by: Djeex <[email protected]>
2026-11-22 13:20:37 +01:00
Djeex 711dd000a5 Merge pull request 'Run the weekly scan on Saturday' (#28) from ci-align into main
CI / build-and-scan (push) Successful in 43s
2026-11-21 23:48:35 +01:00
Djeex 97e30ebf06 Run the weekly scan on Saturday
CI / build-and-scan (pull_request) Successful in 38s
2026-11-21 22:31:35 +00:00
Djeex bde49062b9 Merge pull request 'Use the shared Renovate preset' (#27) from renovate-preset into main
CI / build-and-scan (push) Successful in 1m6s
2026-11-21 22:12:02 +01:00
Djeex 11d84c91c9 Use the shared Renovate preset
CI / build-and-scan (pull_request) Successful in 31s
2026-11-21 20:56:56 +00:00
Djeex e84aecaf35 Do not pin digests for CI tool images (#25)
CI / build-and-scan (push) Successful in 27s
## Summary
- `pinDigests: false` for the custom regex manager (CI tool images in `docker run`/`docker create`). Renovate cannot write a digest in those lines, so its `pin-dependencies` branch failed with `update failure` and no Dockerfile digest was pinned.

## Test plan
- [ ] CI green on this PR
- [ ] After merge, the next Renovate run opens a `pin` PR for the Dockerfile digests, without `update failure`
- [ ] Trivy/gitleaks/hadolint updates keep working

Reviewed-on: #25
Co-authored-by: Djeex <[email protected]>
2026-11-21 19:45:42 +01:00
Djeex 4cd835f708 Merge pull request 'Update aquasec/trivy Docker tag to v0.76.2' (#24) from renovate/aquasec-trivy-0.x into main
CI / build-and-scan (push) Successful in 1m0s
2026-11-21 19:25:55 +01:00
Djeex 9a4930ff4a Update aquasec/trivy Docker tag to v0.76.2
renovate/stability-days Updates have met minimum release age requirement
CI / build-and-scan (pull_request) Successful in 24s
2026-11-21 18:17:15 +00:00
Djeex 01dbf55e93 Track CI tool images with Renovate (#23)
CI / build-and-scan (push) Successful in 2m16s
## Summary
- Custom Renovate manager for the CI tool images pinned in `docker run`/`docker create` commands (Trivy, gitleaks, hadolint), which the default managers do not detect.
- Renovate will now open PRs to bump them; they are not automerged.

## Test plan
- [ ] CI green on this PR
- [ ] After merge, Renovate opens a PR bumping Trivy
- [ ] That PR passes CI before merging

Reviewed-on: #23
Co-authored-by: Djeex <[email protected]>
2026-11-21 18:46:36 +01:00
Djeex ec4ef966bf Pin image digests and add minimum release age (#22)
CI / build-and-scan (push) Successful in 27s
## Summary
- `docker:pinDigests`: Renovate pins image digests and opens digest PRs when a base image is rebuilt, so security fixes are picked up.
- `minimumReleaseAge`: 3 days globally, 7 days for pip.
- Automerge for `pin` and `digest` updates, like patch updates.

## Test plan
- [ ] CI green on this PR
- [ ] After merge, Renovate opens a pin PR for the Dockerfile digests
- [ ] That PR automerges once CI passes

Reviewed-on: #22
Co-authored-by: Djeex <[email protected]>
2026-11-21 18:11:46 +01:00
Djeex 9cbdb38547 Update dependency pyyaml to v6.0.4 (#21)
CI / build-and-scan (push) Successful in 29s
Co-authored-by: Djeex <[email protected]>
2026-11-21 01:06:07 +01:00
adguard-cidre-ci f5c388beeb Bump build version to 1.5.4 [skip ci] 2026-10-30 04:16:48 +00:00
Djeex b80f466f35 Update python Docker tag to v3.15.2
CI / build-and-scan (pull_request) Successful in 1m2s
CI / build-and-scan (push) Successful in 37s
2026-10-30 04:05:13 +00:00
5 changed files with 43 additions and 240 deletions

No files matched your search

+39 -210
View File
@@ -6,7 +6,8 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
schedule: schedule:
- cron: "0 6 * * 1" # Saturday 05:00 UTC: 06:00 in Paris in winter, 07:00 in summer (Gitea runs cron in UTC).
- cron: "0 5 * * 6"
jobs: jobs:
build-and-scan: build-and-scan:
@@ -18,20 +19,20 @@ jobs:
fetch-depth: 0 fetch-depth: 0
persist-credentials: false persist-credentials: false
- name: Get shared actions
uses: actions/checkout@v7
with:
repository: labeex/cicdeex
ref: 1.1.0
token: ${{ secrets.CICDEEX_TOKEN }}
path: .cicdeex
persist-credentials: false
- name: Scan for secrets - name: Scan for secrets
run: | uses: ./.cicdeex/secret-scan
# docker cp, not a build COPY: a repo's own .dockerignore (e.g. one that
# excludes .git for prod builds) would otherwise silently give an empty,
# falsely-clean scan.
CID=$(docker create zricethezav/gitleaks:v8.30.1 detect --source=/repo --no-banner -v)
docker cp . "$CID:/repo"
docker start -a "$CID"
STATUS=$?
docker rm "$CID" > /dev/null
exit $STATUS
- name: Lint Dockerfile with hadolint - name: Lint Dockerfile with hadolint
run: docker run --rm -i hadolint/hadolint:v2.15.1-alpine hadolint --failure-threshold error - < Dockerfile uses: ./.cicdeex/hadolint
- name: Build Docker image - name: Build Docker image
run: | run: |
@@ -72,210 +73,38 @@ jobs:
- name: Scan with Trivy (critical - blocking) - name: Scan with Trivy (critical - blocking)
id: trivy_critical id: trivy_critical
continue-on-error: true continue-on-error: true
run: | uses: ./.cicdeex/trivy
docker run --rm \ with:
-e DOCKER_HOST=tcp://dockerhost:2375 \ image: adguard-cidre:ci
--add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 1 --severity CRITICAL adguard-cidre:ci
- name: Handle CRITICAL findings - name: Handle CRITICAL findings
if: steps.trivy_critical.outcome == 'failure' if: steps.trivy_critical.outcome == 'failure'
run: | uses: ./.cicdeex/remediate
if [ "${{ github.event_name }}" != "schedule" ]; then with:
echo "::error::CRITICAL vulnerabilities found, failing the build." push-token: ${{ secrets.CI_PUSH_TOKEN }}
exit 1
fi
echo "Scheduled scan found CRITICAL vulnerabilities — attempting an automatic apk upgrade + rescan."
sed -i '/^FROM .* AS base$/a RUN apk upgrade --no-cache' Dockerfile
docker build -t adguard-cidre:remediated .
if docker run --rm \
-e DOCKER_HOST=tcp://dockerhost:2375 \
--add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 1 --severity CRITICAL adguard-cidre:remediated; then
echo "apk upgrade clears the CRITICAL finding(s) — opening a PR for review."
BRANCH="auto/cve-fix-$(date +%Y%m%d)-$(echo "${{ github.sha }}" | cut -c1-7)"
git config user.name "adguard-cidre-ci"
git config user.email "[email protected]"
git checkout -b "$BRANCH"
git add Dockerfile
git commit -m "Auto-remediate CRITICAL CVE via apk upgrade"
git config --unset-all http.https://git.djeex.fr/.extraheader || true
git push "https://Djeex:${{ secrets.CI_PUSH_TOKEN }}@git.djeex.fr/Djeex/adguard-cidre.git" "HEAD:$BRANCH"
PR_JSON=$(curl -s -X POST \
-H "Authorization: token ${{ secrets.CI_PUSH_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg head "$BRANCH" '{title: "🔒 Auto: remediate CRITICAL CVE via apk upgrade", head: $head, base: "main", body: "Opened automatically by the scheduled CVE scan. An `apk upgrade --no-cache` cleared the CRITICAL Trivy finding(s) in a rebuild — review the diff and merge to publish the fix."}')" \
"https://git.djeex.fr/api/v1/repos/Djeex/adguard-cidre/pulls")
echo "PR API response: $(echo "$PR_JSON" | jq -r '.html_url // .message // "unknown"')"
else
echo "::error::apk upgrade does not clear the CRITICAL finding(s) — no automatic fix available, needs manual review."
exit 1
fi
- name: Scan with Trivy (high - informative) - name: Scan with Trivy (high - informative)
run: | uses: ./.cicdeex/trivy
docker run --rm \ with:
-e DOCKER_HOST=tcp://dockerhost:2375 \ image: adguard-cidre:ci
--add-host=dockerhost:host-gateway \ severity: HIGH
aquasec/trivy:0.74.0 image --exit-code 0 --severity HIGH adguard-cidre:ci exit-code: "0"
- name: Publish tagged image - name: Publish tagged image
id: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: | uses: ./.cicdeex/publish
BEFORE="${{ github.event.before }}" with:
if [ -n "$BEFORE" ] && [ "$BEFORE" != "0000000000000000000000000000000000000000" ] && git cat-file -e "$BEFORE" 2>/dev/null; then image: adguard-cidre:ci
BASE_REF="$BEFORE" paths: '^(Dockerfile|blocklist_scheduler\.py|VERSION)$'
else push-token: ${{ secrets.CI_PUSH_TOKEN }}
BASE_REF="HEAD~1" registry-token: ${{ secrets.REGISTRY_TOKEN }}
fi github-mirror: "true"
CHANGED=$(git diff --name-only "$BASE_REF" "${{ github.sha }}") github-token: ${{ secrets.GH_TOKEN }}
echo "Changed files:"
echo "$CHANGED"
if ! echo "$CHANGED" | grep -qE '^(Dockerfile|blocklist_scheduler\.py|VERSION)$'; then - name: Notify failures
echo "No container-relevant file changed, skipping publish." if: always()
exit 0 uses: ./.cicdeex/notify
fi with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
if echo "$CHANGED" | grep -qE '^VERSION$'; then status: ${{ job.status }}
echo "VERSION was manually edited in this push, using it as-is."
else
echo "VERSION untouched but container files changed, auto-bumping the build number (Z)."
OLD_VERSION=$(tr -d '[:space:]' < VERSION)
IFS='.' read -r MAJOR MINOR PATCH <<< "$OLD_VERSION"
NEW_VERSION="${MAJOR}.${MINOR}.$((PATCH + 1))"
echo "$NEW_VERSION" > VERSION
git config user.name "adguard-cidre-ci"
git config user.email "[email protected]"
git add VERSION
git commit -m "Bump build version to $NEW_VERSION [skip ci]"
# Belt and suspenders: actions/checkout can leave its own ephemeral
# credential injected as an extraheader, which would silently override
# the URL-embedded token below. persist-credentials:false on checkout
# should already prevent this, but strip it here too just in case.
git config --unset-all http.https://git.djeex.fr/.extraheader || true
git push "https://Djeex:${{ secrets.CI_PUSH_TOKEN }}@git.djeex.fr/Djeex/adguard-cidre.git" HEAD:main
fi
VERSION=$(tr -d '[:space:]' < VERSION)
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
MINOR_TAG="${MAJOR}.${MINOR}"
IMAGE=git.djeex.fr/djeex/adguard-cidre
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.djeex.fr -u Djeex --password-stdin
# Retag the already-built, already-scanned image — never rebuild for publish,
# so what ships is byte-for-byte what Trivy just scanned.
docker tag adguard-cidre:ci "$IMAGE:latest"
docker tag adguard-cidre:ci "$IMAGE:$MINOR_TAG"
docker tag adguard-cidre:ci "$IMAGE:$VERSION"
docker push "$IMAGE:latest"
docker push "$IMAGE:$MINOR_TAG"
docker push "$IMAGE:$VERSION"
GHCR_IMAGE=ghcr.io/djeex/adguard-cidre
echo "${{ secrets.GH_TOKEN }}" | docker login ghcr.io -u Djeex --password-stdin
docker tag adguard-cidre:ci "$GHCR_IMAGE:latest"
docker tag adguard-cidre:ci "$GHCR_IMAGE:$MINOR_TAG"
docker tag adguard-cidre:ci "$GHCR_IMAGE:$VERSION"
docker push "$GHCR_IMAGE:latest"
docker push "$GHCR_IMAGE:$MINOR_TAG"
docker push "$GHCR_IMAGE:$VERSION"
TRIGGER_MSG=$(git log -1 --format=%s "${{ github.sha }}")
PR_NUM=$(echo "$TRIGGER_MSG" | grep -oE '#[0-9]+' | head -1 | tr -d '#' || true)
CATEGORY="🔧 Maintenance"
CHANGE_TITLE="$TRIGGER_MSG"
if [ -n "$PR_NUM" ]; then
PR_JSON=$(curl -s -H "Authorization: token ${{ secrets.CI_PUSH_TOKEN }}" \
"https://git.djeex.fr/api/v1/repos/Djeex/adguard-cidre/pulls/$PR_NUM")
PR_TITLE=$(echo "$PR_JSON" | jq -r '.title // empty' 2>/dev/null || true)
LABELS=$(echo "$PR_JSON" | jq -r '.labels[]?.name' 2>/dev/null || true)
if [ -n "$PR_TITLE" ]; then
CHANGE_TITLE="$PR_TITLE"
fi
if echo "$LABELS" | grep -qx 'bug'; then
CATEGORY="⚠️ Hotfix"
elif echo "$LABELS" | grep -qx 'major'; then
CATEGORY="💥 Breaking change"
elif echo "$LABELS" | grep -qx 'minor'; then
CATEGORY="✨ Update"
fi
fi
REPO_URL="https://git.djeex.fr/Djeex/adguard-cidre"
COMMIT_LIST=$(git log --no-merges --format="- %s ([%h](${REPO_URL}/commit/%H))" "$BASE_REF".."${{ github.sha }}")
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
SOURCE_LINE="[${SHORT_SHA}](${REPO_URL}/commit/${{ github.sha }})"
if [ -n "$PR_NUM" ]; then
SOURCE_LINE="[#${PR_NUM}](${REPO_URL}/pulls/${PR_NUM}) · ${SOURCE_LINE}"
fi
BODY=$(cat <<EOF
## Changelog
### ${CATEGORY}
${CHANGE_TITLE}
**Source:** ${SOURCE_LINE}
**Image:** \`${IMAGE}:${VERSION}\`
**Commits:**
${COMMIT_LIST}
EOF
)
JSON_PAYLOAD=$(jq -n \
--arg tag "$VERSION" \
--arg name "$VERSION" \
--arg body "$BODY" \
'{tag_name: $tag, name: $name, target_commitish: "main", body: $body}')
curl -s -o /dev/null -w "Release API response: %{http_code}\n" -X POST \
-H "Authorization: token ${{ secrets.CI_PUSH_TOKEN }}" \
-H "Content-Type: application/json" \
-d "$JSON_PAYLOAD" \
"https://git.djeex.fr/api/v1/repos/Djeex/adguard-cidre/releases"
MIRROR_NOTICE="_This github repo is a mirror of https://git.djeex.fr/Djeex/adguard-cidre. You'll find full package, PR, history and release note there._"
GH_BODY=$(printf '%s\n\n%s' "$MIRROR_NOTICE" "$BODY")
GH_JSON_PAYLOAD=$(jq -n \
--arg tag "$VERSION" \
--arg name "$VERSION" \
--arg body "$GH_BODY" \
--arg sha "${{ github.sha }}" \
'{tag_name: $tag, name: $name, target_commitish: $sha, body: $body}')
GH_STATUS=0
for i in 1 2 3 4 5; do
GH_STATUS=$(curl -s -o /tmp/gh_release.json -w "%{http_code}" -X POST \
-H "Authorization: Bearer ${{ secrets.GH_TOKEN }}" \
-H "Accept: application/vnd.github+json" \
-H "Content-Type: application/json" \
-d "$GH_JSON_PAYLOAD" \
"https://api.github.com/repos/Djeex/adguard-cidre/releases")
if [ "$GH_STATUS" = "201" ]; then
break
fi
echo "GitHub Release attempt $i failed (HTTP $GH_STATUS) — mirror may not have synced this commit yet, retrying in 15s..."
sleep 15
done
echo "GitHub Release API response: $GH_STATUS"
if [ "$GH_STATUS" != "201" ]; then
cat /tmp/gh_release.json 2>/dev/null || true
fi
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.15.1-alpine AS base FROM python:3.15.2-alpine@sha256:0f9552bb28711333da16915ec146f5e6bb44a7fdac9ced15dc17c2e0206346dd AS base
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
+1 -1
View File
@@ -1 +1 @@
1.5.3 1.5.5
+1 -27
View File
@@ -1,30 +1,4 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"], "extends": ["local>labeex/renovateex"]
"timezone": "Europe/Paris",
"labels": ["bot"],
"packageRules": [
{
"matchManagers": ["pip_requirements"],
"matchUpdateTypes": ["patch", "minor"],
"automerge": true
},
{
"matchManagers": ["dockerfile"],
"matchUpdateTypes": ["patch"],
"automerge": true
},
{
"matchUpdateTypes": ["major"],
"addLabels": ["major"]
},
{
"matchUpdateTypes": ["minor"],
"addLabels": ["minor"]
}
],
"vulnerabilityAlerts": {
"enabled": true,
"addLabels": ["bug"]
}
} }
+1 -1
View File
@@ -1,3 +1,3 @@
requests==2.34.2 requests==2.34.2
pyyaml==6.0.3 pyyaml==6.0.4
schedule==1.2.2 schedule==1.2.2