Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea00c8dbb4 | ||
|
|
27b21b4701 | ||
|
|
e1bf495afa | ||
|
|
fd8eec3c70 | ||
|
|
e5f383786f | ||
|
|
9e97261ef6 | ||
|
|
529971dcf4 | ||
|
|
db36aa2a41 | ||
|
|
75bde7ea38 | ||
|
|
9604812daa | ||
|
|
584eff4c2a | ||
|
|
c57f3012e9 | ||
|
|
20c1f03dff | ||
|
|
3ab85da567 | ||
|
|
07e6e3c5ae | ||
|
|
a8cf867fe0 |
@@ -0,0 +1,68 @@
|
||||
---
|
||||
# Homelab CI — Docker/heavy lane (git-ci-02)
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master, main]
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
skip-ci-check:
|
||||
runs-on: [homelab, self-hosted, linux]
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
outputs:
|
||||
should-skip: ${{ steps.check.outputs.skip }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- id: check
|
||||
run: |
|
||||
SKIP=0
|
||||
BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
|
||||
MSG="${GITHUB_EVENT_HEAD_COMMIT_MESSAGE:-$(git log -1 --pretty=%B 2>/dev/null || true)}"
|
||||
echo "$BRANCH" "$MSG" | grep -qi '@skipci' && SKIP=1
|
||||
echo "skip=$SKIP" >> $GITHUB_OUTPUT
|
||||
|
||||
docker-ci:
|
||||
needs: skip-ci-check
|
||||
if: needs.skip-ci-check.outputs.should-skip != '1'
|
||||
runs-on: [homelab, self-hosted, linux, heavy, docker]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Hadolint
|
||||
run: |
|
||||
shopt -s globstar nullglob
|
||||
found=0
|
||||
for f in Dockerfile docker/**/Dockerfile */Dockerfile; do
|
||||
[ -f "$f" ] || continue
|
||||
found=1
|
||||
# Warnings (unpinned apt/pip) are advisory; only errors fail the job
|
||||
docker run --rm -i hadolint/hadolint hadolint --failure-threshold error - < "$f"
|
||||
done
|
||||
[ "$found" -eq 1 ] || echo "No Dockerfile — skip hadolint"
|
||||
|
||||
- name: Trivy config scan (advisory)
|
||||
run: |
|
||||
docker run --rm -v "$PWD:/repo" aquasec/trivy:latest config /repo || true
|
||||
|
||||
secret-scan:
|
||||
needs: skip-ci-check
|
||||
if: needs.skip-ci-check.outputs.should-skip != '1'
|
||||
runs-on: [homelab, self-hosted, linux, heavy]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Gitleaks
|
||||
run: |
|
||||
extra=""
|
||||
if [ -f .gitleaks.toml ]; then
|
||||
extra="--config /repo/.gitleaks.toml"
|
||||
fi
|
||||
docker run --rm -v "$PWD:/repo" ghcr.io/gitleaks/gitleaks:latest \
|
||||
detect --source /repo --no-banner --redact ${extra}
|
||||
@@ -0,0 +1,28 @@
|
||||
# Homelab bootstrap — gitleaks allowlist (tests, examples, placeholders)
|
||||
#
|
||||
# IMPORTANT: `useDefault = true` is required — without it gitleaks loads ONLY
|
||||
# this file (title + allowlist) with ZERO detection rules, so it would never
|
||||
# flag a real secret. Fixed 2026-07 (security-hardening track); if you're
|
||||
# re-pushing this template to a repo that already had the old version, that
|
||||
# repo's secret scanning was a no-op until this lands.
|
||||
title = "homelab gitea bootstrap"
|
||||
|
||||
[extend]
|
||||
useDefault = true
|
||||
|
||||
[allowlist]
|
||||
description = "Test fixtures and example configs are not production secrets"
|
||||
paths = [
|
||||
'''(?i).*\.test\.(ts|tsx|js|jsx|py)$''',
|
||||
'''(?i).*\.spec\.(ts|tsx|js|jsx)$''',
|
||||
'''(?i).*/tests/.*''',
|
||||
'''(?i).*/__tests__/.*''',
|
||||
'''(?i).*\.example\.(yml|yaml|env|json|toml)$''',
|
||||
'''(?i).*vault\.example\.(yml|yaml)$''',
|
||||
'''(?i).*\.env\.example$''',
|
||||
]
|
||||
regexes = [
|
||||
'''(?i)(invalid|fake|dummy|placeholder|example|changeme|change_me|not-a-real)''',
|
||||
'''(?i)sk-or-invalid''',
|
||||
'''(?i)msk-or-invalid''',
|
||||
]
|
||||
Reference in New Issue
Block a user