Skip to content

Commit

Permalink
20150819
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Dainese committed Aug 19, 2015
1 parent f2c065d commit f13affd
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0-65
0.9.0-67
2 changes: 1 addition & 1 deletion debian/unetlab_control.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Homepage: http://www.unetlab.com/
Installed-Size: 9912
Section: devel
Priority: optional
Depends: apache2, bridge-utils, cpulimit, dialog, dmidecode, lib32gcc1, lib32z1, libapache2-mod-php5, libc6, libc6-i386, libelf1, libpcap0.8, libsdl1.2debian, linux-headers-3.16.7-ckt8-unetlab, linux-image-3.16.7-ckt8-unetlab, logrotate, lvm2, openvswitch-controller, openvswitch-switch, php5, php5-cli, php5-imagick, php5-sqlite, plymouth-label, uml-utilities, unetlab-dynamips, unetlab-qemu, tcpdump, zip
Depends: apache2, bridge-utils, cpulimit, dialog, dmidecode, lib32gcc1, lib32z1, libapache2-mod-php5, libc6, libc6-i386, libelf1, libpcap0.8, libsdl1.2debian, linux-headers-3.16.7-ckt8-unetlab, linux-image-3.16.7-ckt8-unetlab, logrotate, lvm2, openvswitch-controller, openvswitch-switch, php5, php5-cli, php5-imagick, php5-sqlite, plymouth-label, uml-utilities, unetlab-dynamips (>= 0.8.6-44), unetlab-qemu (>= 0.9.0-66), tcpdump, zip
Description: A new generation software for networking labs.
UNetLab is a new generation software for networking lab. It can be considered the next major version of iou-web, but the software has been rewritten from scratch. The major advantage over GNS3 and iou-web itself is about multi-hypervisor support within a single entity. UNetLab allows to design labs using IOU, Dynamips and QEMU nodes without dealing with multi virtual machines: everything run inside a UNetLab host, and a lab is a single file including all information needed.
9 changes: 8 additions & 1 deletion html/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
$app -> response -> headers -> set('Cache-Control', 'post-check=0, pre-check=0');
$app -> response -> headers -> set('Pragma', 'no-cache');

$app -> notFound(function() use ($app) {
$output['code'] = 404;
$output['status'] = 'fail';
$output['message'] = $GLOBALS['messages']['60038'];
$app -> halt($output['code'], json_encode($output));
});


class ResourceNotFoundException extends Exception {}
class AuthenticateFailedException extends Exception {}

Expand Down Expand Up @@ -680,7 +688,6 @@ class AuthenticateFailedException extends Exception {}
foreach ($_FILES as $file) {
$p['name'] = $file['name'];
$p['file'] = $file['tmp_name'];
$p['type'] = $file['type'];
$p['error'] = $file['name'];
}
}
Expand Down
5 changes: 3 additions & 2 deletions html/includes/api_labs.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function apiExportLabs($p) {

// Using "element" relative to "path", adding '/' if missing
$relement = substr($element, strlen($p['path']));
if (substr($relement, 1) != '/') {
if (!strcmp(substr($relement, 1), '/')) {
$relement = '/'.$relement;
}

Expand Down Expand Up @@ -364,7 +364,8 @@ function apiImportLabs($p) {
return $output;
}

if (!isset($p['type']) || $p['type'] != 'application/zip') {
$finfo = new finfo(FILEINFO_MIME);
if (!strcmp($finfo -> file($p['file']), 'application/zip')) {
// File is not a Zip
$output['code'] = 400;
$output['status'] = 'fail';
Expand Down
2 changes: 1 addition & 1 deletion html/includes/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
'mikrotik' => 'MikroTik RouterOS',
'paloalto' => 'Palo Alto VM-100 Firewall',
'vyos' => 'VyOS',
'esxi' => 'VMware ESXi',
//'esxi' => 'VMware ESXi',
'win' => 'Windows'
);
}
Expand Down
1 change: 1 addition & 0 deletions html/includes/messages_en.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
$messages[60035] = 'Lab moved (60035).';
$messages[60036] = 'Lab cloned (60036).';
$messages[60037] = 'Failed to clone the lab (60037).';
$messages[60038] = 'Resource not found (60038).';

// Text (70000-79999)
$messages[70000] = 'Name/prefix';
Expand Down
1 change: 0 additions & 1 deletion html/templates/win.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,5 @@
$p['ethernet'] = 1;
$p['console'] = 'vnc';
$p['qemu_arch'] = 'x86_64';
$p['qemu_version'] = '2.0.2';
$p['qemu_options'] = '-machine type=pc-1.0,accel=kvm -vga std -usbdevice tablet -boot order=dc';
?>
2 changes: 1 addition & 1 deletion html/themes/default/js/new-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ $(document).on('click', 'a.folder-rename', function(e) {

// Display import form
$(document).on('click', 'a.import', function(e) {
var html = '<form id="form-import" class="form-horizontal form-import"><div class="form-group"><label class="col-md-3 control-label">Path</label><div class="col-md-5"><input class="form-control" name="import[path]" value="' + $('#list-folders').attr('data-path') + '" disabled="" type="text"/></div></div><div class="form-group"><label class="col-md-3 control-label">File</label><div class="col-md-5"><span class="btn btn-default btn-file btn-aqua">Browse <input class="form-control" name="import[file]" value="" type="file"></span></div></div><div class="form-group"><div class="col-md-5 col-md-offset-3"><button type="submit" class="btn btn-aqua">Import</button> <button type="button" class="btn btn-grey" data-dismiss="modal">Cancel</button></div></div></form>';
var html = '<form id="form-import" class="form-horizontal form-import"><div class="form-group"><label class="col-md-3 control-label">Path</label><div class="col-md-7"><input class="form-control" name="import[path]" value="' + $('#list-folders').attr('data-path') + '" disabled="" type="text"/></div></div><div class="form-group"><label class="col-md-3 control-label">File</label><div class="col-md-7"><span class="btn btn-default btn-file btn-aqua">Browse <input class="form-control" name="import[file]" value="" type="file"></span></div></div><div class="form-group"><div class="col-md-7 col-md-offset-3"><button type="submit" class="btn btn-aqua">Import</button> <button type="button" class="btn btn-grey" data-dismiss="modal">Cancel</button></div></div></form>';
logger(1, 'DEBUG: popping up the import form.');
addModal('Import labs', html, '');
validateImport();
Expand Down
2 changes: 1 addition & 1 deletion html/themes/default/js/new-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function getJsonMessage(response) {
if (response != '') {
message = response;
} else {
message = 'Undefined message, check if the UNetLab VM is powered on. If it is, see logs under "/opt/unetlab/data/Logs/".';
message = 'Undefined message, check if the UNetLab VM is powered on. If it is, see <a href="/Logs" target="_blank">logs</a>.';
}
}
return message;
Expand Down
1 change: 0 additions & 1 deletion html/themes/default/js/new-javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ $(document).ready(function() {
var ATTACHMENTS;
$('body').on('change', 'input[type=file]', function(e) {
ATTACHMENTS = e.target.files;
console.log(ATTACHMENTS);
});
1 change: 0 additions & 1 deletion html/themes/default/js/new-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ $.validator.addMethod('integer', function(value) {

// Validate a lab name
$.validator.addMethod('lab_name', function(value) {
console.log(value);
return /^[A-Za-z0-9_\-\s]+$/.test(value);
}, 'Use only [A-Za-z0-9_- ] chars.');

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_deb_unetlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ rm -f /opt/unetlab/data/Exports/*
# Mark official kernels as hold
apt-mark hold \$(dpkg -l | grep -e linux-image -e linux-headers -e linux-generic | grep -v unetlab | awk '{print \$2}') > /dev/null 2>&1
# Setting UUID on labs
find /opt/unetlab/labs/ -name "*.unl" -exec /opt/unetlab/scripts/set_uuid.php "{}" \;
find /opt/unetlab/labs/ -name "*.unl" -printf 'Updating lab: %p\n' -exec /opt/unetlab/scripts/set_uuid.php "{}" \;
find /opt/unetlab/tmp/ -name "nvram_*" -exec /opt/unetlab/scripts/fix_iol_nvram.sh "{}" \;
EOF

Expand Down
2 changes: 1 addition & 1 deletion windows/wireshark_wrapper.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ IF "%INT%" == "pnet0" SET FILTER=" not port 22"

ECHO "Connecting to %USERNAME%@%HOST%..."

"C:\Program Files\UNetLab\plink.exe" -ssh -pw %PASSWORD% %USERNAME%@%HOST% "tcpdump -i %INT% -s0 -w -%FILTER%" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i -
"C:\Program Files\UNetLab\plink.exe" -ssh -pw %PASSWORD% %USERNAME%@%HOST% "tcpdump -l -u -i %INT% -s 0 -w -%FILTER%" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i -

0 comments on commit f13affd

Please sign in to comment.