diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | admin/WebConsole/rest/remotepc.php | 24 | ||||
-rw-r--r-- | admin/WebConsole/rest/server.php | 82 | ||||
-rw-r--r-- | installer/INSTALL.es.txt | 6 | ||||
-rwxr-xr-x | installer/opengnsys_installer.sh | 41 | ||||
-rwxr-xr-x | installer/opengnsys_update.sh | 71 | ||||
-rw-r--r-- | installer/vagrant/README.es.txt | 4 | ||||
-rw-r--r-- | installer/vagrant/Vagrantfile-devel-vbox | 6 | ||||
-rw-r--r-- | installer/vagrant/Vagrantfile-prod-vbox (renamed from installer/vagrant/Vagrantfile-trunk-vbox) | 6 |
9 files changed, 127 insertions, 114 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..485dee64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/admin/WebConsole/rest/remotepc.php b/admin/WebConsole/rest/remotepc.php index 39224636..4bf7b6b5 100644 --- a/admin/WebConsole/rest/remotepc.php +++ b/admin/WebConsole/rest/remotepc.php @@ -81,7 +81,7 @@ $app->post('/ous/:ouid/images/:imageid/reserve(/)', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: labid=$labid, maxtime=$maxtime"); // Choose older not-reserved client with image installed and get ogAdmServer data. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, +SELECT adm.idusuario, entornos.ipserveradm, entornos.portserveradm, ordenadores.idordenador, ordenadores.nombreordenador, ordenadores.ip, ordenadores.mac, ordenadores.agentkey, ordenadores_particiones.numdisk, ordenadores_particiones.numpar, aulas.idaula, aulas.idcentro @@ -92,7 +92,7 @@ SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, RIGHT JOIN ordenadores_particiones USING(idordenador) RIGHT JOIN imagenes USING(idimagen) LEFT JOIN remotepc ON remotepc.id=ordenadores.idordenador - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND aulas.idcentro = '$ouid' AND aulas.idaula LIKE '$labid' AND aulas.inremotepc = 1 AND imagenes.idimagen = '$imageid' AND imagenes.inremotepc = 1 AND (remotepc.reserved < NOW() OR ISNULL(reserved)) @@ -103,7 +103,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Read query data. $serverip = $rs->campos["ipserveradm"]; $serverport = $rs->campos["portserveradm"]; @@ -290,13 +290,13 @@ $app->post('/ous/:ouid/labs/:labid/clients/:clntid/events', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: urlLogin=$urlLogin, urlLogout=$urlLogout"); // Select client data for UDS compatibility. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, remotepc.* +SELECT adm.idusuario, ordenadores.idordenador, remotepc.* FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) RIGHT JOIN usuarios USING(idusuario) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro = '$ouid' AND aulas.idaula ='$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -305,7 +305,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["reserved"])) { // Updating DB if client is reserved. @@ -381,12 +381,12 @@ $app->post('/ous/:ouid/labs/:labid/clients/:clntid/session', 'validateApiKey', writeRemotepcLog($app->request()->getResourceUri(). ": Parameters: deadLine=$deadLine"); // Get client's data. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, remotepc.* +SELECT adm.idusuario, ordenadores.idordenador, remotepc.* FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND aulas.idcentro = '$ouid' AND aulas.idaula = '$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -395,7 +395,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["urllogin"])) { // Read query data. @@ -479,13 +479,13 @@ $app->delete('/ous/:ouid/labs/:labid/clients/:clntid/unreserve', 'validateApiKey // Select client data for UDS compatibility. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.ip, ordenadores.agentkey, remotepc.reserved +SELECT adm.idusuario, ordenadores.idordenador, ordenadores.ip, ordenadores.agentkey, remotepc.reserved FROM remotepc RIGHT JOIN ordenadores ON remotepc.id=ordenadores.idordenador JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) RIGHT JOIN usuarios USING(idusuario) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro = '$ouid' AND aulas.idaula ='$labid' AND ordenadores.idordenador = '$clntid'; EOD; @@ -494,7 +494,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is admin and client exists. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Check if client is reserved. if (! is_null($rs->campos["reserved"])) { // Read query data. diff --git a/admin/WebConsole/rest/server.php b/admin/WebConsole/rest/server.php index 258b0160..1721411d 100644 --- a/admin/WebConsole/rest/server.php +++ b/admin/WebConsole/rest/server.php @@ -90,12 +90,12 @@ function getStatus($ouid, $labid, $clntid=0) { // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, entornos.ipserveradm, entornos.portserveradm, +SELECT adm.idusuario, entornos.ipserveradm, entornos.portserveradm, aulas.idaula, ordenadores.idordenador, ordenadores.ip FROM entornos, ordenadores JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' EOD; @@ -111,7 +111,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and asset exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and (($single and checkParameter($rs->campos["idordenador"])) or (! $single and checkParameter($rs->campos["idaula"])))) { + if (checkAdmin($rs->campos["idusuario"]) and (($single and checkParameter($rs->campos["idordenador"])) or (! $single and checkParameter($rs->campos["idaula"])))) { // First, try to connect to ogAdmCleint service. $serverip = $rs->campos["ipserveradm"]; $serverport = $rs->campos["portserveradm"]; @@ -321,7 +321,7 @@ $app->get('/ous/:ouid(/)', 'validateApiKey', SELECT * FROM centros RIGHT JOIN administradores_centros USING(idcentro) - WHERE administradores_centros.idadministradorcentro = '$userid' + WHERE administradores_centros.idusuario = '$userid' AND centros.idcentro = '$ouid' LIMIT 1; EOD; @@ -329,7 +329,7 @@ EOD; $rs->Comando=&$cmd; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"]) and + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idcentro"])) { $response['id'] = (int)$ouid; $response['name'] = $rs->campos["nombrecentro"]; @@ -353,10 +353,10 @@ $app->get('/ous/:ouid/groups(/)', 'validateApiKey', function($ouid) { $ouid = htmlspecialchars($ouid); // List group of labs if user is OU's admin. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, grupos.* +SELECT adm.idusuario, grupos.* FROM grupos RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid'; EOD; $rs=new Recordset; @@ -364,7 +364,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"])) { + if (checkAdmin($rs->campos["idusuario"])) { $response = Array(); // Read data. if (! is_null($rs->campos["idcentro"])) { @@ -401,12 +401,12 @@ $app->get('/ous/:ouid/labs(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, aulas.*, grp.idgrupo AS group_id, +SELECT adm.idusuario, aulas.*, grp.idgrupo AS group_id, grp.nombregrupoordenador, grp.grupoid AS group_group_id, grp.comentarios FROM aulas RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN gruposordenadores AS grp USING(idaula) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' ORDER BY aulas.idaula, grp.idgrupo EOD; @@ -415,7 +415,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error opening recordset. // Check if user is an UO admin. $rs->Primero(); - if (checkAdmin($rs->campos["idadministradorcentro"])) { + if (checkAdmin($rs->campos["idusuario"])) { $response = Array(); if (! is_null($rs->campos["idcentro"])) { while (!$rs->EOF) { @@ -478,11 +478,11 @@ $app->get('/ous/:ouid/labs/:labid(/)', 'validateApiKey', $labid = htmlspecialchars($labid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, COUNT(idordenador) AS defclients, aulas.* +SELECT adm.idusuario, COUNT(idordenador) AS defclients, aulas.* FROM aulas RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN ordenadores USING(idaula) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid' AND idaula='$labid'; EOD; @@ -491,7 +491,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and lab exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idaula"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idaula"])) { $response['id'] = (int)$rs->campos["idaula"]; $response['name'] = $rs->campos["nombreaula"]; $response['location'] = $rs->campos["ubicacion"]; @@ -543,11 +543,11 @@ $app->get('/ous/:ouid/labs/:labid/clients(/)', 'validateApiKey', $labid = htmlspecialchars($labid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.*, aulas.idaula AS labid +SELECT adm.idusuario, ordenadores.*, aulas.idaula AS labid FROM ordenadores RIGHT JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid'; EOD; @@ -556,7 +556,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and lab exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["labid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["labid"])) { $response = Array(); while (!$rs->EOF) { if (!is_null($rs->campos["idordenador"])) { @@ -604,12 +604,12 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid(/)', 'validateApiKey', $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.*, +SELECT adm.idusuario, ordenadores.*, IF(ordenadores.idordenador=aulas.idordprofesor, 1, 0) AS profclient FROM ordenadores JOIN aulas USING(idaula) RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND idcentro='$ouid' AND idaula='$labid' AND idordenador='$clntid'; @@ -619,7 +619,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin, lab exists and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idaula"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idaula"]) and checkParameter($rs->campos["idordenador"])) { // Read data. $response['id'] = (int)$rs->campos["idordenador"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -661,7 +661,7 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid/hardware(/)', 'validateApiKey' $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.nombreordenador, +SELECT adm.idusuario, ordenadores.idordenador, ordenadores.nombreordenador, tipohardwares.nemonico, hardwares.descripcion FROM ordenadores JOIN aulas USING(idaula) @@ -669,7 +669,7 @@ SELECT adm.idadministradorcentro, ordenadores.idordenador, ordenadores.nombreord LEFT JOIN perfileshard_hardwares USING(idperfilhard) LEFT JOIN hardwares ON perfileshard_hardwares.idhardware=hardwares.idhardware LEFT JOIN tipohardwares ON tipohardwares.idtipohardware=hardwares.idtipohardware - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' AND ordenadores.idordenador='$clntid'; @@ -679,7 +679,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idordenador"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idordenador"])) { // Read data. $response['id'] = (int)$rs->campos["idordenador"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -717,7 +717,7 @@ $app->get('/ous/:ouid/labs/:labid/clients/:clntid/diskcfg(/)', 'validateApiKey', $clntid = htmlspecialchars($clntid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, ordenadores.idordenador AS clientid, +SELECT adm.idusuario, ordenadores.idordenador AS clientid, ordenadores.nombreordenador, ordenadores_particiones.*, tipospar.tipopar, sistemasficheros.nemonico, nombresos.nombreso, imagenes.nombreca, (imagenes.revision - ordenadores_particiones.revision) AS difimagen @@ -729,7 +729,7 @@ SELECT adm.idadministradorcentro, ordenadores.idordenador AS clientid, LEFT JOIN sistemasficheros USING(idsistemafichero) LEFT JOIN nombresos USING(idnombreso) LEFT JOIN imagenes USING(idimagen) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND aulas.idaula='$labid' AND ordenadores.idordenador='$clntid' @@ -740,7 +740,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and client exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["clientid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["clientid"])) { // Read data. $response['id'] = (int)$rs->campos["clientid"]; $response['name'] = $rs->campos["nombreordenador"]; @@ -815,10 +815,10 @@ $app->get('/ous/:ouid/repos(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, adm.idcentro AS ouid, repositorios.* +SELECT adm.idusuario, adm.idcentro AS ouid, repositorios.* FROM repositorios RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid'; EOD; $rs=new Recordset; @@ -826,7 +826,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["ouid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["ouid"])) { $response = Array(); while (!$rs->EOF) { if (! is_null($rs->campos["idcentro"])) { @@ -860,10 +860,10 @@ $app->get('/ous/:ouid/repos/:repoid(/)', 'validateApiKey', $repoid = htmlspecialchars($repoid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, repositorios.* +SELECT adm.idusuario, repositorios.* FROM repositorios RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND idrepositorio='$repoid'; EOD; @@ -872,7 +872,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idrepositorio"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idrepositorio"])) { // Read data. $response['id'] = (int)$rs->campos["idrepositorio"]; $response['name'] = $rs->campos["nombrerepositorio"]; @@ -899,10 +899,10 @@ $app->get('/ous/:ouid/images(/)', 'validateApiKey', $ouid = htmlspecialchars($ouid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, adm.idcentro AS ouid, imagenes.* +SELECT adm.idusuario, adm.idcentro AS ouid, imagenes.* FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid'; EOD; $rs=new Recordset; @@ -910,7 +910,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["ouid"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["ouid"])) { $response = Array(); while (!$rs->EOF) { if (! is_null($rs->campos["idcentro"])) { @@ -944,12 +944,12 @@ $app->get('/ous/:ouid/images/:imgid(/)', 'validateApiKey', $imgid = htmlspecialchars($imgid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, imagenes.*, nombreso AS os +SELECT adm.idusuario, imagenes.*, nombreso AS os FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) LEFT JOIN perfilessoft USING(idperfilsoft) LEFT JOIN nombresos USING(idnombreso) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND idimagen='$imgid'; EOD; @@ -958,7 +958,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idimagen"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idimagen"])) { // Read data. $response['id'] = (int)$rs->campos["idimagen"]; $response['name'] = $rs->campos["nombreca"]; @@ -1007,7 +1007,7 @@ EOD; $imgid = htmlspecialchars($imgid); // Database query. $cmd->texto = <<<EOD -SELECT adm.idadministradorcentro, imagenes.idimagen, imagenes.nombreca, +SELECT adm.idusuario, imagenes.idimagen, imagenes.nombreca, nombresos.nombreso, softwares.descripcion FROM imagenes RIGHT JOIN administradores_centros AS adm USING(idcentro) @@ -1015,7 +1015,7 @@ SELECT adm.idadministradorcentro, imagenes.idimagen, imagenes.nombreca, LEFT JOIN nombresos USING(idnombreso) LEFT JOIN perfilessoft_softwares USING(idperfilsoft) LEFT JOIN softwares USING(idsoftware) - WHERE adm.idadministradorcentro = '$userid' + WHERE adm.idusuario = '$userid' AND adm.idcentro='$ouid' AND imagenes.idimagen='$imgid' ORDER BY softwares.descripcion ASC; @@ -1025,7 +1025,7 @@ EOD; if (!$rs->Abrir()) return(false); // Error oppening recordset. $rs->Primero(); // Check if user is an UO admin and repo exists. - if (checkAdmin($rs->campos["idadministradorcentro"]) and checkParameter($rs->campos["idimagen"])) { + if (checkAdmin($rs->campos["idusuario"]) and checkParameter($rs->campos["idimagen"])) { $response['id'] = (int)$rs->campos["idimagen"]; $response['name'] = $rs->campos["nombreca"]; if (is_null($rs->campos["nombreso"])) { diff --git a/installer/INSTALL.es.txt b/installer/INSTALL.es.txt index 33070d26..0fd5ba75 100644 --- a/installer/INSTALL.es.txt +++ b/installer/INSTALL.es.txt @@ -1,5 +1,5 @@ -Instalación y Actualización de OpenGnsys 1.1.0 -============================================== +Instalación y Actualización de OpenGnsys 1.1.1pre +================================================= Instalación inicial @@ -12,7 +12,7 @@ Descargar una versión completa y desccomprimir el fichero "opengnsys-version.ta cd opengnsys/installer O bien, descargar el instalador desde la última reversión del repositorio: - svn export https://opengnsys.es/svn/branches/version1.1/installer/opengnsys_installer.sh + wget https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh Opcionalmente, puede descargarse la imagen del cliente; si no se realiza este paso, el instalador la descargará automáticamente. wget https://opengnsys.es/downloads/ogLive-versioncliente.iso diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 76563275..ba6b0bf2 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -95,17 +95,19 @@ done echo -e "\\n==============================" -# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). +# Comprobar si se ha descargado el paquete comprimido (REMOTE=0) o sólo el instalador (REMOTE=1). PROGRAMDIR=$(readlink -e "$(dirname "$0")") PROGRAMNAME=$(basename "$0") OPENGNSYS_SERVER="opengnsys.es" DOWNLOADURL="https://$OPENGNSYS_SERVER/trac/downloads" if [ -d "$PROGRAMDIR/../installer" ]; then - USESVN=0 + REMOTE=0 else - USESVN=1 + REMOTE=1 fi -SVN_URL="https://$OPENGNSYS_SERVER/svn/branches/version1.1/" +BRANCH="devel" +CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH" +API_URL="https://api.github.com/repos/opengnsys/OpenGnsys/branches/$BRANCH" WORKDIR=/tmp/opengnsys_installer mkdir -p $WORKDIR @@ -167,7 +169,7 @@ OSVERSION="${OSVERSION%%.*}" # Configuración según la distribución GNU/Linux (usar minúsculas). case "$OSDISTRIB" in ubuntu|debian|linuxmint) - DEPENDENCIES=( subversion apache2 php php-ldap libapache2-mod-php mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast shim-signed grub-efi-amd64-signed ) + DEPENDENCIES=( apache2 php php-ldap libapache2-mod-php mysql-server php-mysql isc-dhcp-server bittorrent tftp-hpa tftpd-hpa xinetd build-essential g++-multilib libmysqlclient-dev wget curl doxygen graphviz bittornado ctorrent samba rsync unzip netpipes debootstrap schroot squashfs-tools btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast shim-signed grub-efi-amd64-signed ) UPDATEPKGLIST="apt-get update" INSTALLPKG="apt-get -y install --force-yes" CHECKPKG="dpkg -s \$package 2>/dev/null | grep Status | grep -qw install" @@ -204,7 +206,7 @@ case "$OSDISTRIB" in TFTPCFGDIR=/var/lib/tftpboot ;; fedora|centos) - DEPENDENCIES=( subversion httpd mod_ssl php php-ldap mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm ) + DEPENDENCIES=( httpd mod_ssl php php-ldap mysql-server mysql-devel mysql-devel.i686 php-mysql dhcp tftp-server tftp xinetd binutils gcc gcc-c++ glibc-devel glibc-devel.i686 glibc-static glibc-static.i686 libstdc++-devel.i686 make wget curl doxygen graphviz ctorrent samba samba-client rsync unzip debootstrap schroot squashfs-tools python-crypto arp-scan procps-ng gettext moreutils jq net-tools http://ftp.altlinux.org/pub/distributions/ALTLinux/5.1/branch/$(arch)/RPMS.classic/netpipes-4.2-alt1.$(arch).rpm ) INSTALLEXTRADEPS=( 'pushd /tmp; wget -t3 http://download.bittornado.com/download/BitTornado-0.3.18.tar.gz && tar xvzf BitTornado-0.3.18.tar.gz && cd BitTornado-CVS && python setup.py install && ln -fs btlaunchmany.py /usr/bin/btlaunchmany && ln -fs bttrack.py /usr/bin/bttrack; popd' ) INSTALLPKG="yum install -y libstdc++ libstdc++.i686" CHECKPKG="rpm -q --quiet \$package" @@ -786,11 +788,11 @@ EOF ##################################################################### -####### Funciones para el manejo de Subversion +####### Funciones para la descarga de código ##################################################################### -# Obtiene el código fuente del proyecto desde el servidor SVN. -function svnExportCode() +# Obtiene el código fuente del proyecto desde el repositorio de GitHub. +function downloadCode() { if [ $# -ne 1 ]; then errorAndLog "${FUNCNAME}(): invalid number of parameters" @@ -799,14 +801,15 @@ function svnExportCode() local url="$1" - echoAndLog "${FUNCNAME}(): downloading subversion code..." + echoAndLog "${FUNCNAME}(): downloading code..." - svn export --force "$url" opengnsys + curl "${url}" -o opengnsys.zip && unzip opengnsys.zip && mv "OpenGnsys-$BRANCH" opengnsys if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): error getting OpenGnsys code from $url" return 1 fi - echoAndLog "${FUNCNAME}(): subversion code downloaded" + rm -f opengnsys.zip + echoAndLog "${FUNCNAME}(): code was downloaded" return 0 } @@ -1073,7 +1076,6 @@ function installWebFiles() errorAndLog "${FUNCNAME}(): Error copying web files." exit 1 fi - find $INSTALL_TARGET/www -name .svn -type d -exec rm -fr {} \; 2>/dev/null # Descomprimir librerías: Slim y Swagger-UI. unzip -o $WORKDIR/opengnsys/admin/$SLIMFILE -d $INSTALL_TARGET/www/rest @@ -1202,7 +1204,7 @@ function createDirs() echoAndLog "${FUNCNAME}(): creating directory paths in $path_opengnsys_base" mkdir -p $path_opengnsys_base mkdir -p $path_opengnsys_base/bin - mkdir -p $path_opengnsys_base/client + mkdir -p $path_opengnsys_base/client/{images,log} mkdir -p $path_opengnsys_base/doc mkdir -p $path_opengnsys_base/etc mkdir -p $path_opengnsys_base/lib @@ -1397,7 +1399,6 @@ function copyClientFiles() errorAndLog "${FUNCNAME}(): error while copying client estructure" errstatus=1 fi - find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null echoAndLog "${FUNCNAME}(): Copying OpenGnsys Cloning Engine files." mkdir -p $INSTALL_TARGET/client/lib/engine/bin @@ -1557,8 +1558,8 @@ function installationSummary() [ -f $VERSIONFILE ] || echo "OpenGnsys Server" >$VERSIONFILE # Incluir datos de revisión, si se está instaladno desde el repositorio # de código o si no está incluida en el fichero de versión. - if [ $USESVN -eq 1 ] || [ -z "$(awk '$3~/r[0-9]*/ {print}' $VERSIONFILE)" ]; then - local REVISION=$(LANG=C svn info $SVN_URL|awk '/Rev:/ {print "r"$4}') + if [ $REMOTE -eq 1 ] || [ -z "$(awk '$3~/r[0-9]*/ {print}' $VERSIONFILE)" ]; then + local REVISION=$(curl -s "$API_URL" | jq -r ".commit.commit.committer.date" | awk '{gsub(/[^0-9]/,""); print}') sed -ri "s/($| r[0-9]*)/ $REVISION/" $VERSIONFILE fi @@ -1656,10 +1657,10 @@ if [ $? -ne 0 ]; then fi # Si es necesario, descarga el repositorio de código en directorio temporal -if [ $USESVN -eq 1 ]; then - svnExportCode $SVN_URL +if [ $REMOTE -eq 1 ]; then + downloadCode $CODE_URL if [ $? -ne 0 ]; then - errorAndLog "Error while getting code from svn" + errorAndLog "Error while getting code from the repository" exit 1 fi else diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index 212501db..63512336 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -64,16 +64,19 @@ if [ -z "$OPENGNSYS_DATABASE" -o -z "$OPENGNSYS_DBUSER" -o -z "$OPENGNSYS_DBPASS exit 1 fi -# Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). +# Comprobar si se ha descargado el paquete comprimido (REMOTE=0) o sólo el instalador (REMOTE=1). PROGRAMDIR=$(readlink -e $(dirname "$0")) PROGRAMNAME=$(basename "$0") OPENGNSYS_SERVER="opengnsys.es" if [ -d "$PROGRAMDIR/../installer" ]; then - USESVN=0 + REMOTE=0 else - USESVN=1 + REMOTE=1 fi -SVN_URL="https://$OPENGNSYS_SERVER/svn/branches/version1.1/" +BRANCH="devel" +CODE_URL="https://codeload.github.com/opengnsys/OpenGnsys/zip/$BRANCH" +API_URL="https://api.github.com/repos/opengnsys/OpenGnsys/branches/$BRANCH" +RAW_URL="https://raw.githubusercontent.com/opengnsys/OpenGnsys/$BRANCH" WORKDIR=/tmp/opengnsys_update mkdir -p $WORKDIR @@ -113,7 +116,7 @@ function autoConfigure() # Configuración según la distribución de Linux. if [ -f /etc/debian_version ]; then - # Distribución basada en paquetes Deb. + # Distribución basada en paquetes Deb. DEPENDENCIES=( curl rsync btrfs-tools procps arp-scan realpath php-curl gettext moreutils jq wakeonlan udpcast ) UPDATEPKGLIST="add-apt-repository -y ppa:ondrej/php; apt-get update" INSTALLPKGS="apt-get -y install" @@ -133,7 +136,7 @@ function autoConfigure() APACHEGROUP="www-data" INETDCFGDIR=/etc/xinetd.d elif [ -f /etc/redhat-release ]; then - # Distribución basada en paquetes rpm. + # Distribución basada en paquetes rpm. DEPENDENCIES=( curl rsync btrfs-progs procps-ng arp-scan gettext moreutils jq net-tools ) # En CentOS 7 instalar arp-scan de CentOS 6. [ "$OSDISTRIB$OSVERSION" == "centos7" ] && DEPENDENCIES=( ${DEPENDENCIES[*]/arp-scan/http://dag.wieers.com/redhat/el6/en/$(arch)/dag/RPMS/arp-scan-1.9-1.el6.rf.$(arch).rpm} ) @@ -174,8 +177,8 @@ function checkAutoUpdate() local update=0 # Actaulizar el script si ha cambiado o no existe el original. - if [ $USESVN -eq 1 ]; then - svn export $SVN_URL/installer/$PROGRAMNAME + if [ $REMOTE -eq 1 ]; then + curl -s $RAW_URL/installer/$PROGRAMNAME -o $PROGRAMNAME if ! diff -q $PROGRAMNAME $INSTALL_TARGET/lib/$PROGRAMNAME 2>/dev/null || ! test -f $INSTALL_TARGET/lib/$PROGRAMNAME; then mv $PROGRAMNAME $INSTALL_TARGET/lib update=1 @@ -394,10 +397,10 @@ function installDependencies() ##################################################################### -####### Funciones para el manejo de Subversion +####### Funciones para descargar código ##################################################################### -function svnExportCode() +function downloadCode() { if [ $# -ne 1 ]; then errorAndLog "${FUNCNAME}(): invalid number of parameters" @@ -406,14 +409,15 @@ function svnExportCode() local url="$1" - echoAndLog "${FUNCNAME}(): downloading subversion code..." + echoAndLog "${FUNCNAME}(): downloading code..." - svn checkout "${url}" opengnsys + curl "${url}" -o opengnsys.zip && unzip opengnsys.zip && mv "OpenGnsys-$BRANCH" opengnsys if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): error getting code from ${url}, verify your user and password" return 1 fi - echoAndLog "${FUNCNAME}(): subversion code downloaded" + rm -f opengnsys.zip + echoAndLog "${FUNCNAME}(): code was downloaded" return 0 } @@ -426,7 +430,14 @@ function svnExportCode() function checkNetworkConnection() { OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"opengnsys.es"} - wget --spider -q $OPENGNSYS_SERVER + if which curl &>/dev/null; then + curl --connect-timeout 10 -s $OPENGNSYS_SERVER -o /dev/null + elif which wget &>/dev/null; then + wget --spider -q $OPENGNSYS_SERVER + else + echoAndLog "${FUNCNAME}(): Cannot execute \"wget\" nor \"curl\"." + return 1 + fi } # Comprobar si la versión es anterior a la actual. @@ -436,8 +447,8 @@ function checkVersion() # Obtener versión actual y versión a actualizar. OLDVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null) - if [ $USESVN -eq 1 ]; then - NEWVERSION=$(curl -s $SVN_URL/doc/VERSION.txt 2>/dev/null | awk '{print $2}') + if [ $REMOTE -eq 1 ]; then + NEWVERSION=$(curl -s $RAW_URL/doc/VERSION.txt 2>/dev/null | awk '{print $2}') else NEWVERSION=$(awk '{print $2}' $PROGRAMDIR/doc/VERSION.txt 2>/dev/null) fi @@ -480,16 +491,15 @@ function updateClientFiles() # Actualizar ficheros del cliente. backupFile $ENGINECFG echoAndLog "${FUNCNAME}(): Updating OpenGnsys Client files" - rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/shared/* $INSTALL_TARGET/client + rsync -irplt $WORKDIR/opengnsys/client/shared/* $INSTALL_TARGET/client if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): error while updating client structure" exit 1 fi - find $INSTALL_TARGET/client -name .svn -type d -exec rm -fr {} \; 2>/dev/null # Actualizar librerías del motor de clonación. echoAndLog "${FUNCNAME}(): Updating OpenGnsys Cloning Engine files" - rsync --exclude .svn -irplt $WORKDIR/opengnsys/client/engine/*.lib* $INSTALL_TARGET/client/lib/engine/bin + rsync -irplt $WORKDIR/opengnsys/client/engine/*.lib* $INSTALL_TARGET/client/lib/engine/bin if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): error while updating engine files" exit 1 @@ -604,7 +614,7 @@ function updateWebFiles() # Copiar los ficheros nuevos conservando el archivo de configuración de acceso. backupFile $INSTALL_TARGET/www/controlacceso.php mv $INSTALL_TARGET/www $INSTALL_TARGET/WebConsole - rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/WebConsole $INSTALL_TARGET + rsync -irplt $WORKDIR/opengnsys/admin/WebConsole $INSTALL_TARGET ERRCODE=$? mv $INSTALL_TARGET/WebConsole $INSTALL_TARGET/www rm -fr $INSTALL_TARGET/www/xajax @@ -649,7 +659,7 @@ function updateDownloadableFiles() mv $PROGRAMDIR/$FILENAME $TARGETFILE else echoAndLog "${FUNCNAME}(): Downloading $FILENAME" - wget $DOWNLOADURL/$FILENAME -O $TARGETFILE + curl $DOWNLOADURL/$FILENAME -o $TARGETFILE fi if [ ! -s $TARGETFILE ]; then errorAndLog "${FUNCNAME}(): Cannot download $FILENAME" @@ -660,7 +670,7 @@ function updateDownloadableFiles() tar xvzf $TARGETFILE -C $INSTALL_TARGET/www/descargas if [ $? != 0 ]; then errorAndLog "${FUNCNAME}(): Error uncompressing archive $FILENAME" - exit 1 + return 1 fi } @@ -672,7 +682,7 @@ function updateInterfaceAdm() # Crear carpeta y copiar Interface echoAndLog "${FUNCNAME}(): Copying Administration Interface Folder" mv $INSTALL_TARGET/client/interfaceAdm $INSTALL_TARGET/client/Interface - rsync --exclude .svn -irplt $WORKDIR/opengnsys/admin/Interface $INSTALL_TARGET/client + rsync -irplt $WORKDIR/opengnsys/admin/Interface $INSTALL_TARGET/client errcoce=$? mv $INSTALL_TARGET/client/Interface $INSTALL_TARGET/client/interfaceAdm if [ $errcode -ne 0 ]; then @@ -829,7 +839,7 @@ function updateServerFiles() local i for (( i = 0; i < ${#SOURCES[@]}; i++ )); do if [ -d "$INSTALL_TARGET/${TARGETS[i]}" ]; then - rsync --exclude .svn -irplt "${SOURCES[i]}" $(dirname $(readlink -e "$INSTALL_TARGET/${TARGETS[i]}")) + rsync -irplt "${SOURCES[i]}" $(dirname $(readlink -e "$INSTALL_TARGET/${TARGETS[i]}")) else rsync -irplt "${SOURCES[i]}" $(readlink -m "$INSTALL_TARGET/${TARGETS[i]}") fi @@ -962,7 +972,7 @@ function updateClient() oglivecli convert fi # Comprobar si debe actualizarse el cliente. - SOURCELENGTH=$(LANG=C wget --spider $SOURCEFILE 2>&1 | awk '/Length:/ {print $2}') + SOURCELENGTH=$(curl -sI $SOURCEFILE 2>&1 | awk '/Content-Length:/ {print $2}') TARGETLENGTH=$(stat -c "%s" $TARGETFILE 2>/dev/null) [ -z $TARGETLENGTH ] && TARGETLENGTH=0 if [ "$SOURCELENGTH" != "$TARGETLENGTH" ]; then @@ -1017,8 +1027,9 @@ function checkFiles() function updateSummary() { # Actualizar fichero de versión y revisión. - local VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt" - local REVISION=$(LANG=C svn info $SVN_URL|awk '/Rev:/ {print "r"$4}') + local VERSIONFILE REVISION + VERSIONFILE="$INSTALL_TARGET/doc/VERSION.txt" + REVISION=$(curl -s "$API_URL" | jq -r ".commit.commit.committer.date" | awk '{gsub(/[^0-9]/,""); print}') [ -f $VERSIONFILE ] || echo "OpenGnsys" >$VERSIONFILE perl -pi -e "s/($| r[0-9]*)/ $REVISION/" $VERSIONFILE @@ -1112,10 +1123,10 @@ if [ $? -ne 0 ]; then fi # Si es necesario, descarga el repositorio de código en directorio temporal -if [ $USESVN -eq 1 ]; then - svnExportCode $SVN_URL +if [ $REMOTE -eq 1 ]; then + downloadCode $CODE_URL if [ $? -ne 0 ]; then - errorAndLog "Error while getting code from svn server" + errorAndLog "Error while getting code from repository" exit 1 fi else diff --git a/installer/vagrant/README.es.txt b/installer/vagrant/README.es.txt index ce40f709..6f300afe 100644 --- a/installer/vagrant/README.es.txt +++ b/installer/vagrant/README.es.txt @@ -5,7 +5,7 @@ Preparar entorno virtual de desarrollo para OpenGnsys Ficheros de configuración disponibles: - - Vagrantfile-trunk-vbox Vagrantfile para OpenGnsys estable con proveedor VirtualBox. + - Vagrantfile-prod-vbox Vagrantfile para OpenGnsys estable con proveedor VirtualBox. - Vagrantfile-devel-vbox Vagrantfile para OpenGnsys en desarrollo con proveedor VirtualBox. - Vagrantfile-boottools-vbox Vagrantfile para preparar el entorno de generación del cliente ogLive (recomendado solo para desarrolladores experimentados). - Vagrantfile-browser-vbox Vagrantfile para preparar el entorno de desarrollo del Browser del cliente (recomendado solo para miembros del grupo de desarrollo). @@ -25,7 +25,7 @@ El entorno de trabajo de OpenGnsys. - pc12 - ogclientN: MV clientes para restaurar con disco vacío. -Ejecutar el entorno virtual (Vagrantfile-trunk-vbox y Vagrantfile-devel-vbox). +Ejecutar el entorno virtual (Vagrantfile-prod-vbox y Vagrantfile-devel-vbox). - Crear un directorio de trabajo. - Copiar el fichero Vagrantfile-...-vbox correspondiente en dicho directorio como Vagrantfile. diff --git a/installer/vagrant/Vagrantfile-devel-vbox b/installer/vagrant/Vagrantfile-devel-vbox index c8eb022f..4d41afd0 100644 --- a/installer/vagrant/Vagrantfile-devel-vbox +++ b/installer/vagrant/Vagrantfile-devel-vbox @@ -1,4 +1,4 @@ -# Vagrantfile to install OpenGnsys 1.1 virtual environment using VirtualBox provider. +# Vagrantfile to install OpenGnsys virtual environment (development version) using VirtualBox provider. VAGRANTFILE_API_VERSION = "2" # VM provider: Oracle VM VirtualBox. @@ -38,7 +38,7 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -wget -q https://opengnsys.es/svn/branches/version1.1/installer/opengnsys_installer.sh -O - | bash || exit $? +curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/devel/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -94,7 +94,7 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#wget -q --no-check-certificate https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} #if [ -f #{OGAGENTPKG} ]; then # dpkg -i #{OGAGENTPKG} # apt-get install -fy || exit $? diff --git a/installer/vagrant/Vagrantfile-trunk-vbox b/installer/vagrant/Vagrantfile-prod-vbox index 75dbcd11..813ee962 100644 --- a/installer/vagrant/Vagrantfile-trunk-vbox +++ b/installer/vagrant/Vagrantfile-prod-vbox @@ -1,4 +1,4 @@ -# Vagrantfile to install OpenGnsys Trunk (v1.1.0) virtual environment using VirtualBox provider. +# Vagrantfile to install OpenGnsys virtual environment (production version) using VirtualBox provider. VAGRANTFILE_API_VERSION = "2" # VM provider: Oracle VM VirtualBox. @@ -38,7 +38,7 @@ if [ -z "$(blkid /dev/mapper/og-images | grep ext4)" ]; then mount -a fi # Install OpenGnsys and change server address. -wget -q https://opengnsys.es/svn/trunk/installer/opengnsys_installer.sh -O - | bash || exit $? +curl -s https://raw.githubusercontent.com/opengnsys/OpenGnsys/master/installer/opengnsys_installer.sh | bash || exit $? mv /opt/opengnsys/log/bash.log /opt/opengnsys/log/opengnsys_installer.log echo y | /opt/opengnsys/bin/setserveraddr enp0s8 # Insert DHCP data. @@ -73,7 +73,7 @@ OGAGENTPKG = "ogagent_1.1.0_all.deb" MODELSCRIPT = <<EOT # Comment out next lines to install and configure OGAgent for Ubuntu. #apt-get update -y -#wget -q --no-check-certificate https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} +#curl -ks https://#{SERVERIP}/opengnsys/descargas/#{OGAGENTPKG} -o #{OGAGENTPKG} #if [ -f #{OGAGENTPKG} ]; then # dpkg -i #{OGAGENTPKG} # apt-get install -fy || exit $? |