Allowing SSL on lib/api/update and lib/api/sync

This commit is contained in:
xdrm-brackets 2017-07-17 19:10:50 +02:00
parent ef672e4eef
commit 0bf05fe763
3 changed files with 41 additions and 0 deletions

View File

@ -165,6 +165,45 @@
} }
slog('History succesfully truncated', 'api:deploy', 'update');
return 0;
/* [7] Remove features' entries
=========================================================*/
/* (0) We are done if @sync */
if( $sync ){
slog('Post-sync deployment -> no history truncate', 'api:deploy', 'update');
return 0;
}
/* (1) Check history entries count */
if( !isset($arr_r['saved']) || !is_array($arr_r['saved']) ){
slog('No \'saved\' found in api.response file', 'api:deploy', 'update');
return 127;
}
/* (2) Check history count */
if( !isset($arr_r['saved']['history']) || !is_numeric($arr_r['saved']['history']) ){
slog('No \'actions\'.\'history\' found in api.response file', 'api:deploy', 'update');
return 127;
}
/* (3) Fetch number of entries */
$saved = intval($arr_r['saved']['history']);
$saved = $saved < 0 ? 0 : $saved; // prevent negative
/* (4) Truncate the log file */
$truncated = syscall(SOURCE_DIR."/lib/file/truncate mfrc522 {$saved}");
/* (5) Manage error */
if( $truncated === false ){
slog('History cannot be truncated', 'api:deploy', 'update');
return 127;
}
slog('History succesfully truncated', 'api:deploy', 'update'); slog('History succesfully truncated', 'api:deploy', 'update');
return 0; return 0;
} }

View File

@ -68,6 +68,7 @@
/* (3) Additional options */ /* (3) Additional options */
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // allow SSL

View File

@ -56,6 +56,7 @@
/* (3) Additional options */ /* (3) Additional options */
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // allow SSL