diff --git a/Dockerfile b/Dockerfile index 955c1aa..c84afa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ wget unzip php5-cli # install phpvirtualbox -RUN wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-1.zip/download -O phpvirtualbox-4.3-1.zip -RUN unzip phpvirtualbox-4.3-1.zip -RUN mv phpvirtualbox-4.3-1 /var/www +RUN wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-3.zip/download -O phpvirtualbox-4.3-3.zip +RUN unzip phpvirtualbox-4.3-3.zip +RUN mv phpvirtualbox-4.3-3 /var/www ADD config.php /var/www/config.php RUN chown www-data:www-data -R /var/www diff --git a/README.md b/README.md index ae2e4e5..93db3c6 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ To establish an encrypted SSH connection it will likely ask for your password fo > supplying ENV variables instead. You can also pass a visual name like this: > > ```bash -> -e VB3_PORT_18083_TCP=10.1.1.4:18083 -e VB3_NAME=MyServer +> -e VB3_PORT_18083_TCP=10.1.1.4:18083 -e VB3_NAME=MyServer -e VB3_USER=VirtualBoxUserName -e VB3_PASSWORD=VirtualBoxUserPassword > ``` Now that all `vboxwebsrv` instance are up, we can link everything together and start our actual phpVirtualBox container. diff --git a/servers-from-env.php b/servers-from-env.php index 006428f..020eb60 100644 --- a/servers-from-env.php +++ b/servers-from-env.php @@ -12,6 +12,9 @@ // actual readable name is stored as "/thiscontainer/givencontainer" $name = getenv($prefix . '_NAME'); + $user = getenv($prefix . '_USER'); + $pass = getenv($prefix . '_PASSWORD'); + $pos = strrpos($name, '/'); if ($pos !== false) { $name = substr($name, $pos + 1); @@ -27,8 +30,8 @@ $servers []= array( 'name' => $name, - 'username' => 'username', - 'password' => 'password', + 'username' => false === $user ? 'username' : $user, + 'password' => false === $pass ? 'password' : $pass, 'authMaster' => true, 'location' => $location );