17 changed files with 563 additions and 28 deletions
-
4cert_cp.php
-
1index.php
-
112lib/scripts/distro_web_utils.php
-
19lib/scripts/sys_utils.php
-
10lib/scripts/wifi_ap_disable.sh
-
11lib/scripts/wifi_ap_enable.sh
-
9lib/scripts/wifi_ap_off.sh
-
11lib/scripts/wifi_ap_on.sh
-
17lib/sysroot/srv/etc/ag_nginx/sites-available/default
-
1lib/sysroot/srv/etc/boot.php
-
53lib/sysroot/srv/etc/cron.php
-
109lib/sysroot/srv/etc/nginx/default
-
109lib/sysroot/srv/etc/nginx/default.nossl
-
102lib/sysroot/srv/etc/nginx/default.ssl
-
11lib/sysroot/srv/etc/pereodical.php
-
2lib/sysroot/srv/etc/system.json
-
10task_wait.php
@ -0,0 +1,10 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ip link set wlan0 down |
||||
|
ip link set wlan1 down |
||||
|
|
||||
|
systemctl stop hostapd |
||||
|
systemctl disable hostapd |
||||
|
killall hostapd |
||||
|
systemctl daemon-reload |
||||
|
systemctl restart dnsmasq |
||||
@ -0,0 +1,11 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ip link set wlan0 up |
||||
|
ip link set wlan1 up |
||||
|
|
||||
|
systemctl daemon-reload |
||||
|
#systemctl enable dnsmasq |
||||
|
systemctl enable hostapd |
||||
|
systemctl daemon-reload |
||||
|
systemctl restart dnsmasq |
||||
|
systemctl start hostapd |
||||
@ -0,0 +1,9 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ip link set wlan0 down |
||||
|
ip link set wlan1 down |
||||
|
|
||||
|
systemctl stop hostapd |
||||
|
killall hostapd |
||||
|
systemctl restart dnsmasq |
||||
|
|
||||
@ -0,0 +1,11 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ip link set wlan0 up |
||||
|
ip link set wlan1 up |
||||
|
|
||||
|
#systemctl daemon-reload |
||||
|
#systemctl enable dnsmasq |
||||
|
#systemctl enable hostapd |
||||
|
#systemctl daemon-reload |
||||
|
systemctl restart dnsmasq |
||||
|
systemctl start hostapd |
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -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; |
||||
|
} |
||||
|
} |
||||
@ -1,4 +1,11 @@ |
|||||
<?php |
<?php |
||||
|
|
||||
|
|
||||
|
require_once( '/srv/scripts/sys_utils.php' ); |
||||
|
$SYS_CONFIG['PERIODIC_JOB_COUNTS']++; |
||||
|
if( $SYS_CONFIG['WIFI_MODE'] == 1 ){ |
||||
|
if( $SYS_CONFIG['PERIODIC_JOB_COUNTS'] == 5 ){ |
||||
|
$L=`/srv/scripts/wifi_ap_off.sh`; |
||||
|
$SYS_CONFIG['WIFI_IS_ON'] = false; |
||||
|
}; |
||||
|
}; |
||||
|
save_system_config(); |
||||
?>
|
?>
|
||||
@ -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"}}} |
|
||||
|
{"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"}}} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue