26 lines
862 B
PHP
26 lines
862 B
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$secrets_raw = @file_get_contents("/etc/weval/secrets.env");
|
|
$cf_token = "";
|
|
if (preg_match('/^CF_API_TOKEN=(.+)$/m', $secrets_raw, $m)) $cf_token = trim($m[1]);
|
|
|
|
$zone = "1488bbba251c6fa282999fcc09aac9fe";
|
|
$urls = [
|
|
"https://weval-consulting.com/js/wevia-sse-override.js",
|
|
"https://weval-consulting.com/wevia.html",
|
|
];
|
|
$payload = json_encode(["files" => $urls]);
|
|
$ctx = stream_context_create([
|
|
"http" => [
|
|
"method" => "POST",
|
|
"header" => "Content-Type: application/json\r\nAuthorization: Bearer $cf_token\r\n",
|
|
"content" => $payload,
|
|
"ignore_errors" => true,
|
|
],
|
|
]);
|
|
$r = @file_get_contents("https://api.cloudflare.com/client/v4/zones/$zone/purge_cache", false, $ctx);
|
|
echo json_encode([
|
|
"token_len" => strlen($cf_token),
|
|
"result" => substr($r, 0, 500),
|
|
]);
|