Changeset 2581
- Timestamp:
- Oct 7, 2016, 1:20:00 PM (4 years ago)
- Location:
- admin-center/trunk/fuentes
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/lib/utils.js
r2185 r2581 10 10 this.logfilesadded=0; 11 11 this.maxlogfilesadded=50; 12 this.formFactory=new formFactory(); 12 13 this.crypt=new JSEncrypt(); // Class to encrypt and decrypt keys 13 14 } … … 233 234 if (response.status) { 234 235 var ws=response.ws; //response.ws is server websocket 236 // A little hack of my friends... 237 ws=ws.replace("127.0.0.1", location.host); 235 238 self.showWSListener(ws, jobid); 236 239 … … 339 342 // 2nd Prepare Listener through websocket 340 343 //var wsUri = "ws://"+sessionStorage.server +":"+port; 344 console.log("KKKKKKKKKKKKKKK "+jobid); 341 345 websocket = new WebSocket(ws+"/"+jobid); 346 console.log("QQQQQQQQQQQQQQQQQQ "+jobid); 342 347 //console.log(websocket); 343 348 websocket.onopen = function() { // connection is open … … 448 453 for (var i in arglist) n4dargs.push(arglist[i]); 449 454 450 //console.log(n4dargs); 455 console.log(n4dargs); 456 451 457 // Calling method 452 458 //console.log("-----------------------------1"); 453 459 //console.log(JSON.stringify(n4dargs)); 454 460 //console.log("-----------------------------2"); 455 456 461 // Set public key for this connection with serverKey 457 462 Utils.crypt.setPublicKey(sessionStorage.serverKey); 458 459 463 //$.post('n4d.php', 460 464 $.ajax( … … 471 475 console.log(ret_coded); 472 476 ret_str=(CryptoJS.AES.decrypt(JSON.stringify(ret_coded), sessionStorage.password,{format: CryptoJSAesJson}).toString(CryptoJS.enc.Utf8)); 477 console.log(ret_str); 473 478 ret=JSON.parse(JSON.parse(ret_str)); 474 479 callback(ret); … … 532 537 /* getWS is the server websocket */ 533 538 if (response.status) { 534 var ws=response.ws; //response.ws is server websocket 539 // var ws=response.ws; //response.ws is server websocket 540 // Hacking it... 541 var ws=response.ws; //response.ws is server websocket 542 ws=ws.replace("127.0.0.1", location.host); 543 console.log(response.ws); 535 544 self.n4d([sessionStorage.username , sessionStorage.password], 536 545 n4dclass, -
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/login.php
r2185 r2581 24 24 <!--Utilities --> 25 25 <script type="text/javascript" src="lib/waitwin.js"></script> 26 <script type="text/javascript" src="lib/formFactory.js"></script> 26 27 <script type="text/javascript" src="lib/utils.js"></script> 27 28 -
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/main.php
r2238 r2581 99 99 echo ('<script type="text/javascript" src="lib/jsencrypt/jsencrypt.js"></script>'); 100 100 echo ('<script type="text/javascript" src="lib/waitwin.js"></script>'); 101 echo ('<script type="text/javascript" src="lib/formFactory.js"></script>'); 101 102 echo ('<script type="text/javascript" src="lib/utils.js"></script>'); 102 103 echo ('<script type="text/javascript" src="lib/nouislider/nouislider.min.js"></script>'); -
admin-center/trunk/fuentes/admin-center.install/usr/share/admin-center/n4d.php
r2185 r2581 46 46 47 47 function n4d($method, $args, $timeout){ 48 writeHeader(); 49 50 $url='https://127.0.0.1:9779'; 51 $request=xmlrpc_encode_request($method, $args); 52 //error_log($request); 53 $header[] = "Content-type: text/xml"; 54 $header[] = "Content-length: ".strlen($request); 55 56 $ch = curl_init(); 57 curl_setopt($ch, CURLOPT_URL, $url); 58 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 59 curl_setopt($ch, CURLOPT_TIMEOUT, 10000); 60 curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 61 curl_setopt($ch, CURLOPT_POSTFIELDS, $request); 48 try{ 49 writeHeader(); 62 50 51 $url='https://127.0.0.1:9779'; 52 $request=xmlrpc_encode_request($method, $args); 53 error_log($request); 54 $header[] = "Content-type: text/xml"; 55 $header[] = "Content-length: ".strlen($request); 56 57 $ch = curl_init(); 58 curl_setopt($ch, CURLOPT_URL, $url); 59 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 60 curl_setopt($ch, CURLOPT_TIMEOUT, 10000); 61 curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 62 curl_setopt($ch, CURLOPT_POSTFIELDS, $request); 63 64 if ($timeout!="0"){ 65 curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); // async 66 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); // async 67 } 63 68 64 if ($timeout!="0"){ 65 error_log("**************************************************************"); 66 curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); // async 67 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); // async 68 } 69 70 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); 71 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 72 curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/n4dcert.pem"); 73 74 75 $data = curl_exec($ch); 76 curl_close($ch); 77 78 //error_log($data); 79 //error_log(curl_errno($ch)); 80 if (curl_errno($ch)) { 81 $xml_snippet=simplexml_load_string($data); 82 $json=json_encode($xml_snippet); 83 echo (AESEncrypt($json)); 84 } else { 85 $xmlobj=xmlrpc_decode($data); 69 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); 70 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 71 curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/n4dcert.pem"); 86 72 87 error_log($xmlobj); 88 89 $json=json_encode($xmlobj); 90 if ($json=="") { 91 $json=$xmlobj;} 73 $data = curl_exec($ch); 74 75 //error_log($data); ///////////////////// 76 //error_log(curl_errno($ch)); //////////////////////////////// 77 78 curl_close($ch); 79 80 if ((gettype($ch)!="unknown type")&&curl_errno($ch)) { 81 $xml_snippet=simplexml_load_string($data); 82 $json=json_encode($xml_snippet); 92 83 echo (AESEncrypt($json)); 93 } 94 84 } else { 85 $xmlobj=xmlrpc_decode($data); 86 if (gettype($xmlobj)=="string") error_log($xmlobj); 87 88 $json=json_encode($xmlobj); 89 if ($json=="") { 90 $json=$xmlobj;} 91 echo (AESEncrypt($json)); 92 } 93 } catch (Exception $e){ 94 error_log("$e->getMessage()"); 95 echo 'FATAL exception: ', $e->getMessage(), "\n"; 96 } 95 97 } 96 98 … … 119 121 120 122 $timeout=$_POST["timeout"]; 121 /*$myfile = fopen("/tmp/n4dlog","a"); 123 /* 124 $myfile = fopen("/tmp/n4dlog","a"); 122 125 fwrite($myfile,"\nMETHOD:\n"); 123 126 fwrite($myfile,$method); … … 142 145 fclose($myfile); 143 146 error_log($method); 144 */147 */ 145 148 146 149 if (isset($_POST['log'])) $log=$_POST["log"]; -
admin-center/trunk/fuentes/debian/admin-center.postinst
r2117 r2581 21 21 # Generating keys 22 22 if [ ! -e ${CONFIG_PATH}/private_key.pem ]; then 23 openssl genrsa -out ${CONFIG_PATH}/private_key.pem 204823 openssl genrsa -out ${CONFIG_PATH}/private_key.pem 8192 24 24 openssl rsa -in ${CONFIG_PATH}/private_key.pem -out ${CONFIG_PATH}/public_key.pem -outform PEM -pubout 25 25 fi -
admin-center/trunk/fuentes/debian/changelog
r2238 r2581 1 admin-center (0.5.10) xenial; urgency=high 2 3 * Added form factory library 4 * Fixed RSA Key from 2048 to 8192 bits. 5 6 -- <joamuran@gmail.com> Fri, 07 Oct 2016 13:10:36 +0200 7 1 8 admin-center (0.5.9) xenial; urgency=high 2 9
Note: See TracChangeset
for help on using the changeset viewer.