update
This commit is contained in:
parent
dcf1339e3a
commit
0772d5fa71
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
exec("sudo chmod 444 /sys/class/dmi/id/product_uuid");
|
exec("sudo chmod 444 /sys/class/dmi/id/product_uuid");
|
||||||
$version = 8;
|
$version = 9;
|
||||||
|
|
||||||
function fail(string $msg): never
|
function fail(string $msg): never
|
||||||
{
|
{
|
||||||
fwrite(STDERR, "ERROR: $msg\n");
|
error_log("ERROR: $msg");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
<div id="blocker">
|
<div id="blocker">
|
||||||
<div id="blockerBox">
|
<div id="blockerBox">
|
||||||
<div class="msg">'
|
<div class="msg">'
|
||||||
. htmlspecialchars("message", ENT_QUOTES) .
|
. htmlspecialchars($data['message'], ENT_QUOTES) .
|
||||||
'</div>
|
'</div>
|
||||||
<div>Refreshing in</div>
|
<div>Refreshing in</div>
|
||||||
<div class="timer" id="blockerTimer">100</div>
|
<div class="timer" id="blockerTimer">100</div>
|
||||||
|
|
@ -155,7 +155,6 @@ const interval = setInterval(() => {
|
||||||
|
|
||||||
if (seconds <= 0) {
|
if (seconds <= 0) {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
location.reload();
|
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,14 @@ if ($subdomains_raw !== '') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec("sudo systemctl stop nginx");
|
||||||
|
sleep(3);
|
||||||
|
exec("sudo certbot delete --all");
|
||||||
|
sleep(3);
|
||||||
|
exec("sudo systemctl restart nginx");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
|
|
||||||
// Merge primary domain + subdomains
|
// Merge primary domain + subdomains
|
||||||
$domains = array_values(array_unique(array_merge([$domain], $subdomains)));
|
$domains = array_values(array_unique(array_merge([$domain], $subdomains)));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1216,6 +1216,7 @@ function update_service_backend($service, $srt_pass1, $srt_pass2)
|
||||||
|
|
||||||
'custom_output' => ''
|
'custom_output' => ''
|
||||||
];
|
];
|
||||||
|
|
||||||
for ($i = 1; $i <= 11; $i++) {
|
for ($i = 1; $i <= 11; $i++) {
|
||||||
$defaults['rtmp0_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false];
|
$defaults['rtmp0_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false];
|
||||||
$defaults['rtmp1_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false];
|
$defaults['rtmp1_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false];
|
||||||
|
|
@ -1309,11 +1310,6 @@ function update_service_backend($service, $srt_pass1, $srt_pass2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$rtmp_input_copy = "";
|
|
||||||
if ($use_common_backend == 'transcode_every_time') {
|
|
||||||
$rtmp_input_copy = "push rtmp://127.0.0.1/shree/bhattji;";
|
|
||||||
}
|
|
||||||
|
|
||||||
$nginx = "
|
$nginx = "
|
||||||
user www-data;
|
user www-data;
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
|
|
@ -1343,8 +1339,6 @@ rtmp {
|
||||||
|
|
||||||
sync 10ms;
|
sync 10ms;
|
||||||
idle_streams off;
|
idle_streams off;
|
||||||
|
|
||||||
" . $rtmp_input_copy . "
|
|
||||||
}
|
}
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|
|
||||||
34
install.sh
34
install.sh
|
|
@ -11,25 +11,12 @@ EOL
|
||||||
|
|
||||||
cat > /etc/apache2/sites-available/000-default.conf << 'EOL'
|
cat > /etc/apache2/sites-available/000-default.conf << 'EOL'
|
||||||
<VirtualHost *:8080>
|
<VirtualHost *:8080>
|
||||||
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
DocumentRoot /var/www/encoder
|
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
|
||||||
|
|
||||||
</VirtualHost>
|
|
||||||
EOL
|
|
||||||
|
|
||||||
cat > /etc/apache2/sites-available/default-ssl.conf << 'EOL'
|
|
||||||
<VirtualHost *:8443>
|
|
||||||
|
|
||||||
ServerName localhost
|
ServerName localhost
|
||||||
ServerAdmin webmaster@localhost
|
ServerAdmin webmaster@localhost
|
||||||
DocumentRoot /var/www/encoder
|
DocumentRoot /var/www/encoder
|
||||||
|
|
||||||
ErrorLog ${APACHE_LOG_DIR}/encoder-ssl-error.log
|
ErrorLog ${APACHE_LOG_DIR}/encoder-error.log
|
||||||
CustomLog ${APACHE_LOG_DIR}/encoder-ssl-access.log combined
|
CustomLog ${APACHE_LOG_DIR}/encoder-access.log combined
|
||||||
|
|
||||||
SSLEngine on
|
SSLEngine on
|
||||||
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
|
|
@ -40,27 +27,14 @@ cat > /etc/apache2/sites-available/default-ssl.conf << 'EOL'
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Require all granted
|
Require all granted
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
<FilesMatch "\.(?:cgi|shtml|phtml|php)$">
|
|
||||||
SSLOptions +StdEnvVars
|
|
||||||
</FilesMatch>
|
|
||||||
|
|
||||||
<Directory /usr/lib/cgi-bin>
|
|
||||||
SSLOptions +StdEnvVars
|
|
||||||
</Directory>
|
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
cat>/etc/apache2/ports.conf<< 'EOL'
|
cat>/etc/apache2/ports.conf<< 'EOL'
|
||||||
Listen 8080
|
Listen 8080
|
||||||
|
|
||||||
<IfModule ssl_module>
|
<IfModule mod_ssl.c>
|
||||||
Listen 8443
|
Listen 8080
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_gnutls.c>
|
|
||||||
Listen 8443
|
|
||||||
</IfModule>
|
</IfModule>
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
|
|
|
||||||
31
setup.sh
31
setup.sh
|
|
@ -4,6 +4,36 @@ sudo cp attempts.json /var/www/attempts.json
|
||||||
DEVICE_ID="$(sudo cat /sys/class/dmi/id/product_uuid | tr -d '\n')"
|
DEVICE_ID="$(sudo cat /sys/class/dmi/id/product_uuid | tr -d '\n')"
|
||||||
sudo sed -i 's/certificatecertificatecertificatecertificate/'$DEVICE_ID'/g' /var/www/html/certification.html
|
sudo sed -i 's/certificatecertificatecertificatecertificate/'$DEVICE_ID'/g' /var/www/html/certification.html
|
||||||
|
|
||||||
|
cat > /etc/apache2/sites-available/000-default.conf << 'EOL'
|
||||||
|
<VirtualHost *:8080>
|
||||||
|
ServerName localhost
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot /var/www/encoder
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/encoder-error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/encoder-access.log combined
|
||||||
|
|
||||||
|
SSLEngine on
|
||||||
|
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
|
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
|
||||||
|
|
||||||
|
<Directory /var/www/encoder>
|
||||||
|
Options Indexes FollowSymLinks
|
||||||
|
AllowOverride All
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
EOL
|
||||||
|
|
||||||
|
cat>/etc/apache2/ports.conf<< 'EOL'
|
||||||
|
Listen 8080
|
||||||
|
|
||||||
|
<IfModule mod_ssl.c>
|
||||||
|
Listen 8080
|
||||||
|
</IfModule>
|
||||||
|
EOL
|
||||||
|
|
||||||
|
|
||||||
SOURCE_FILE="users.json"
|
SOURCE_FILE="users.json"
|
||||||
TARGET_FILE="/var/www/users.json"
|
TARGET_FILE="/var/www/users.json"
|
||||||
|
|
||||||
|
|
@ -48,6 +78,5 @@ server {
|
||||||
}
|
}
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
|
|
||||||
sudo chown -R www-data:www-data /var/www/*
|
sudo chown -R www-data:www-data /var/www/*
|
||||||
sudo reboot
|
sudo reboot
|
||||||
Loading…
Reference in New Issue