header update
This commit is contained in:
parent
e3a2cb8185
commit
475ce92bd5
Binary file not shown.
|
|
@ -9,7 +9,7 @@ https://github.com/shreebhattji/Urmi/blob/main/licence.md
|
|||
*/
|
||||
|
||||
exec("sudo chmod 444 /sys/class/dmi/id/product_uuid");
|
||||
$version = 11.13;
|
||||
$version = 11.14;
|
||||
|
||||
function fail(string $msg): never
|
||||
{
|
||||
|
|
@ -70,6 +70,9 @@ KQIDAQAB
|
|||
";
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($_POST['action'] !== "backup")
|
||||
include 'header.php';
|
||||
|
||||
switch ($_POST['action']) {
|
||||
case 'update':
|
||||
|
||||
|
|
@ -274,7 +277,6 @@ EwIDAQAB
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
exec('sudo cp /var/www/default_nginx.conf /etc/nginx/nginx.conf');
|
||||
exec('sudo cp /var/www/default_nginx_site /etc/nginx/sites-available/default');
|
||||
|
||||
|
|
@ -352,7 +354,6 @@ EwIDAQAB
|
|||
|
||||
unlink($tmpZip);
|
||||
break;
|
||||
|
||||
case 'restore':
|
||||
$jsonFiles = [
|
||||
'input.json',
|
||||
|
|
@ -494,8 +495,10 @@ EwIDAQAB
|
|||
update_service("input");
|
||||
break;
|
||||
}
|
||||
}
|
||||
include 'header.php';
|
||||
if ($_POST['action'] === "backup")
|
||||
include 'header.php';
|
||||
} else
|
||||
include 'header.php';
|
||||
|
||||
?>
|
||||
<script>
|
||||
|
|
|
|||
29
setup.sh
29
setup.sh
|
|
@ -46,35 +46,6 @@ if [ ! -f "$TARGET_FILE" ]; then
|
|||
cp "$SOURCE_FILE" "$TARGET_FILE"
|
||||
fi
|
||||
|
||||
cat > /etc/nginx/sites-available/default << 'EOL'
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
|
||||
root /var/www/html;
|
||||
index index.html;
|
||||
|
||||
# These are fine at the server level, but safer inside location
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" always;
|
||||
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept, Origin, X-Requested-With" always;
|
||||
|
||||
location / {
|
||||
# Handle the OPTIONS (Preflight) request correctly
|
||||
if ($request_method = OPTIONS) {
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" always;
|
||||
add_header Access-Control-Allow-Headers "Authorization, Content-Type, Accept, Origin, X-Requested-With" always;
|
||||
add_header Content-Length 0;
|
||||
add_header Content-Type text/plain;
|
||||
return 204;
|
||||
}
|
||||
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
||||
EOL
|
||||
|
||||
cat > /etc/systemd/system/encoder-rtmp0.service<< 'EOL'
|
||||
[Unit]
|
||||
|
|
|
|||
Loading…
Reference in New Issue