password - no echo, media - redirect

This commit is contained in:
bogale 2026-09-28 21:25:37 +09:00
commit 88d7cb4f69
5 changed files with 16 additions and 11 deletions

6
.gitignore vendored
View file

@ -1,4 +1,4 @@
/favicon.ico
/local/net
/local/urls
/local/videos
/favicon.ico
/local/media/urls
/local/media/videos

View file

@ -5,7 +5,9 @@ require "$root/templates/header.php";
$str = strtr(base64_encode(random_bytes(15)), '+/', '-_');
$str[random_int(0, 19)] = random_int(0, 1) ? '-' : '_';
echo "<div>$str</div>\n";
echo "<button onclick='navigator.clipboard.writeText(\"$str\").then(
() => { result.innerHTML = \"Copied\"; } );'>Copy</button><br>\n";
echo "<span id='result'></span>\n";
require "$root/templates/footer.php";
?>

View file

@ -9,8 +9,9 @@ require "$root/templates/header.php";
<a href="app/pswd.php">Password generator</a><br>
<h4>Private</h4>
<a href="vw">Vaultwarden</a><br>
<a href="local/apps/get.php">Media manager</a><br>
<a href="local/apps/load.php">Media downloader</a><br>
<a href="grafana">Grafana</a><br>
<a href="local/media/get.php">Media viewer</a><br>
<a href="local/media/load.php">Media downloader</a><br>
<?php
require "$root/templates/footer.php";
?>

View file

@ -1,19 +1,18 @@
<?php
$title = "Media manager";
$title = "Media viewer";
$root = $_SERVER["DOCUMENT_ROOT"];
require "$root/templates/header.php";
$urls_base = __DIR__ . "/../urls";
$urls_base = __DIR__ . "/urls";
if (isset($_GET["list"])) {
$file = "$urls_base/" . $_GET["list"];
$urls = json_decode(file_get_contents($file));
$url = $urls[array_rand($urls)];
echo "<a href='$url'>Watch</a><br>";
header("Location: " . $urls[array_rand($urls)]);
} else {
foreach (scandir($urls_base) as $list) {
if ($list === '.' || $list === '..')
continue;
echo "<a href='" . $_SERVER['PHP_SELF'] . "?list=$list'>List $list</a><br>";
echo "<a href='" . $_SERVER['PHP_SELF'] . "?list=$list'>Try $list</a><br>";
}
}

3
todo Normal file
View file

@ -0,0 +1,3 @@
- copy button
- notes manager
- video downloader