Add deploy webhook for auto-deploy from Forgejo

This commit is contained in:
John Mizerek 2026-03-14 15:04:53 -07:00
parent 1f81d98c52
commit 906f1408fa

16
_webhook/deploy.php Normal file
View file

@ -0,0 +1,16 @@
<?php
header('Content-Type: application/json');
$secret = 'payfrit-deploy-2026';
$headerSecret = $_SERVER['HTTP_X_FORGEJO_SIGNATURE'] ?? $_GET['secret'] ?? '';
if ($headerSecret !== $secret) {
http_response_code(403);
echo json_encode(['OK' => false, 'ERROR' => 'unauthorized']);
exit;
}
$triggerFile = '/tmp/deploy-payfrit-api.trigger';
file_put_contents($triggerFile, date('Y-m-d H:i:s'));
echo json_encode(['OK' => true, 'MESSAGE' => 'Deploy triggered', 'TIME' => date('c')]);