mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
- Update to an unofficial 5.1-1 which supports VirtualBox 5.1
Sadly upstream is very silent and has not released a new version which supports VirtualBox 5.1, supports PHP 7.1 or fixes bugs. In the meantime the community has created patches which are collected in the github projects bugtracker and pull requests. This unofficial version cherry picks the useful stuff of it. Highlights of unofficial phpvirtualbox 5.1-1: * based on git commit 65ebced (latest commit from May 19, 2016) * Patch to support Virtualbox 5.1 https://github.com/phpvirtualbox/phpvirtualbox/pull/22 * Fix argument count mismatches revealed by PHP 7.1 https://github.com/phpvirtualbox/phpvirtualbox/pull/24 * Make decryption of images/VMs work by not providing a password ID https://github.com/phpvirtualbox/phpvirtualbox/pull/55 * Tried to make clearOnSuspend work https://github.com/phpvirtualbox/phpvirtualbox/pull/57 PR: ports/220171 Submitted By: rozhuk.im With hat: vbox@ (kind of)
This commit is contained in:
parent
bde0d881b9
commit
4e72deff05
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=446746
@ -2,9 +2,8 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= phpvirtualbox
|
||||
DISTVERSION= 5.0-5
|
||||
DISTVERSION= 5.1-1
|
||||
CATEGORIES= www
|
||||
MASTER_SITES= SF/${PORTNAME}
|
||||
|
||||
MAINTAINER= vbox@FreeBSD.org
|
||||
COMMENT= AJAX Web Interface for VirtualBox
|
||||
@ -13,12 +12,19 @@ LICENSE= GPLv3
|
||||
|
||||
NO_ARCH= yes
|
||||
NO_BUILD= yes
|
||||
USES= dos2unix php
|
||||
USE_PHP= json session simplexml soap xml
|
||||
USES= dos2unix php zip
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_TAGNAME= 65ebced
|
||||
|
||||
DOS2UNIX_REGEX= .*\.(php|txt|js|css|html)
|
||||
ETCDIR= ${WWWDIR}
|
||||
|
||||
post-patch:
|
||||
@${MV} ${WRKSRC}/endpoints/lib/vboxweb-5.0.wsdl ${WRKSRC}/endpoints/lib/vboxweb-5.1.wsdl
|
||||
@${MV} ${WRKSRC}/endpoints/lib/vboxwebService-5.0.wsdl ${WRKSRC}/endpoints/lib/vboxwebService-5.1.wsdl
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${STAGEDIR}${WWWDIR}
|
||||
(cd ${WRKSRC}/ && ${COPYTREE_SHARE} "*" ${STAGEDIR}${WWWDIR} \
|
||||
|
@ -1,2 +1,3 @@
|
||||
SHA256 (phpvirtualbox-5.0-5.zip) = c80c423fda30e5795872c9b9adc68429deee5726e468729472a573c324303c05
|
||||
SIZE (phpvirtualbox-5.0-5.zip) = 4093766
|
||||
TIMESTAMP = 1501174865
|
||||
SHA256 (phpvirtualbox-phpvirtualbox-5.1-1-65ebced_GH0.tar.gz) = d7b36c84aa2cf8be650f6da74860a4af4abf17bd878590e31fd948f45ed51753
|
||||
SIZE (phpvirtualbox-phpvirtualbox-5.1-1-65ebced_GH0.tar.gz) = 3716806
|
||||
|
11
www/phpvirtualbox/files/patch-endpoints_lib_config.php
Normal file
11
www/phpvirtualbox/files/patch-endpoints_lib_config.php
Normal file
@ -0,0 +1,11 @@
|
||||
--- endpoints/lib/config.php.orig 2017-07-27 16:54:58 UTC
|
||||
+++ endpoints/lib/config.php
|
||||
@@ -14,7 +14,7 @@
|
||||
/*
|
||||
* This version of phpVirtualBox
|
||||
*/
|
||||
-define('PHPVBOX_VER', '5.0-6');
|
||||
+define('PHPVBOX_VER', '5.1-1');
|
||||
|
||||
class phpVBoxConfigClass {
|
||||
|
@ -0,0 +1,13 @@
|
||||
--- endpoints/lib/vboxServiceWrappers.php.orig 2017-07-27 16:54:58 UTC
|
||||
+++ endpoints/lib/vboxServiceWrappers.php
|
||||
@@ -7889,6 +7889,10 @@ class IMedium extends VBox_ManagedObject
|
||||
|
||||
public function changeEncryption($arg_currentPassword, $arg_cipher, $arg_newPassword, $arg_newPasswordId)
|
||||
{
|
||||
+ // No password ID in case of decryption and de-/encryption are both handled here.
|
||||
+ $isDecryption = ($arg_cipher == '') && ($arg_newPassword == '');
|
||||
+ $arg_newPasswordId = $isDecryption ? '' : $arg_newPasswordId;
|
||||
+
|
||||
$request = new stdClass();
|
||||
$request->_this = $this->handle;
|
||||
$request->currentPassword = $arg_currentPassword;
|
209
www/phpvirtualbox/files/patch-endpoints_lib_vboxconnector.php
Normal file
209
www/phpvirtualbox/files/patch-endpoints_lib_vboxconnector.php
Normal file
@ -0,0 +1,209 @@
|
||||
--- endpoints/lib/vboxconnector.php.orig 2017-07-27 16:54:58 UTC
|
||||
+++ endpoints/lib/vboxconnector.php
|
||||
@@ -1126,7 +1126,7 @@ class vboxconnector {
|
||||
// Try to register medium.
|
||||
foreach($checks as $iso) {
|
||||
try {
|
||||
- $gem = $this->vbox->openMedium($iso,'DVD','ReadOnly');
|
||||
+ $gem = $this->vbox->openMedium($iso,'DVD','ReadOnly',null);
|
||||
break;
|
||||
} catch (Exception $e) {
|
||||
// Ignore
|
||||
@@ -1358,7 +1358,7 @@ class vboxconnector {
|
||||
$src = $nsrc->machine;
|
||||
}
|
||||
/* @var $m IMachine */
|
||||
- $m = $this->vbox->createMachine($this->vbox->composeMachineFilename($args['name'],null,null),$args['name'],null,null,null,false);
|
||||
+ $m = $this->vbox->createMachine($this->vbox->composeMachineFilename($args['name'],null,null,null),$args['name'],null,null,null,false);
|
||||
$sfpath = $m->settingsFilePath;
|
||||
|
||||
/* @var $cm CloneMode */
|
||||
@@ -1522,7 +1522,7 @@ class vboxconnector {
|
||||
$md->releaseRemote();
|
||||
}
|
||||
} else {
|
||||
- $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type']);
|
||||
+ $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type'],null,null);
|
||||
}
|
||||
} else {
|
||||
$med = null;
|
||||
@@ -1591,7 +1591,7 @@ class vboxconnector {
|
||||
if($state != 'Saved') {
|
||||
|
||||
// Network properties
|
||||
- $eprops = $n->getProperties();
|
||||
+ $eprops = $n->getProperties(null);
|
||||
$eprops = array_combine($eprops[1],$eprops[0]);
|
||||
$iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
|
||||
$inprops = array();
|
||||
@@ -2028,7 +2028,7 @@ class vboxconnector {
|
||||
}
|
||||
} else {
|
||||
/* @var $med IMedium */
|
||||
- $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type']);
|
||||
+ $med = $this->vbox->openMedium($ma['medium']['location'],$ma['type'],null,null);
|
||||
}
|
||||
} else {
|
||||
$med = null;
|
||||
@@ -2111,7 +2111,7 @@ class vboxconnector {
|
||||
*/
|
||||
|
||||
// Network properties
|
||||
- $eprops = $n->getProperties();
|
||||
+ $eprops = $n->getProperties(null);
|
||||
$eprops = array_combine($eprops[1],$eprops[0]);
|
||||
$iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
|
||||
$inprops = array();
|
||||
@@ -2519,7 +2519,7 @@ class vboxconnector {
|
||||
*/
|
||||
public function remote_vboxGetEnumerationMap($args) {
|
||||
|
||||
- $c = new $args['class'];
|
||||
+ $c = new $args['class'](null,null);
|
||||
return (@isset($args['ValueMap']) ? $c->ValueMap : $c->NameMap);
|
||||
}
|
||||
|
||||
@@ -3697,7 +3697,7 @@ class vboxconnector {
|
||||
$hds = array();
|
||||
$delete = $machine->unregister('DetachAllReturnHardDisksOnly');
|
||||
foreach($delete as $hd) {
|
||||
- $hds[] = $this->vbox->openMedium($hd->location,'HardDisk')->handle;
|
||||
+ $hds[] = $this->vbox->openMedium($hd->location,'HardDisk',null,null)->handle;
|
||||
}
|
||||
|
||||
/* @var $progress IProgress */
|
||||
@@ -3772,7 +3772,7 @@ class vboxconnector {
|
||||
$args['name'] = $_SESSION['user'] . '_' . $args['name'];
|
||||
|
||||
/* Check if file exists */
|
||||
- $filename = $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder);
|
||||
+ $filename = $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder,null);
|
||||
|
||||
if($this->remote_fileExists(array('file'=>$filename))) {
|
||||
return array('exists' => $filename);
|
||||
@@ -3874,7 +3874,7 @@ class vboxconnector {
|
||||
|
||||
$sc->releaseRemote();
|
||||
|
||||
- $m = $this->vbox->openMedium($args['disk'],'HardDisk');
|
||||
+ $m = $this->vbox->openMedium($args['disk'],'HardDisk',null,null);
|
||||
|
||||
$this->session->machine->attachDevice(trans($HDbusType,'UIMachineSettingsStorage'),0,0,'HardDisk',$m->handle);
|
||||
|
||||
@@ -3941,7 +3941,7 @@ class vboxconnector {
|
||||
if($at == 'NAT') $nd = $n->NATEngine; /* @var $nd INATEngine */
|
||||
else $nd = null;
|
||||
|
||||
- $props = $n->getProperties();
|
||||
+ $props = $n->getProperties(null);
|
||||
$props = implode("\n",array_map(create_function('$a,$b','return "$a=$b";'),$props[1],$props[0]));
|
||||
|
||||
$adapters[] = array(
|
||||
@@ -4381,7 +4381,7 @@ class vboxconnector {
|
||||
}
|
||||
|
||||
try {
|
||||
- $this->session->console->addDiskEncryptionPassword($creds['id'], $creds['password'], (bool)@$args['clearOnSuspend']);
|
||||
+ $this->session->console->addDiskEncryptionPassword($creds['id'], $creds['password'], (bool)$creds['clearOnSuspend']);
|
||||
$response['accepted'][] = $creds['id'];
|
||||
} catch (Exception $e) {
|
||||
$response['failed'][] = $creds['id'];
|
||||
@@ -4690,7 +4690,7 @@ class vboxconnector {
|
||||
$machine->lockMachine($this->session->handle, ((string)$machine->sessionState == 'Unlocked' ? 'Write' : 'Shared'));
|
||||
|
||||
/* @var $progress IProgress */
|
||||
- list($progress, $snapshotId) = $this->session->machine->takeSnapshot($args['name'], $args['description']);
|
||||
+ list($progress, $snapshotId) = $this->session->machine->takeSnapshot($args['name'], $args['description'],null);
|
||||
|
||||
// Does an exception exist?
|
||||
try {
|
||||
@@ -4853,7 +4853,7 @@ class vboxconnector {
|
||||
// Connect to vboxwebsrv
|
||||
$this->connect();
|
||||
|
||||
- $m = $this->vbox->openMedium($args['medium'],'HardDisk');
|
||||
+ $m = $this->vbox->openMedium($args['medium'],'HardDisk',null,null);
|
||||
|
||||
$retval = $m->checkEncryptionPassword($args['password']);
|
||||
|
||||
@@ -4874,7 +4874,7 @@ class vboxconnector {
|
||||
// Connect to vboxwebsrv
|
||||
$this->connect();
|
||||
|
||||
- $m = $this->vbox->openMedium($args['medium'], 'HardDisk', 'ReadWrite');
|
||||
+ $m = $this->vbox->openMedium($args['medium'], 'HardDisk', 'ReadWrite',null);
|
||||
|
||||
/* @var $progress IProgress */
|
||||
$progress = $m->changeEncryption($args['old_password'],
|
||||
@@ -4915,7 +4915,7 @@ class vboxconnector {
|
||||
// Connect to vboxwebsrv
|
||||
$this->connect();
|
||||
|
||||
- $m = $this->vbox->openMedium($args['medium'], 'HardDisk');
|
||||
+ $m = $this->vbox->openMedium($args['medium'], 'HardDisk',null,null);
|
||||
|
||||
/* @var $progress IProgress */
|
||||
$progress = $m->resize($args['bytes']);
|
||||
@@ -4953,7 +4953,7 @@ class vboxconnector {
|
||||
$mid = $target->id;
|
||||
|
||||
/* @var $src IMedium */
|
||||
- $src = $this->vbox->openMedium($args['src'], 'HardDisk');
|
||||
+ $src = $this->vbox->openMedium($args['src'], 'HardDisk',null,null);
|
||||
|
||||
$type = array(($args['type'] == 'fixed' ? 'Fixed' : 'Standard'));
|
||||
if($args['split']) $type[] = 'VmdkSplit2G';
|
||||
@@ -4991,7 +4991,7 @@ class vboxconnector {
|
||||
$this->connect();
|
||||
|
||||
/* @var $m IMedium */
|
||||
- $m = $this->vbox->openMedium($args['medium'], 'HardDisk');
|
||||
+ $m = $this->vbox->openMedium($args['medium'], 'HardDisk',null,null);
|
||||
$m->type = $args['type'];
|
||||
$m->releaseRemote();
|
||||
|
||||
@@ -5074,7 +5074,7 @@ class vboxconnector {
|
||||
// Connect to vboxwebsrv
|
||||
$this->connect();
|
||||
|
||||
- return $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder);
|
||||
+ return $this->vbox->composeMachineFilename($args['name'],($this->settings->phpVboxGroups ? '' : $args['group']),$this->vbox->systemProperties->defaultMachineFolder,null);
|
||||
|
||||
}
|
||||
|
||||
@@ -5129,7 +5129,7 @@ class vboxconnector {
|
||||
$this->connect();
|
||||
|
||||
/* @var $m IMedium */
|
||||
- $m = $this->vbox->openMedium($args['medium'],$args['type']);
|
||||
+ $m = $this->vbox->openMedium($args['medium'],$args['type'],null,null);
|
||||
$mediumid = $m->id;
|
||||
|
||||
// connected to...
|
||||
@@ -5211,7 +5211,7 @@ class vboxconnector {
|
||||
if(!$args['type']) $args['type'] = 'HardDisk';
|
||||
|
||||
/* @var $m IMedium */
|
||||
- $m = $this->vbox->openMedium($args['medium'],$args['type']);
|
||||
+ $m = $this->vbox->openMedium($args['medium'],$args['type'],null,null);
|
||||
|
||||
if($args['delete'] && @$this->settings->deleteOnRemove && (string)$m->deviceType == 'HardDisk') {
|
||||
|
||||
@@ -5380,7 +5380,7 @@ class vboxconnector {
|
||||
// Normal medium
|
||||
} else {
|
||||
/* @var $med IMedium */
|
||||
- $med = $this->vbox->openMedium($args['medium']['location'],$args['medium']['deviceType']);
|
||||
+ $med = $this->vbox->openMedium($args['medium']['location'],$args['medium']['deviceType'],null,null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5445,7 +5445,7 @@ class vboxconnector {
|
||||
}
|
||||
|
||||
// For $fixed value
|
||||
- $mvenum = new MediumVariant();
|
||||
+ $mvenum = new MediumVariant(null,null);
|
||||
$variant = 0;
|
||||
|
||||
foreach($m->variant as $mv) {
|
2647
www/phpvirtualbox/files/patch-endpoints_lib_vboxweb-5.1.wsdl
Normal file
2647
www/phpvirtualbox/files/patch-endpoints_lib_vboxweb-5.1.wsdl
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,11 @@
|
||||
--- endpoints/lib/vboxwebService-5.0.wsdl 2017-07-10 13:31:02 UTC
|
||||
+++ endpoints/lib/vboxwebService-5.1.wsdl
|
||||
@@ -5,7 +5,7 @@
|
||||
Generator: src/VBox/Main/webservice/websrv-wsdl-service.xsl
|
||||
-->
|
||||
<definitions xmlns:interface="urn:vbox" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:vbox="http://www.virtualbox.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="VirtualBox" targetNamespace="http://www.virtualbox.org/Service">
|
||||
- <import location="vboxweb-5.0.wsdl" namespace="http://www.virtualbox.org/"/>
|
||||
+ <import location="vboxweb-5.1.wsdl" namespace="http://www.virtualbox.org/"/>
|
||||
<service name="vboxService">
|
||||
<port binding="vbox:vboxBinding" name="vboxServicePort">
|
||||
<soap:address location="http://localhost:18083/"/>
|
@ -0,0 +1,41 @@
|
||||
--- panes/mediumEncryptionPasswords.html.orig 2017-07-27 16:54:58 UTC
|
||||
+++ panes/mediumEncryptionPasswords.html
|
||||
@@ -15,6 +15,7 @@
|
||||
<th class='translate' style='width:1%; text-align:center'>Status</th>
|
||||
<th class='translate' style='width:30%; text-align:center'>ID</th>
|
||||
<th class='translate'>Password</th>
|
||||
+ <th class='translate'>Clear on suspend</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='vboxMediumEncryptionPasswordList'>
|
||||
@@ -37,9 +38,12 @@ function vboxMediumEncryptionPasswordAdd
|
||||
.append($('<td />')
|
||||
.append(
|
||||
valid ? '*****' :
|
||||
- $('<input />').attr({'type':'password','style':'width:95%'}).addClass('vboxText')
|
||||
+ $('<input />').attr({'type':'password','style':'width:90%'}).addClass('vboxText')
|
||||
)
|
||||
)
|
||||
+ .append($('<td />')
|
||||
+ .append($('<input />').attr({'type':'checkbox', 'checked':'checked'}))
|
||||
+ )
|
||||
.appendTo($('#vboxMediumEncryptionPasswordList'))
|
||||
}
|
||||
|
||||
@@ -55,7 +59,8 @@ function vboxMediumEncryptionPasswordsGe
|
||||
continue;
|
||||
encryptionPWs.push({
|
||||
'id': $(rowlist[i]).data('vboxEncryptionId'),
|
||||
- 'password': $(rowlist[i]).find('input').first().val()
|
||||
+ 'password': $(rowlist[i]).find('input[type="password"]').first().val(),
|
||||
+ 'clearOnSuspend': $(rowlist[i]).find('input[type="checkbox"]').first().is(':checked') ? '1' : '0'
|
||||
});
|
||||
|
||||
}
|
||||
@@ -75,4 +80,4 @@ function vboxMediumEncryptionPasswordsVa
|
||||
});
|
||||
return valid;
|
||||
}
|
||||
-</script>
|
||||
\ No newline at end of file
|
||||
+</script>
|
@ -1,9 +1,9 @@
|
||||
@group www
|
||||
@owner www
|
||||
%%WWWDIR%%/CHANGELOG.txt
|
||||
%%WWWDIR%%/Dockerfile
|
||||
%%WWWDIR%%/GPLv3.txt
|
||||
%%WWWDIR%%/LICENSE.txt
|
||||
%%WWWDIR%%/Dockerfile
|
||||
%%WWWDIR%%/README.md
|
||||
@sample %%ETCDIR%%/config.php.sample
|
||||
%%WWWDIR%%/css/jquery-ui.css
|
||||
@ -19,6 +19,7 @@
|
||||
%%WWWDIR%%/endpoints/lib/auth/ActiveDirectory.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/Builtin.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/LDAP.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/MySQL.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/OpenMediaVault.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/WebAuth.php
|
||||
%%WWWDIR%%/endpoints/lib/auth/index.html
|
||||
@ -29,8 +30,8 @@
|
||||
%%WWWDIR%%/endpoints/lib/utils.php
|
||||
%%WWWDIR%%/endpoints/lib/vboxServiceWrappers.php
|
||||
%%WWWDIR%%/endpoints/lib/vboxconnector.php
|
||||
%%WWWDIR%%/endpoints/lib/vboxweb-5.0.wsdl
|
||||
%%WWWDIR%%/endpoints/lib/vboxwebService-5.0.wsdl
|
||||
%%WWWDIR%%/endpoints/lib/vboxweb-5.1.wsdl
|
||||
%%WWWDIR%%/endpoints/lib/vboxwebService-5.1.wsdl
|
||||
%%WWWDIR%%/endpoints/rdp.php
|
||||
%%WWWDIR%%/endpoints/screen.php
|
||||
%%WWWDIR%%/images/30white.png
|
||||
|
Loading…
Reference in New Issue
Block a user