diff --git a/cert_cp.php b/cert_cp.php index 5dd5db2..4e855a0 100644 --- a/cert_cp.php +++ b/cert_cp.php @@ -4,8 +4,10 @@ require_once('../../scripts/distro_web_utils.php'); print_PAGE_HEADER(); - if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) { + if( isset( $SYS_CONFIG['NGINX_AUTH_IS_SET'] ) ){ + if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) { print_AUTH_WARNING(); + }; }; print_CONNECTION_INFO(); print_CERT_INFO(); diff --git a/index.php b/index.php index 8127bd9..7b70090 100644 --- a/index.php +++ b/index.php @@ -13,6 +13,7 @@ print_CERT_INFO(); print_APPLICATION_INFO(); print_TIME_INFO(); + print_LAST_TASK_LOG(); print_PAGE_BOTTOM(); ?> \ No newline at end of file diff --git a/lib/scripts/distro_web_utils.php b/lib/scripts/distro_web_utils.php index 680598b..a062864 100644 --- a/lib/scripts/distro_web_utils.php +++ b/lib/scripts/distro_web_utils.php @@ -258,7 +258,7 @@ function print_APPLICATION_INFO(){ - Wipe History Data + Wipe History Data Reset to Factory Defaults
@@ -675,6 +735,19 @@ function startTimeSync(){
Platform TimeSync To Browser
+ Manual Set Date/Time + + + + + + + + + +
-- ::
+ Set Value +
NTP Synchronization is EnabledDisable NTP Sync

+ + +
Last Task Log Messages
+ + +
+TASK: switch($TID){ - case 18:{ - echo "Are You Sure to Delete all Application Settings?"; - break; - }; - case 19:{ - echo "Are You Sure to Delete all Reports Data and Video Files?"; - break; - }; + case }; +Start SambaDisable WiFiDisable WiFiEnable WiFiEnable WiFi
WiFi
\ No newline at end of file diff --git a/lib/sysroot/srv/etc/nginx/default b/lib/sysroot/srv/etc/nginx/default new file mode 100644 index 0000000..c161919 --- /dev/null +++ b/lib/sysroot/srv/etc/nginx/default @@ -0,0 +1,109 @@ +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen 80 default_server; + listen [::]:80 default_server; + + client_max_body_size 400M; + + # SSL configuration + # + #listen 443 ssl default_server; + #listen [::]:443 ssl default_server; + #add_header Strict-Transport-Security "max-age=0;"; + #add_header X-XSS-Protection "0"; + #add_header X-XSS-Protection "1; mode=block"; + #add_header X-Frame-Options "SAMEORIGIN"; + #add_header X-Content-Type-Options nosniff; + # + # Note: You should disable gzip for SSL traffic. + # See: https://bugs.debian.org/773332 + # + # Read up on ssl_ciphers to ensure a secure configuration. + # See: https://bugs.debian.org/765782 + # + # Self signed certs generated by the ssl-cert package + # Don't use them in a production server! + # + #include /srv/etc/nginx/self-signed.conf; + #include /srv/etc/nginx/ssl-params.conf; + + + + root /srv/www/web; + + # Add index.php to the list if you are using PHP + index index.html index.htm index.nginx-debian.html; + server_name _; + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + index index.html index.php; + } + + # pass PHP scripts to FastCGI server + # + location ~ \.php$ { + #keepalive_timeout 0; + include snippets/fastcgi-php.conf; + #fastcgi_hide_header X-Frame-Options; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + location ~* /jsapi_dynamic/.+\.js$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + location /video_feed/ { + proxy_pass http://127.0.0.1:8972; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location /video_view/ { + proxy_pass http://127.0.0.1:8974; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/lib/sysroot/srv/etc/nginx/default.nossl b/lib/sysroot/srv/etc/nginx/default.nossl new file mode 100644 index 0000000..c161919 --- /dev/null +++ b/lib/sysroot/srv/etc/nginx/default.nossl @@ -0,0 +1,109 @@ +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen 80 default_server; + listen [::]:80 default_server; + + client_max_body_size 400M; + + # SSL configuration + # + #listen 443 ssl default_server; + #listen [::]:443 ssl default_server; + #add_header Strict-Transport-Security "max-age=0;"; + #add_header X-XSS-Protection "0"; + #add_header X-XSS-Protection "1; mode=block"; + #add_header X-Frame-Options "SAMEORIGIN"; + #add_header X-Content-Type-Options nosniff; + # + # Note: You should disable gzip for SSL traffic. + # See: https://bugs.debian.org/773332 + # + # Read up on ssl_ciphers to ensure a secure configuration. + # See: https://bugs.debian.org/765782 + # + # Self signed certs generated by the ssl-cert package + # Don't use them in a production server! + # + #include /srv/etc/nginx/self-signed.conf; + #include /srv/etc/nginx/ssl-params.conf; + + + + root /srv/www/web; + + # Add index.php to the list if you are using PHP + index index.html index.htm index.nginx-debian.html; + server_name _; + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + index index.html index.php; + } + + # pass PHP scripts to FastCGI server + # + location ~ \.php$ { + #keepalive_timeout 0; + include snippets/fastcgi-php.conf; + #fastcgi_hide_header X-Frame-Options; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + location ~* /jsapi_dynamic/.+\.js$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + location /video_feed/ { + proxy_pass http://127.0.0.1:8972; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location /video_view/ { + proxy_pass http://127.0.0.1:8974; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/lib/sysroot/srv/etc/nginx/default.ssl b/lib/sysroot/srv/etc/nginx/default.ssl new file mode 100644 index 0000000..fd692ec --- /dev/null +++ b/lib/sysroot/srv/etc/nginx/default.ssl @@ -0,0 +1,102 @@ +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen 80 default_server; + listen [::]:80 default_server; + + # SSL configuration + # + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + # + # Note: You should disable gzip for SSL traffic. + # See: https://bugs.debian.org/773332 + # + # Read up on ssl_ciphers to ensure a secure configuration. + # See: https://bugs.debian.org/765782 + # + # Self signed certs generated by the ssl-cert package + # Don't use them in a production server! + # + include /srv/etc/nginx/host.conf; + include /srv/etc/nginx/params.conf; + + add_header X-Content-Type-Options nosniff; + + root /srv/www/web; + + # Add index.php to the list if you are using PHP + index index.html index.htm index.nginx-debian.html; + + server_name _; + + location / { + # First attempt to serve request as file, then + # as directory, then fall back to displaying a 404. + try_files $uri $uri/ =404; + index index.html index.php; + } + + # pass PHP scripts to FastCGI server + # + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + location ~* /jsapi_dynamic/.+\.js$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php-fpm.sock; + } + + location /video_feed/ { + proxy_pass http://127.0.0.1:8972; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location /video_view/ { + proxy_pass http://127.0.0.1:8974; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_connect_timeout 20s; # time to open a connection to the proxy before we give up + proxy_send_timeout 20s; # timeout for transmitting a request to the proxied server + proxy_read_timeout 20s; # timeout for reading a response from the proxied server - did it send back anything before this has expired + send_timeout 20s; # timeout for sending a response to the requesting client - note this isn't proxy_send_timeout, but the time between two successive write operations to the requesting client (ie. browser) + reset_timedout_connection on; + } + + location ~ /\.ht { + deny all; + } +} diff --git a/lib/sysroot/srv/etc/pereodical.php b/lib/sysroot/srv/etc/pereodical.php index 3be240d..a3040fb 100644 --- a/lib/sysroot/srv/etc/pereodical.php +++ b/lib/sysroot/srv/etc/pereodical.php @@ -1,4 +1,11 @@ \ No newline at end of file diff --git a/lib/sysroot/srv/etc/system.json b/lib/sysroot/srv/etc/system.json index 89b90b3..e183450 100644 --- a/lib/sysroot/srv/etc/system.json +++ b/lib/sysroot/srv/etc/system.json @@ -1 +1 @@ -{"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":false,"webui_is_running":true},"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":0},"net":[],"fam":"inet","mode":"loopback"},"eth0":{"flags":{"hotplug":1,"auto":1},"net":[],"fam":"inet","mode":"dhcp"}}} \ No newline at end of file +{"SAMBA_IS_ON":true,"ARGUS_CONFIG":{"app_is_running":true,"webui_is_running":true},"PERIODIC_JOB_COUNTS":0,"NET_CONFIG":{"lo":{"flags":{"hotplug":0,"auto":1},"net":[],"fam":"inet","mode":"loopback"},"enp6s0":{"flags":{"hotplug":1,"auto":0},"net":[],"fam":"inet","mode":"dhcp"}}} \ No newline at end of file diff --git a/task_wait.php b/task_wait.php index a19f2cc..74a70ee 100644 --- a/task_wait.php +++ b/task_wait.php @@ -13,6 +13,16 @@ case 4: $CPARAM = intval( $_GET['CTS'] ); break; case 7: $CPARAM = $_POST['CTZ']; break; case 15: $CPARAM = $_POST['FID']; break; + case 25:{ + $CPARAM = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", + intval( $_GET['CTSY'] ), + intval( $_GET['CTSM'] ), + intval( $_GET['CTSD'] ), + intval( $_GET['CTSH'] ), + intval( $_GET['CTSX'] ), + intval( $_GET['CTSS'] )); + break; + }; }; if( !create_cron_task( $CTID, $CPARAM ) ){ header('location: /');