Browse Source

before ALS fw

master
root 4 years ago
parent
commit
72f6aacc51
  1. BIN
      android-chrome-144x144.png
  2. BIN
      android-chrome-192x192.png
  3. BIN
      android-chrome-256x256.png
  4. BIN
      android-chrome-36x36.png
  5. BIN
      android-chrome-384x384.png
  6. BIN
      android-chrome-48x48.png
  7. BIN
      android-chrome-512x512.png
  8. BIN
      android-chrome-72x72.png
  9. BIN
      android-chrome-96x96.png
  10. BIN
      apple-touch-icon-114x114-precomposed.png
  11. BIN
      apple-touch-icon-114x114.png
  12. BIN
      apple-touch-icon-120x120-precomposed.png
  13. BIN
      apple-touch-icon-120x120.png
  14. BIN
      apple-touch-icon-144x144-precomposed.png
  15. BIN
      apple-touch-icon-144x144.png
  16. BIN
      apple-touch-icon-152x152-precomposed.png
  17. BIN
      apple-touch-icon-152x152.png
  18. BIN
      apple-touch-icon-180x180-precomposed.png
  19. BIN
      apple-touch-icon-180x180.png
  20. BIN
      apple-touch-icon-57x57-precomposed.png
  21. BIN
      apple-touch-icon-57x57.png
  22. BIN
      apple-touch-icon-60x60-precomposed.png
  23. BIN
      apple-touch-icon-60x60.png
  24. BIN
      apple-touch-icon-72x72-precomposed.png
  25. BIN
      apple-touch-icon-72x72.png
  26. BIN
      apple-touch-icon-76x76-precomposed.png
  27. BIN
      apple-touch-icon-76x76.png
  28. BIN
      apple-touch-icon-precomposed.png
  29. BIN
      apple-touch-icon.png
  30. 9
      browserconfig.xml
  31. BIN
      favicon-16x16.png
  32. BIN
      favicon-32x32.png
  33. BIN
      favicon.ico
  34. BIN
      lib/data/mysqlitedb.db
  35. BIN
      lib/data/reports.db
  36. 139
      lib/scripts/SQLite_Class.php
  37. 58
      lib/scripts/distro_web_utils.php
  38. 125
      lib/scripts/sys_utils.php
  39. 15
      lib/scripts/test.php
  40. 10
      lib/sysroot/srv/etc/after_boot.sh
  41. 13
      lib/sysroot/srv/etc/boot.php
  42. 2
      lib/sysroot/srv/etc/check_wifi.sh
  43. 206
      lib/sysroot/srv/etc/cron.php
  44. 12
      lib/sysroot/srv/etc/cron_job.sh
  45. 4
      lib/sysroot/srv/etc/enable_wifi.php
  46. 4
      lib/sysroot/srv/etc/pereodical.php
  47. 4
      lib/sysroot/srv/etc/repair_database.sh
  48. 0
      lib/sysroot/srv/etc/rootCA.crt
  49. 1
      lib/sysroot/srv/etc/system.json
  50. BIN
      mstile-144x144.png
  51. BIN
      mstile-150x150.png
  52. 59
      safari-pinned-tab.svg
  53. 54
      site.webmanifest
  54. BIN
      style/favicon_package_v0.16 (2).zip
  55. BIN
      style/images/017.png
  56. BIN
      style/images/042.png
  57. BIN
      style/images/043.png
  58. BIN
      style/images/048.png
  59. BIN
      style/images/051.png
  60. BIN
      style/images/055.png
  61. 6
      style/style.css
  62. 18
      task_confirm.php
  63. 18
      wan_cp.php

BIN
android-chrome-144x144.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 11 KiB

BIN
android-chrome-192x192.png

Binary file not shown.

After

Width: 192  |  Height: 192  |  Size: 16 KiB

BIN
android-chrome-256x256.png

Binary file not shown.

After

Width: 256  |  Height: 256  |  Size: 22 KiB

BIN
android-chrome-36x36.png

Binary file not shown.

After

Width: 36  |  Height: 36  |  Size: 2.5 KiB

BIN
android-chrome-384x384.png

Binary file not shown.

After

Width: 384  |  Height: 384  |  Size: 35 KiB

BIN
android-chrome-48x48.png

Binary file not shown.

After

Width: 48  |  Height: 48  |  Size: 3.2 KiB

BIN
android-chrome-512x512.png

Binary file not shown.

After

Width: 512  |  Height: 512  |  Size: 50 KiB

BIN
android-chrome-72x72.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 5.0 KiB

BIN
android-chrome-96x96.png

Binary file not shown.

After

Width: 96  |  Height: 96  |  Size: 6.9 KiB

BIN
apple-touch-icon-114x114-precomposed.png

Binary file not shown.

After

Width: 114  |  Height: 114  |  Size: 8.5 KiB

BIN
apple-touch-icon-114x114.png

Binary file not shown.

After

Width: 114  |  Height: 114  |  Size: 8.5 KiB

BIN
apple-touch-icon-120x120-precomposed.png

Binary file not shown.

After

Width: 120  |  Height: 120  |  Size: 9.0 KiB

