Added auth support and a helper script, targeting frankenphp

This commit is contained in:
markmental 2026-02-02 14:05:21 -05:00
commit 0783e08fe9
8 changed files with 655 additions and 4 deletions

View file

@ -2,8 +2,11 @@
/**
* serve_media.php - Serves media files with proper headers for streaming + Range
*/
declare(strict_types=1);
require_once __DIR__ . '/auth.php';
require_auth(false); // plain text is fine for media endpoint
set_time_limit(0);
// ---- Config (prefer env vars in production) ----
$homeDir = getenv('HOME') ?: (getenv('USERPROFILE') ?: ('/home/' . get_current_user()));