Add web push notifications

This commit is contained in:
hbrain 2026-05-26 15:48:30 +02:00
parent 91cb65e896
commit 4e4def843d
5 changed files with 92 additions and 3 deletions

11
push_config.php Normal file
View file

@ -0,0 +1,11 @@
<?php
header('Content-Type: application/json; charset=UTF-8');
header('Cache-Control: no-store');
$cfgFile = '/etc/mvlog/push.php';
if (!is_file($cfgFile)) {
echo json_encode(['enabled' => false]);
exit;
}
$cfg = require $cfgFile;
$public = (string)($cfg['public_key'] ?? '');
echo json_encode(['enabled' => $public !== '', 'publicKey' => $public], JSON_UNESCAPED_SLASHES);