www-data lance les serveurs tmux
This commit is contained in:
@@ -23,23 +23,6 @@ if (empty($payload)) {
|
||||
exit();
|
||||
}
|
||||
|
||||
// get header signature
|
||||
$header_signature = isset($_SERVER['HTTP_X_GITEA_SIGNATURE']) ? $_SERVER['HTTP_X_GITEA_SIGNATURE'] : '';
|
||||
|
||||
if (empty($header_signature)) {
|
||||
error_log('FAILED - header signature missing');
|
||||
exit();
|
||||
}
|
||||
|
||||
// calculate payload signature
|
||||
$payload_signature = hash_hmac('sha256', $payload, $secret_key, false);
|
||||
|
||||
// check payload signature against header signature
|
||||
if ($header_signature !== $payload_signature) {
|
||||
error_log('FAILED - payload signature');
|
||||
exit();
|
||||
}
|
||||
|
||||
// convert json to array
|
||||
$decoded = json_decode($payload, true);
|
||||
|
||||
@@ -50,5 +33,6 @@ if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
}
|
||||
|
||||
// success, do something
|
||||
shell_exec('sh ../webhook/webhook.sh')
|
||||
echo "launching hook script ";
|
||||
shell_exec('sh ../webhook/webhook.sh 2>&1');
|
||||
?>
|
Reference in New Issue
Block a user