BIN
apple-touch-icon-120x120.png

Binary file not shown.

After

Width: 120  |  Height: 120  |  Size: 9.0 KiB

BIN
apple-touch-icon-144x144-precomposed.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 11 KiB

BIN
apple-touch-icon-144x144.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 11 KiB

BIN
apple-touch-icon-152x152-precomposed.png

Binary file not shown.

After

Width: 152  |  Height: 152  |  Size: 12 KiB

BIN
apple-touch-icon-152x152.png

Binary file not shown.

After

Width: 152  |  Height: 152  |  Size: 12 KiB

BIN
apple-touch-icon-180x180-precomposed.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 15 KiB

BIN
apple-touch-icon-180x180.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 15 KiB

BIN
apple-touch-icon-57x57-precomposed.png

Binary file not shown.

After

Width: 57  |  Height: 57  |  Size: 3.9 KiB

BIN
apple-touch-icon-57x57.png

Binary file not shown.

After

Width: 57  |  Height: 57  |  Size: 3.9 KiB

BIN
apple-touch-icon-60x60-precomposed.png

Binary file not shown.

After

Width: 60  |  Height: 60  |  Size: 4.0 KiB

BIN
apple-touch-icon-60x60.png

Binary file not shown.

After

Width: 60  |  Height: 60  |  Size: 4.0 KiB

BIN
apple-touch-icon-72x72-precomposed.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 5.0 KiB

BIN
apple-touch-icon-72x72.png

Binary file not shown.

After

Width: 72  |  Height: 72  |  Size: 5.0 KiB

BIN
apple-touch-icon-76x76-precomposed.png

Binary file not shown.

After

Width: 76  |  Height: 76  |  Size: 5.3 KiB

BIN
apple-touch-icon-76x76.png

Binary file not shown.

After

Width: 76  |  Height: 76  |  Size: 5.3 KiB

BIN
apple-touch-icon-precomposed.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 15 KiB

BIN
apple-touch-icon.png

Binary file not shown.

After

Width: 180  |  Height: 180  |  Size: 15 KiB

9
browserconfig.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#603cba</TileColor>
</tile>
</msapplication>
</browserconfig>

BIN
favicon-16x16.png

Binary file not shown.

After

Width: 16  |  Height: 16  |  Size: 1.3 KiB

BIN
favicon-32x32.png

Binary file not shown.

After

Width: 32  |  Height: 32  |  Size: 2.3 KiB

BIN
favicon.ico

Binary file not shown.

BIN
lib/data/mysqlitedb.db

Binary file not shown.

BIN
lib/data/reports.db

Binary file not shown.

139
lib/scripts/SQLite_Class.php

@ -0,0 +1,139 @@
<?php
class SQLite_DB{
var $DBFILE;
var $DBFLAGS;
var $DBENCRYPT;
var $DBLink;
var $CachePath;
var $isConnected=false;
var $isCached=false;
var $DebugLog = '';
function __construct( $DBFILE, $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $encryptionKey = "" ){
$this->DBFILE=$DBFILE;
$this->DBFLAGS=$flags;
$this->DBENCRYPT=$encryptionKey;
try{
$this->DBLink = new SQLite3( $this->DBFILE, $this->DBFLAGS, $this->DBENCRYPT );
$this->DBLink->busyTimeout(5000);
// WAL mode has better control over concurrency.
// Source: https://www.sqlite.org/wal.html
$this->DBLink->exec('PRAGMA journal_mode = wal;');
$this->isConnected = true;
}catch( Exception $e ){
echo $e->getMessage();
};
}
function CleanUpCache(){
if ($DD=@opendir($this->CachePath)){
while($FN=readdir($DD)){
$CF=$this->CachePath.'/'.$FN;
if (is_file($CF)){
if ( strstr($FN,'dbchache_') && (time()-filemtime($CF))>360){
@unlink($CF);
};
};
};
closedir($DD);
} else $this->isCached=false;
}
function ResetCache(){
if ($DD=@opendir($this->CachePath)){
while($FN=readdir($DD)){
$CF=$this->CachePath.'/'.$FN;
if (is_file($CF)){
if ( strstr($FN,'dbchache_')){
@unlink($CF);
};
};
};
closedir($DD);
} else $this->isCached=false;
}
function SetCacheDir($Path){
$this->CachePath = $Path;
$this->isCached = is_dir($this->CachePath) && is_writable($this->CachePath);
if ($this->isCached) $this->CleanUpCache();
}
function escape( $Str ){
if( $this->isConnected ){
return $this->DBLink->escapeString( $Str );
};
return '';
}
function Query($QS,$ChacheIfAveable=true){
if($this->isConnected){
$QS = trim( $QS );
if( $this->isCached && $ChacheIfAveable ){
$QMD5=md5($QS);
$Prefetch=$this->CachePath.'/dbchache_'.$QMD5;
if ( is_file($Prefetch)){
if ( (time()- filemtime($Prefetch))<360){
$FData=file_get_contents($Prefetch);
$this->DebugLog .="[{$QS}] as (Cahed Data),\n";
return unserialize($FData);
} else {
$result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink));
$RetVal=array();
if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){
while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array;
$result->finalize();
};
$FData=serialize($RetVal);
$FD=fopen($Prefetch,'w');
fwrite($FD,$FData);
fclose($FD);
$this->DebugLog .="[{$QS}] as (".$this->DBLink->lastInsertRowID()."),\n";
return $RetVal;
}
} else {
$result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink));
$RetVal=array();
if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){
while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array;
$result->finalize();
};
$FData = serialize($RetVal);
$FD=fopen($Prefetch,'w');
fwrite($FD,$FData);
fclose($FD);
$this->DebugLog .="[{$QS}] as (".$this->DBLink->lastInsertRowID()."),\n";
return $RetVal;
}
} else {
$result = $this->DBLink->query( $QS ) or die (" Error during query [$QS]:".mysqli_error($this->DBLink));
$RetVal=array();
if( ( stripos( $QS, 'insert' ) === false ) && ( stripos( $QS, 'update' ) === false ) && $result !== false && is_a( $result, 'SQLite3Result' ) ){
while( $array = $result->fetchArray( SQLITE3_ASSOC )) $RetVal[]=$array;
$result->finalize();
};
$this->DebugLog .="[{$QS}] as (".$this->DBLink->lastInsertRowID()."),\n";
return $RetVal;
};
} else {
echo "No Connection to DB<br>";
};
}
function getLastInsertID(){
if($this->isConnected){
return $this->DBLink->lastInsertRowID();
};
return -1;
}
function getDebugLog(){
return $this->DebugLog;
}
function __destruct(){
if( $this->isConnected ){
$this->DBLink->close();
unset( $this->DBLink );
};
}
}
?>

