From 7b8cac26c6fc519d4d0787857ab18e4ee8df8ab2 Mon Sep 17 00:00:00 2001 From: Dmitry Karpukhin Date: Fri, 16 Jan 2026 11:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=D1=82=D0=B5=D1=81=D1=82=206=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA=D0=B0=20=D0=B3?= =?UTF-8?q?=D0=B8=D1=82=D0=BB=D0=B0=D0=B1=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/pull.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/pull.php b/public/pull.php index 2dc7f67..a81e11d 100644 --- a/public/pull.php +++ b/public/pull.php @@ -7,7 +7,7 @@ $hash = hash_hmac('sha256', $payload, $key, false); $signature = $_SERVER['HTTP_X_GITEA_SIGNATURE']?? ''; -file_put_contents("/var/www/lk/storage/logs/temp_sign", print_r($signature, 1)); + // check payload signature against header signature if ($hash !== $signature) { @@ -16,7 +16,6 @@ } $json = json_decode($payload, true); -file_put_contents("/var/www/lk/storage/logs/temp_json", print_r($json, 1)); if (json_last_error() !== JSON_ERROR_NONE) { @@ -24,10 +23,9 @@ exit(json_last_error()); } -if(strcmp($json['object_kind'], 'push') == 0) +if($json['total_commits'] > 0) { $result = shell_exec("cd /var/www/lk && git reset --hard HEAD && git pull"); - file_put_contents("/var/www/lk/storage/logs/temp_exec", print_r($result, 1)); echo "

$result

"; }