Add web push notifications
This commit is contained in:
parent
91cb65e896
commit
4e4def843d
5 changed files with 92 additions and 3 deletions
11
push_config.php
Normal file
11
push_config.php
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue