From 503c86ac0a2e055de28110d11b581236b0cc660f Mon Sep 17 00:00:00 2001 From: devdatt Date: Thu, 8 Jan 2026 06:49:32 +0530 Subject: [PATCH] init --- html/domain.php | 214 -------- html/firmware.php | 26 +- html/index.html | 2 + html/input.php | 116 +++++ html/request_cert.php | 146 ------ html/static.php | 1134 ----------------------------------------- 6 files changed, 120 insertions(+), 1518 deletions(-) delete mode 100755 html/domain.php create mode 100644 html/input.php delete mode 100755 html/request_cert.php diff --git a/html/domain.php b/html/domain.php deleted file mode 100755 index 97e39dc..0000000 --- a/html/domain.php +++ /dev/null @@ -1,214 +0,0 @@ - - 'example.com', - 'subdomain' => 'www.example.com', - 'email' => 'name@example.com', -]; - -if (file_exists($jsonFile)) { - $raw = file_get_contents($jsonFile); - $data = json_decode($raw, true); - if (!is_array($data)) $data = $defaults; -} else { - $data = $defaults; -} - -?> - - - -
-
-
-
-
- - " /> - - - " /> - - - " required /> - - -
-
- - -
-
- - -
- -
- -
By checking this you authorise the server operator to run Certbot and modify nginx configuration for the supplied domain(s).
-
-
- - - - - -
- - -
- - -
- Why ports 80 and 443 are required -
-- Port 80 (HTTP) is used by Certbot for the HTTP-01 challenge: Let's Encrypt connects over HTTP to verify you control the domain.
-- Port 443 (HTTPS) is required to serve TLS traffic after the certificate is issued. Nginx must accept HTTPS on port 443 so browsers and streaming clients can connect securely.
-
-
-Ensure both ports are reachable from the public internet and forwarded to this server's IP. If you use a firewall, add rules to allow inbound TCP 80 and 443.
-                            
-
-
-
-
-
-
- - - - - \ No newline at end of file diff --git a/html/firmware.php b/html/firmware.php index 8f2bd0e..3458122 100755 --- a/html/firmware.php +++ b/html/firmware.php @@ -162,7 +162,7 @@ EwIDAQAB $zip = new ZipArchive(); if ($zip->open($zipFile) !== true) { - error_log("zip unzip problem"); + error_log("zip unzip problem"); fail('Unable to open ZIP'); } for ($i = 0; $i < $zip->numFiles; $i++) { @@ -214,19 +214,16 @@ EwIDAQAB unlink($file); } } - + break; case 'reboot': exec('sudo reboot'); break; case 'backup': - $jsonFiles = [ 'input.json', - 'output.json', 'firewall.json', 'network.json', - 'firmware.json', ]; $tmpZip = sys_get_temp_dir() . '/backup.zip'; @@ -238,8 +235,6 @@ EwIDAQAB $zip = new ZipArchive(); $zip->open($tmpZip, ZipArchive::CREATE | ZipArchive::OVERWRITE); - - /* Add JSON files if exist */ foreach ($jsonFiles as $json) { if (file_exists($json)) { $zip->addFile($json, basename($json)); @@ -249,11 +244,9 @@ EwIDAQAB $zip->close(); $data = file_get_contents($tmpZip); - /* Generate AES key */ $aesKey = random_bytes(32); $iv = random_bytes(16); - /* Encrypt ZIP */ $encryptedData = openssl_encrypt( $data, 'AES-256-CBC', @@ -262,10 +255,7 @@ EwIDAQAB $iv ); - /* Encrypt AES key using RSA public key */ openssl_public_encrypt($aesKey, $encryptedKey, $publicKey); - - /* Final binary format */ $payload = json_encode([ 'key' => base64_encode($encryptedKey), 'iv' => base64_encode($iv), @@ -281,7 +271,6 @@ EwIDAQAB header('Cache-Control: no-store, no-cache, must-revalidate'); header('Pragma: no-cache'); header('Expires: 0'); - echo $payload; flush(); @@ -292,10 +281,8 @@ EwIDAQAB case 'restore': $jsonFiles = [ 'input.json', - 'output.json', 'firewall.json', 'network.json', - 'firmware.json', ]; foreach ($jsonFiles as $json) { @@ -372,15 +359,6 @@ EwIDAQAB $zip->close(); unlink($tmpZip); - update_service("display"); - update_service("rtmp0"); - update_service("rtmp1"); - update_service("udp0"); - update_service("udp1"); - update_service("udp2"); - update_service("srt"); - update_service("custom"); - update_service("input"); break; } } diff --git a/html/index.html b/html/index.html index 3dab2a9..8cf0288 100644 --- a/html/index.html +++ b/html/index.html @@ -270,6 +270,8 @@ Call Us Certificate +
+