1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-01-19 07:52:16 +01:00

Moved config to ykval-config

This commit is contained in:
Olov Danielson 2009-12-07 15:31:33 +00:00
parent 93ca2d9536
commit a4b3dbc364
4 changed files with 14 additions and 9 deletions

View File

@ -8,6 +8,10 @@ $baseParams['__YKVAL_DB_USER__'] = 'ykval_verifier';
$baseParams['__YKVAL_DB_PW__'] = 'lab';
# For the validation server sync
$baseParams['__YKVAL_SYNC_POOL__'] = "http://api2.yubico.com/wsapi/sync;http://api3.yubico.com/wsapi/sync;http://api4.yubico.com/wsapi/sync";
$baseParams['__YKVAL_SYNC_INTERVAL__'] = 60;
$baseParams['__YKVAL_SYNC_MAX_SIMUL__'] = 50;
$baseParams['__YKVAL_SYNC_TIMEOUT__'] = 30;
$baseParams['__YKVAL_SYNC_OLD_LIMIT_'] = 1;
# For the get-api-key service.
$baseParams['__YKGAK_DB_HOST__'] = $baseParams['__YKVAL_DB_HOST__'];

View File

@ -35,7 +35,7 @@ CREATE TABLE queue (
random_key INT,
otp VARCHAR(100) NOT NULL,
server VARCHAR(100) NOT NULL,
info VARCHAR(100) NOT NULL,
info VARCHAR(256) NOT NULL,
PRIMARY KEY (id)
);

View File

@ -5,13 +5,13 @@ require_once 'ykval-config.php';
$sl = new SyncLib();
$resync = $baseParams['__YKVAL_SYNC_INTERVAL__'];
# Loop forever and resync
while (True) {
$sl->reSync(10);
$sl->reSync($baseParams['__YKVAL_SYNC_OLD_LIMIT__']);
sleep(60);
}
sleep($baseParams['__YKVAL_SYNC_INTERVAL__');)
}
?>

View File

@ -19,7 +19,8 @@ class SyncLib
$baseParams['__YKVAL_DB_NAME__']);
$this->db->connect();
$this->random_key=rand(0,1<<16);
$this->max_url_chunk=100;
$this->max_url_chunk=$baseParams['__YKVAL_SYNC_MAX_SIMUL__'];
$this->resync_timeout=$baseParams['__YKVAL_SYNC_TIMEOUT__'];
}
@ -222,7 +223,7 @@ class SyncLib
$url_chunks=array_chunk($urls, $this->max_url_chunk);
foreach($url_chunks as $urls) {
$ans_arr=$this->retrieveURLasync($urls, count($urls));
$ans_arr=$this->retrieveURLasync($urls, count($urls), $this->resync_timeout);
if (!is_array($ans_arr)) {
$this->log('notice', 'No responses from validation server pool');
@ -402,7 +403,7 @@ class SyncLib
URLs fail, data from some URL that did not match parameter $match
(defaults to ^OK) is returned, or if all URLs failed, false.
*/
function retrieveURLasync ($urls, $ans_req=1) {
function retrieveURLasync ($urls, $ans_req=1, $timeout=1.0) {
$mh = curl_multi_init();
$ch = array();
@ -458,7 +459,7 @@ class SyncLib
unset ($ch[$info['handle']]);
}
curl_multi_select ($mh);
curl_multi_select ($mh, $timeout);
}
} while($active);