Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Added telemetry
-> Added error report sending
  • Loading branch information
NaysKutzu committed Oct 17, 2023
1 parent 520ada1 commit eb51d00
Show file tree
Hide file tree
Showing 11 changed files with 551 additions and 382 deletions.
66 changes: 66 additions & 0 deletions functions/report.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php
function Error($title, $text)
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=error&title=".$title."&message=".$text,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Agent: insomnia/8.2.0"
],
]);

curl_exec($curl);
}

function Warning($title, $text)
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=warning&title=".$title."&message=".$text,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Agent: insomnia/8.2.0"
],
]);

curl_exec($curl);
}
function Critical($title, $text)
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=critical&title=".$title."&message=".$text,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"User-Agent: insomnia/8.2.0"
],
]);

curl_exec($curl);
}
?>
87 changes: 87 additions & 0 deletions functions/telemetry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php
function NewUser()
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewUser&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
]);

curl_exec($curl);
}
function NewServer()
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewWebsite&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
]);

curl_exec($curl);
}
function NewInstall()
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewInstall&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
]);

curl_exec($curl);
}
function NewNode()
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewNode&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
]);

curl_exec($curl);
}
function NewTicket()
{
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewTicket&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
]);

curl_exec($curl);
}
?>
2 changes: 2 additions & 0 deletions install/servercheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include(__DIR__.'/../functions/telemetry.php');
if (isset($_GET['rr'])) {
NewInstall();
unlink("FIRST_INSTALL");
header('location: /');
}
Expand Down
Loading

0 comments on commit eb51d00

Please sign in to comment.