Files
html/api/opus-read.php
2026-04-16 16:15:07 +02:00

9 lines
426 B
PHP

<?php
$f = $_GET['f'] ?? '';
$allowed = ['/var/www/html/','/opt/obsidian-vault/','/var/log/weval-sync.log','/var/log/wevia/','/opt/weval-l99/','/opt/weval-ops/','/opt/wevia-brain/'];
$ok = false;
foreach ($allowed as $a) if (strpos($f, $a) === 0) $ok = true;
if (!$ok || !file_exists($f)) { http_response_code(404); exit('nope'); }
header('Content-Type: text/plain; charset=utf-8');
echo base64_encode(file_get_contents($f));