58
lib/scripts/distro_web_utils.php

@ -3,6 +3,15 @@ function print_PAGE_HEADER( $JavaMode = 0 ){
?><!DOCTYPE html><html> ?><!DOCTYPE html><html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-chrome-192x192.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#603cba">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>ARGUS Platform Configuration</title> <title>ARGUS Platform Configuration</title>
<link href="/style/style.css" rel="stylesheet"> <link href="/style/style.css" rel="stylesheet">
@ -226,11 +235,32 @@ function print_AUTH_WARNING(){
function print_APPLICATION_INFO(){ function print_APPLICATION_INFO(){
global $SYS_CONFIG; global $SYS_CONFIG;
?><table class="w_panel" width="100%" border=0> ?><table class="w_panel" width="100%" border=0>
<tr><td style="font-size:20px; padding-bottom: 10px;">Application Info</td></tr>
<tr><td align="center"><a class="link_buton" href="/task_wait.php?TID=10">Enable Web Application</a></td></tr>
<tr><td align="center"><a class="link_buton" href="/task_wait.php?TID=11">Disable Web Application</a></td></tr>
<tr><td align="center"><a class="link_buton" href="/add_auth.php">Setup Now!</a></td></tr>
<tr><td align="center">&nbsp;</td></tr>
<tr><td colspan=4 style="font-size:20px; padding-bottom: 10px;">Argus Application Panel</td></tr><tr>
<?php
if( $SYS_CONFIG['ARGUS_CONFIG']['app_is_running'] ){
?>
<td align="center"><a class="task_panel_btn" id="be_stop" href="/task_wait.php?TID=10">Stop Backend Engine</a></td>
<?php
} else {
?>
<td align="center"><a class="task_panel_btn" id="be_start" href="/task_wait.php?TID=10">Start Backend Engine</a></td>
<?php
};
?>
<?php
if( $SYS_CONFIG['ARGUS_CONFIG']['webui_is_running'] ){
?>
<td align="center"><a class="task_panel_btn" id="wui_stop" href="/task_wait.php?TID=10">Stop Web User Interface</a></td>
<?php
} else {
?>
<td align="center"><a class="task_panel_btn" id="wui_start" href="/task_wait.php?TID=10">Stop Web User Interface</a></td>
<?php
};
?>
<td align="center"><a class="task_panel_btn" id="histowipe" href="/task_confirm.php?TID=10">Wipe History Data</a></td>
<td align="center"><a class="task_panel_btn" id="reboot" href="/task_confirm.php?TID=10">Reset to Factory Defaults</a></td>
</tr>
</table><br/><?php </table><br/><?php
}; };
@ -780,10 +810,18 @@ function print_TASK_INFO(){
</table><?php </table><?php
}; };
function print_GO_BACK(){ function print_GO_BACK(){
?><html><head><script>window.addEventListener("load",(event)=>{history.go(-1);});</script></head><body></body></html><?php ?><html><head><script>window.addEventListener("load",(event)=>{history.go(-1);});</script></head><body></body></html><?php
}; };
function print_TASK_CONFIRM(){
?>
KOKO
<?php
};
function print_TASK_PANEL(){ function print_TASK_PANEL(){
global $SYS_CONFIG; global $SYS_CONFIG;
?><table class="w_panel" width="100%" border=0> ?><table class="w_panel" width="100%" border=0>
@ -815,6 +853,16 @@ function print_TASK_PANEL(){
} else { } else {
?><div class="task_panel_btn" id="wifi_na" href="/">WiFi</div><?php ?><div class="task_panel_btn" id="wifi_na" href="/">WiFi</div><?php
}; };
?></td><td align="center"><?php
if( $SYS_CONFIG['MODEM_SETUP'] ){
if( $SYS_CONFIG['MODEM_IS_ON'] ){
?><a class="task_panel_btn" id="wan_cp" href="/">Disable WAN</a><?php
} else {
?><a class="task_panel_btn" id="wan_cp" href="/">Enable WAN</a><?php
};
} else {
?><div class="task_panel_btn" id="wan_cp" href="/">WAN</div><?php
};
?></td><td align="center"> ?></td><td align="center">
<a class="task_panel_btn" id="pkg_install" href="/pack_cp.php">Package Installer</a> <a class="task_panel_btn" id="pkg_install" href="/pack_cp.php">Package Installer</a>
</td></tr> </td></tr>

125
lib/scripts/sys_utils.php

@ -1,6 +1,13 @@
<?php <?php
$SYS_CONFIG = json_decode( file_get_contents( '/srv/etc/system.json' ), true );
require_once( '/srv/scripts/SQLite_Class.php');
if( file_exists( '/srv/etc/system.json' ) ){
$SYS_CONFIG = json_decode( file_get_contents( '/srv/etc/system.json' ), true );
} else {
$SYS_CONFIG = array();
};
function save_system_config(){ function save_system_config(){
global $SYS_CONFIG; global $SYS_CONFIG;
@ -13,7 +20,11 @@ function save_system_config(){
function reload_system_config(){ function reload_system_config(){
global $SYS_CONFIG; global $SYS_CONFIG;
$SYS_CONFIG = json_decode( file_get_contents( '/srv/etc/system.json' ), true );
if( file_exists( '/srv/etc/system.json' ) ){
$SYS_CONFIG = json_decode( file_get_contents( '/srv/etc/system.json' ), true );
} else {
$SYS_CONFIG = array();
};
}; };
@ -586,13 +597,79 @@ function set_NGINX_APP_DISABLE(){
}; };
}; };
function process_is_running( $PName = '', $NArgs = '' ){
$GS = '';
if( is_array( $PName ) ){
foreach( $PName as $P ) $GS .= "| grep \"{$P}\" ";
if( is_array( $NArgs ) ){
foreach( $NArgs as $N ) $GS .= "| grep -v \"{$N}\" ";
} else {
if( $NArgs!= '' ){
$GS .= "| grep -v \"{$NArgs}\" ";
};
};
} else {
if( $PName == '' ) return false;
$GS = "| grep \"{$PName}\" ";
if( is_array( $NArgs ) ){
foreach( $NArgs as $N ) $GS .= "| grep -v \"{$N}\"";
} else {
if( $NArgs != '' ){
$GS .= "| grep -v \"{$NArgs}\" ";
};
};
};
$JOJO = `ps -A -o args {$GS} 2>&1 `;
if( $JOJO == '' ) return false;
$TArr = explode( "\n", $JOJO );
foreach( $TArr as $T ){
$CC = trim( $T );
if( $CC == '' ) continue;
if( ( stripos( $T, 'ps' ) === false ) && ( stripos( $T, 'grep' ) === false ) && ( stripos( $T, 'sshd' ) === false ) ) return true;
};
return false;
};
function stop_BACKEND_APPLICATION(){ function stop_BACKEND_APPLICATION(){
$L = `killall starProcDaemon`;
if( process_is_running('starProcDaemon') ){
$L = `killall starProcDaemon`;
sleep( 1 );
};
if( process_is_running('mojo_d') ){
$L = `killall mojo_d`;
sleep( 4 );
};
if( process_is_running('mojo') ){
$L = `killall mojo`;
sleep( 4 );
};
/// Shutdown Argus Web UI
if( process_is_running( array( 'nginx', 'master process' ), 'ag_nginx' ) ){
$L = `systemctl stop nginx.service`;
sleep( 1 );
};
// Fix unclosed Databases
if( file_exists( '/srv/www/web/lib/controller/data/mysqlitedb.db' ) ){
$DATABASE = new SQLite_DB( '/srv/www/web/lib/controller/data/mysqlitedb.db');
unset( $DATABASE );
};
if( file_exists( '/srv/www/web/lib/controller/data/reports.db' ) ){
$DATABASE = new SQLite_DB( '/srv/www/web/lib/controller/data/reports.db');
unset( $DATABASE );
};
};
function start_BACKEND_APPLICATION(){
$CWD = getcwd();
chdir( '/srv/start' );
$L = `./starProcDaemon`;
sleep( 1 ); sleep( 1 );
$L = `killall mojo_d`;
sleep(4);
$L = `killall mojo`;
sleep(4);
chdir( $CWD );
if( !process_is_running( array( 'nginx', 'master process' ), 'ag_nginx' ) ){
$L = `systemctl start nginx.service`;
sleep( 1 );
};
}; };
function verify_CERT( $ROOT, $CHEK ){ function verify_CERT( $ROOT, $CHEK ){
@ -676,4 +753,38 @@ function list_AP_NEARBY( $DEV ){
return $RV; return $RV;
}; };
function get_argus_config(){
$RV = array();
$RV['app_is_running'] = process_is_running( '/srv/mojo/mojo' );
if( !$RV['app_is_running'] ) $RV['app_is_running'] = process_is_running( '/srv/mojo/mojo_d' );
$RV['webui_is_running'] = process_is_running( array ( 'nginx', 'master' ), 'ag_nginx' );
return $RV;
};
function set_factory_settings(){
stop_BACKEND_APPLICATION();
$R = `rm -f -R /srv/www/web/lib/controller/data/uploads/*`;
$R = `rm -f -R /srv/www/web/lib/controller/data/device_draws/*`;
$R = `rm -f -R /srv/www/web/lib/controller/data/videos/*`;
$SRC = '/srv/www/distro/lib/data/mysqlitedb.db';
$DST = '/srv/www/web/lib/controller/data/mysqlitedb.db';
$R = `rm -f $DST`;
$C = `cp $SRC $DST`;
$SRC = '/srv/www/distro/lib/data/reports.db';
$DST = '/srv/www/web/lib/controller/data/reports.db';
$R = `rm -f $DST`;
$C = `cp $SRC $DST`;
start_BACKEND_APPLICATION();
};
function clear_history(){
stop_BACKEND_APPLICATION();
$R = `rm -f -R /srv/www/web/lib/controller/data/videos/*`;
$SRC = '/srv/www/distro/lib/data/reports.db';
$DST = '/srv/www/web/lib/controller/data/reports.db';
$R = `rm -f $DST`;
$C = `cp $SRC $DST`;
start_BACKEND_APPLICATION();
};
?> ?>

15
lib/scripts/test.php

@ -0,0 +1,15 @@
<?php
require_once('sys_utils.php');
//stop_BACKEND_APPLICATION();
//start_BACKEND_APPLICATION();
set_factory_settings();
//if( process_is_running( 'nginx', 'ag_nginx' ) ){
// echo "True!\n";
// } else {
// echo "False!\n";
// };
?>

10
lib/sysroot/srv/etc/after_boot.sh

@ -0,0 +1,10 @@
#!/bin/sh
#remove old task
rm -f /srv/etc/cron.json
rm -f /srv/etc/cron.lock
/usr/bin/php /srv/etc/boot.php

13
lib/sysroot/srv/etc/boot.php

@ -0,0 +1,13 @@
<?php
require_once('/srv/scripts/sys_utils.php');
unset( $SYS_CONFIG['NET_INFO'] );
unset( $SYS_CONFIG['NET_CONFIG'] );
$SYS_CONFIG['NET_CONFIG'] = get_network_config();
$TD = get_SERVICE_STATUS( 'smbd' );
$SYS_CONFIG['SAMBA_IS_ON'] = $TD['ENA'];
$SYS_CONFIG['ARGUS_CONFIG'] = get_argus_config();
save_system_config();
?>

2
lib/sysroot/srv/etc/check_wifi.sh

@ -0,0 +1,2 @@
#!/bin/bash

206
lib/sysroot/srv/etc/cron.php

@ -0,0 +1,206 @@
<?php
require_once( '/srv/scripts/sys_utils.php' );
unset( $SYS_CONFIG['NET_INFO'] );
unset( $SYS_CONFIG['NET_CONFIG'] );
$SYS_CONFIG['NET_CONFIG'] = get_network_config();
$TD = get_SERVICE_STATUS( 'smbd' );
$SYS_CONFIG['SAMBA_IS_ON'] = $TD['ENA'];
$SYS_CONFIG['ARGUS_CONFIG'] = get_argus_config();
save_system_config();
$CRON_CONFIG = json_decode( file_get_contents( '/srv/etc/cron.json' ), true );
if( count( $CRON_CONFIG ) ){
switch( $CRON_CONFIG['operation'] ){
case 0:{
$L = `reboot`;
exit();
};
case 1:{
// Apply Net Config
$CFG = array();
if( isset( $CRON_CONFIG['parameter'] ) ){
$CFG = json_decode( file_get_contents( $CRON_CONFIG['parameter'] ), true );
unlink( $CRON_CONFIG['parameter'] );
} else {
if( isset( $SYS_CONFIG['NEW_NET_CONFIG'] ) ){
$CFG = $SYS_CONFIG['NEW_NET_CONFIG'];
unset( $SYS_CONFIG['NEW_NET_CONFIG'] );
save_system_config();
};
};
if( count( $CFG ) ){
build_network_config( $CFG );
$L = `/srv/scripts/restart_network.sh`;
unset( $SYS_CONFIG['NET_INFO'] );
unset( $SYS_CONFIG['NET_CONFIG'] );
$SYS_CONFIG['NET_CONFIG'] = get_network_config();
save_system_config();
};
break;
};
case 2:{
// Start Samba Service
$L = `/srv/scripts/samba_on.sh`;
$SYS_CONFIG['SAMBA_IS_ON'] = true;
save_system_config();
break;
};
case 3:{
// Stop Samba Service
$L = `/srv/scripts/samba_off.sh`;
$SYS_CONFIG['SAMBA_IS_ON'] = false;
save_system_config();
break;
};
case 4:{
// Time Sync
$LTS = filemtime( '/srv/etc/cron.json');
if( $LTS ){
$BTS = intval( $CRON_CONFIG['parameter'] );
$NTS = time()+( $BTS - $LTS );
$DTS = date( "Y-m-d H:i:s", $NTS );
$L = `timedatectl set-time "{$DTS}"`;
};
break;
};
case 5:{
$L = `timedatectl set-ntp 1`;
break;
};
case 6:{
$L = `timedatectl set-ntp 0`;
break;
};
case 7:{
//Set Time Zone
$L = `timedatectl set-timezone {$CRON_CONFIG['parameter']}`;
break;
};
case 8:{
// set nginx credentials
if( isset( $SYS_CONFIG['NGINX_AUTH_ACCESS_LIST'] ) ){
if( count( $SYS_CONFIG['NGINX_AUTH_ACCESS_LIST'] ) ){
$AUTH = array();
foreach( $SYS_CONFIG['NGINX_AUTH_ACCESS_LIST'] as $U ){
$AUTH[] = trim( `htpasswd -nb {$U['USERNAME']} {$U['PASSWORD']}` );
};
$FD = fopen( '/srv/etc/htpasswd', "w+" );
if( $FD ){
foreach( $AUTH as $A ){
fprintf( $FD, "%s\n", $A );
};
fclose( $FD );
apply_NGINX_AUTH( '/srv/www/distro', '/srv/etc/htpasswd' );
$L = `service nginx restart`;
};
$SYS_CONFIG['NGINX_AUTH_IS_SET'] = true;
save_system_config();
};
}
break;
};
case 9:{
remove_NGINX_AUTH('/srv/www/distro');
$SYS_CONFIG['NGINX_AUTH_IS_SET'] = false;
$L = `service nginx restart`;
save_system_config();
break;
};
case 10:{
set_NGINX_APP_ENABLE();
$SYS_CONFIG['NGINX_WEB_APP_ENABLED'] = true;
$L = `service nginx restart`;
save_system_config();
break;
};
case 11:{
set_NGINX_APP_DISABLE();
$SYS_CONFIG['NGINX_WEB_APP_ENABLED'] = false;
$L = `service nginx restart`;
save_system_config();
break;
};
case 12:{
$L=`/srv/scripts/ssh_on.sh`;
$SYS_CONFIG['SSH_IS_ON'] = true;
save_system_config();
break;
};
case 13:{
$L=`/srv/scripts/ssh_off.sh`;
$SYS_CONFIG['SSH_IS_ON'] = false;
save_system_config();
break;
};
case 14:{
//Restart NGINX
$L=`service nginx restart`;
break;
};
case 15:{
$Data = list_files( '/srv/samba', '/tar.(gz|bz|bz2)$/i' );
foreach( $Data as $D ) if( md5_file( '/srv/samba/'.$D ) == $CRON_CONFIG['parameter'] ){
$PFN = '/srv/samba/'. $D;
$WDIR = '/srv/tmp/'.$CRON_CONFIG['parameter'];
mkdir( $WDIR );
if( is_dir( $WDIR ) ){
$CMD = 'tar -xvjf '.$PFN.' -C '.$WDIR;
run_command( $CMD );
if( file_exists( $WDIR .'/manifest.crt' ) ){
$Z = list_files( $WDIR, '/tar.(gz|bz|bz2)$/i' );
if( count( $Z ) ){
$PF = $WDIR .'/'. $Z[0];
$MD5 = md5_file( $PF );
if( verify_CERT_KEY( $WDIR .'/manifest.crt', '/srv/etc/ssl/private/host.key' ) ){
if( verify_CERT( '/srv/etc/rootCA.crt', $WDIR .'/manifest.crt' ) ){
$DATA = get_embed_data_CERT( $WDIR .'/manifest.crt' );
if( isset( $DATA['subject']['1.2.3.4'] ) ){
if( $DATA['subject']['1.2.3.4'] == $MD5 ){
stop_BACKEND_APPLICATION();
if( file_exists( $WDIR .'/before.php' ) ){
include( $WDIR .'/before.php' );
};
$CODI = $WDIR . '/' . $MD5;
mkdir( $CODI );
$CMD = 'tar -xvjf '.$PF.' -C '.$CODI;
run_command( $CMD );
$CMD = 'rsync -a --remove-source-files '.$CODI.'/ /srv';
run_command( $CMD );
if( file_exists( $WDIR .'/after.php' ) ){
include( $WDIR .'/after.php' );
};
};
};
} else {
out_log( 'Error: Manifest was signed with wrong CA (Not Dr. Frucht Systems LTD.)!!' );
};
} else {
out_log( 'Error: Manifest has Wrong Private Key!!' );
};
};
} else {
out_log( 'Error: No Manifest Certificate Exists!!' );
};
$CMD = 'rm -R -f -v '.$WDIR;
run_command( $CMD );
@unlink( $PFN );
};
};
break;
};
case 16:{
stop_BACKEND_APPLICATION();
break;
};
case 17:{
start_BACKEND_APPLICATION();
break;
};
case 18:{
set_factory_settings();
break;
};
};
};
?>

12
lib/sysroot/srv/etc/cron_job.sh

@ -0,0 +1,12 @@
#!/bin/bash
if [ ! -f "/srv/etc/cron.lock" ]; then
if [ -f "/srv/etc/cron.json" ]; then
touch /srv/etc/cron.lock
/usr/bin/php /srv/etc/cron.php
rm /srv/etc/cron.json
rm /srv/etc/cron.lock
else
/usr/bin/php /srv/etc/pereodical.php
fi
fi

4
lib/sysroot/srv/etc/enable_wifi.php

@ -1,4 +0,0 @@
<?php
?>

4
lib/sysroot/srv/etc/pereodical.php

@ -0,0 +1,4 @@
<?php
?>

4
lib/sysroot/srv/etc/repair_database.sh

@ -1,4 +0,0 @@
#!/bin/bash
/usr/bin/php /srv/vault/lib/repair_database.php

lib/sysroot/srv/etc/ssl/tmp/rootCA.crt → lib/sysroot/srv/etc/rootCA.crt

1
lib/sysroot/srv/etc/system.json

@ -0,0 +1 @@
{"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":false,"webui_is_running":true}}

BIN
mstile-144x144.png

Binary file not shown.

After

Width: 144  |  Height: 144  |  Size: 4.1 KiB

BIN
mstile-150x150.png

Binary file not shown.

After

Width: 270  |  Height: 270  |  Size: 4.0 KiB

59
safari-pinned-tab.svg

@ -0,0 +1,59 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="517.000000pt" height="517.000000pt" viewBox="0 0 517.000000 517.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,517.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M3301 4894 c-352 -104 -581 -405 -581 -766 0 -574 555 -957 1095
-753 200 75 375 249 449 447 47 123 59 199 53 332 -5 139 -22 208 -77 322
-102 212 -291 364 -524 424 -119 30 -302 27 -415 -6z m360 -456 c69 -31 140
-102 176 -176 24 -48 28 -69 28 -137 -1 -66 -6 -91 -29 -141 -34 -77 -103
-145 -180 -180 -82 -37 -189 -38 -269 -1 -78 35 -141 97 -180 176 -28 58 -32
75 -31 146 0 64 5 91 25 135 43 93 140 176 234 201 57 15 167 4 226 -23z"/>
<path d="M1565 4824 c-206 -28 -377 -119 -481 -257 -181 -239 -201 -551 -53
-805 91 -154 265 -276 466 -325 112 -28 171 -61 221 -124 46 -59 172 -286 188
-340 21 -67 19 -173 -5 -273 -28 -116 -28 -263 0 -383 25 -104 22 -180 -8
-248 -23 -51 -140 -235 -189 -295 -46 -57 -126 -107 -209 -132 -38 -12 -102
-31 -142 -43 -144 -43 -290 -151 -368 -274 -81 -126 -115 -241 -115 -396 0
-357 254 -644 610 -690 221 -28 425 43 585 205 89 90 152 198 182 316 25 100
23 264 -6 373 -27 100 -24 169 8 242 33 75 189 301 233 339 58 50 125 81 240
110 170 44 317 134 401 246 60 79 112 186 131 270 20 83 20 256 1 339 -25 103
-91 224 -168 307 -105 113 -209 172 -376 213 -101 25 -145 48 -198 103 -49 50
-184 277 -210 352 -23 67 -22 193 1 266 26 80 32 265 12 359 -19 90 -79 215
-141 294 -80 101 -241 203 -368 231 -68 16 -195 26 -242 20z m233 -127 c211
-61 372 -237 418 -457 19 -90 14 -178 -16 -305 -27 -109 -24 -238 7 -326 32
-88 180 -335 232 -387 64 -64 128 -96 252 -128 139 -35 208 -73 300 -164 128
-127 188 -284 176 -459 -10 -154 -65 -272 -176 -381 -89 -88 -163 -128 -305
-165 -116 -30 -214 -78 -280 -136 -65 -57 -233 -312 -263 -399 -29 -83 -30
-188 -3 -290 56 -215 -1 -432 -155 -585 -117 -118 -254 -175 -417 -175 -202 0
-383 95 -492 258 -162 244 -132 549 73 752 93 92 160 129 311 170 216 59 290
118 435 344 57 89 102 171 112 205 22 75 20 188 -6 291 -27 112 -26 179 5 330
45 215 28 297 -107 532 -126 220 -190 273 -388 322 -129 32 -217 80 -301 165
-114 115 -170 253 -170 418 0 174 51 296 174 418 123 123 242 172 417 174 63
1 109 -5 167 -22z"/>
<path d="M530 3195 c-36 -8 -108 -36 -160 -61 -168 -83 -302 -245 -355 -427
-13 -47 -16 -90 -13 -220 4 -151 6 -167 32 -230 76 -182 194 -306 370 -388
122 -57 295 -74 441 -44 94 19 237 92 308 155 102 91 185 229 218 360 9 33 14
104 13 180 0 109 -4 135 -28 205 -75 219 -231 377 -448 452 -92 32 -276 41
-378 18z m320 -111 c260 -77 435 -310 433 -579 -1 -256 -166 -482 -407 -562
-117 -38 -258 -38 -369 0 -188 65 -320 198 -382 382 -37 111 -38 255 -2 368
82 257 326 426 592 412 44 -3 105 -12 135 -21z"/>
<path d="M4300 3194 c-36 -7 -108 -35 -160 -60 -187 -93 -324 -274 -366 -484
-53 -267 57 -552 271 -705 128 -92 261 -135 415 -135 119 0 210 22 320 76 168
83 299 241 357 429 14 47 18 91 17 200 0 124 -3 148 -26 212 -34 96 -87 189
-144 252 -91 102 -241 189 -373 217 -83 17 -226 17 -311 -2z m321 -110 c196
-58 355 -217 413 -413 26 -87 22 -252 -8 -346 -90 -282 -391 -461 -676 -401
-320 67 -531 370 -476 684 44 253 238 446 491 492 65 12 188 4 256 -16z"/>
<path d="M3372 1716 c-45 -9 -111 -33 -170 -62 -350 -173 -484 -602 -300 -957
95 -182 285 -323 483 -358 96 -16 274 -7 348 20 211 74 361 217 437 413 51
131 61 288 28 428 -16 72 -93 220 -145 282 -81 97 -214 183 -343 222 -76 23
-247 29 -338 12z m330 -122 c186 -59 342 -225 393 -419 20 -77 19 -220 -1
-299 -54 -211 -237 -386 -450 -431 -323 -69 -641 140 -710 467 -49 226 47 465
241 603 153 109 340 137 527 79z"/>
</g>
</svg>

54
site.webmanifest

@ -0,0 +1,54 @@
{
"name": "Argus Platform",
"short_name": "Argus Platform",
"icons": [
{
"src": "/android-chrome-36x36.png",
"sizes": "36x36",
"type": "image/png"
},
{
"src": "/android-chrome-48x48.png",
"sizes": "48x48",
"type": "image/png"
},
{
"src": "/android-chrome-72x72.png",
"sizes": "72x72",
"type": "image/png"
},
{
"src": "/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
},
{
"src": "/android-chrome-144x144.png",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

BIN
style/favicon_package_v0.16 (2).zip

Binary file not shown.

BIN
style/images/017.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.7 KiB

BIN
style/images/042.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.5 KiB

BIN
style/images/043.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.4 KiB

BIN
style/images/048.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.5 KiB

BIN
style/images/051.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.5 KiB

BIN
style/images/055.png

Binary file not shown.

After

Width: 40  |  Height: 40  |  Size: 1.5 KiB

6
style/style.css

@ -110,6 +110,12 @@ body{
.task_panel_btn#samba_stop{ background-image: url('images/009.png');} .task_panel_btn#samba_stop{ background-image: url('images/009.png');}
.task_panel_btn#samba_start{ background-image: url('images/024.png');} .task_panel_btn#samba_start{ background-image: url('images/024.png');}
.task_panel_btn#pkg_install{ background-image: url('images/007.png');} .task_panel_btn#pkg_install{ background-image: url('images/007.png');}
.task_panel_btn#histowipe{ background-image: url('images/048.png');}
.task_panel_btn#wui_stop{ background-image: url('images/051.png');}
.task_panel_btn#be_stop{ background-image: url('images/042.png');}
.task_panel_btn#be_start{ background-image: url('images/043.png');}
.task_panel_btn#wui_start{ background-image: url('images/055.png');}
.task_panel_btn#wan_cp{ background-image: url('images/017.png');}
.task_panel_btn:hover{ .task_panel_btn:hover{
color: black; color: black;
border: black 2px solid; border: black 2px solid;

18
task_confirm.php

@ -0,0 +1,18 @@
<?php
require_once('../../scripts/sys_utils.php');
require_once('../../scripts/distro_web_utils.php');
$CTID = -1;
$CPARAM = '';
if( isset( $_GET['TID'] ) ){
$CTID = intval( $_GET['TID'] );
} else if( isset( $_POST['TID'] ) ){
$CTID = intval( $_POST['TID'] );
};
if( $CTID > -1 ){
print_PAGE_HEADER( 1 );
print_TASK_CONFIRM( $CTID );
print_PAGE_BOTTOM();
exit();
};
header( 'loaction: /' );
?>

18
wan_cp.php

@ -0,0 +1,18 @@
<?php
require_once('../../scripts/sys_utils.php');
require_once('../../scripts/distro_web_utils.php');
print_PAGE_HEADER();
if( $SYS_CONFIG['NGINX_AUTH_IS_SET'] == false ) {
print_AUTH_WARNING();
};
print_CONNECTION_INFO();
print_TASK_PANEL();
print_NET_INFO();
print_CERT_INFO();
print_APPLICATION_INFO();
print_TIME_INFO();
print_PAGE_BOTTOM();
?>
Loading…
Cancel
Save