Add Athena version to issue post. Remove unused files. Tidying

This commit is contained in:
Fred Boniface 2022-09-20 21:38:25 +01:00
parent 5f59766a8e
commit cd7e005a69
4 changed files with 1 additions and 42 deletions

View File

@ -22,7 +22,7 @@
$detail = cleanInput($_POST["detail"]); $detail = cleanInput($_POST["detail"]);
// Prepare $detail to POST // Prepare $detail to POST
$body = "User Agent: " . $ua_str . "\n\n Server PHP Version: " . PHP_VERSION . "\n\n" . $detail; $body = "Athena Version: " . $athenaVersion . "\n\n" . User Agent: " . $ua_str . "\n\n Server PHP Version: " . PHP_VERSION . "\n\n" . $detail;
// Call POST function // Call POST function
sendInput($title,$body); sendInput($title,$body);

View File

@ -1,41 +0,0 @@
<?php
// Get API Key for git.fjla.uk
require '/srv/php-keys/athena/gitea.php';
echo "Gitea AUTH header is: $giteaKey";
// Set httpHeaders
$httpHeaders = array(
"accept: application/json",
$giteaKey,
"Content-Type: application/json"
);
// Prepare $detail to POST
$body = "This is a PHP-CLI test issue.";
$subject = "Test Issue - From PHP CLI";
echo "Prepared POST data:\nSubject: $subject\nBody:$body";
// Prepare the request
$rawData = array(
'body' => $body,
'title' => $subject
);
$issueData = json_encode($rawData);
echo "Ready to send data:\n$issueData";
// Prepare CURL
$curlConnection = curl_init('https://git.fjla.uk/api/v1/repos/fred.boniface/athena.fb-infra.uk/issues');
curl_setopt($curlConnection, CURLOPT_POSTFIELDS, $issueData);
curl_setopt($curlConnection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlConnection, CURLOPT_HTTPHEADER, $httpHeaders);
// Get response and exit CURL
$giteaResponse = curl_exec($curlConnection);
curl_close($curlConnection);
echo "Response: " . $giteaResponse;
?>