Please provide the file changes (diffs) for me to generate a commit message.
This commit is contained in:
+8
-1
@@ -1 +1,8 @@
|
|||||||
.idea
|
.idea
|
||||||
|
/mock/
|
||||||
|
/bin/
|
||||||
|
/releases/
|
||||||
|
/jails/
|
||||||
|
/router.php
|
||||||
|
/debug_vars.php
|
||||||
|
/conf/bastille_config
|
||||||
@@ -46,8 +46,18 @@ $prdname = "bastille";
|
|||||||
$application = "Bastille Manager";
|
$application = "Bastille Manager";
|
||||||
$restore_name = "restore";
|
$restore_name = "restore";
|
||||||
$confdir = "/var/etc/bastille_conf";
|
$confdir = "/var/etc/bastille_conf";
|
||||||
$cwdir = exec("/usr/bin/grep 'INSTALL_DIR=' $confdir/conf/bastille_config | /usr/bin/cut -d'\"' -f2");
|
|
||||||
$rootfolder = $cwdir;
|
// Check for configuration file
|
||||||
|
$conf_file = "$confdir/conf/bastille_config";
|
||||||
|
if (!file_exists($conf_file) && file_exists(__DIR__ . "/../conf/bastille_config")) {
|
||||||
|
$conf_file = __DIR__ . "/../conf/bastille_config";
|
||||||
|
}
|
||||||
|
|
||||||
|
$cwdir = exec("/usr/bin/grep 'INSTALL_DIR=' $conf_file | /usr/bin/cut -d'\"' -f2");
|
||||||
|
if (!empty($cwdir)) {
|
||||||
|
$rootfolder = $cwdir;
|
||||||
|
}
|
||||||
|
|
||||||
$configfile = "$rootfolder/conf/bastille_config";
|
$configfile = "$rootfolder/conf/bastille_config";
|
||||||
$configfile_bastille = "$rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf";
|
$configfile_bastille = "$rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf";
|
||||||
$versionfile = "$rootfolder/version";
|
$versionfile = "$rootfolder/version";
|
||||||
@@ -55,20 +65,24 @@ $versionfile = "$rootfolder/version";
|
|||||||
$date = date('D M d h:i:s Y', time()); // Equivalent date replacement for the previous strftime function.
|
$date = date('D M d h:i:s Y', time()); // Equivalent date replacement for the previous strftime function.
|
||||||
$logfile = "$rootfolder/log/bastille_ext.log";
|
$logfile = "$rootfolder/log/bastille_ext.log";
|
||||||
$logevent = "$rootfolder/log/bastille_last_event.log";
|
$logevent = "$rootfolder/log/bastille_last_event.log";
|
||||||
$backup_path = exec("/usr/bin/grep 'BACKUP_DIR=' $configfile | /usr/bin/cut -d'\"' -f2");
|
|
||||||
|
// Reuse $conf_file if it's our local one, otherwise use the standard greed
|
||||||
|
$grep_config = file_exists($configfile) ? $configfile : $conf_file;
|
||||||
|
|
||||||
|
$backup_path = exec("/usr/bin/grep 'BACKUP_DIR=' $grep_config | /usr/bin/cut -d'\"' -f2");
|
||||||
$bastille_config = "$rootfolder/conf/bastille_config";
|
$bastille_config = "$rootfolder/conf/bastille_config";
|
||||||
$config_path = exec("/usr/bin/grep 'BASTILLE_CONFIG=' $configfile | /usr/bin/cut -d'\"' -f2");
|
$config_path = exec("/usr/bin/grep 'BASTILLE_CONFIG=' $grep_config | /usr/bin/cut -d'\"' -f2");
|
||||||
$default_distfiles = exec("/usr/bin/grep 'bastille_bootstrap_archives=' $config_path | /usr/bin/cut -d'\"' -f2");
|
$default_distfiles = exec("/usr/bin/grep 'bastille_bootstrap_archives=' $config_path | /usr/bin/cut -d'\"' -f2");
|
||||||
$jail_dir = "{$rootfolder}/jails";
|
$jail_dir = "{$rootfolder}/jails";
|
||||||
$image_dir = "ext/bastille/images";
|
$image_dir = "ext/bastille/images";
|
||||||
$reldir = "{$rootfolder}/releases";
|
$reldir = "{$rootfolder}/releases";
|
||||||
$backup_path_bastille = exec("/usr/sbin/sysrc -f $rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf -qn bastille_backupsdir");
|
$backup_path_bastille = exec("/usr/sbin/sysrc -f $rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf -qn bastille_backupsdir");
|
||||||
$zfs_support = exec("/usr/bin/grep 'ZFS_SUPPORT=' $configfile | /usr/bin/cut -d'\"' -f2");
|
$zfs_support = exec("/usr/bin/grep 'ZFS_SUPPORT=' $grep_config | /usr/bin/cut -d'\"' -f2");
|
||||||
$zfs_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $configfile | /usr/bin/cut -d'\"' -f2");
|
$zfs_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $grep_config | /usr/bin/cut -d'\"' -f2");
|
||||||
$tarballversion = "/usr/local/bin/bastille";
|
if (!isset($tarballversion)) $tarballversion = "/usr/local/bin/bastille";
|
||||||
$bastille_version_min = exec("grep 'BASTILLE_VERSION=' $tarballversion | cut -d '\"' -f2 | tr -d '.'");
|
$bastille_version_min = exec("grep 'BASTILLE_VERSION=' $tarballversion | cut -d '\"' -f2 | tr -d '.'");
|
||||||
$host_version = exec("/bin/cat /etc/prd.version | tr -d '.'");
|
$host_version = exec("/bin/cat /etc/prd.version | tr -d '.'");
|
||||||
$linux_compat_support = exec("/usr/bin/grep 'LINUX_COMPAT_SUPPORT=' $configfile | /usr/bin/cut -d'\"' -f2");
|
$linux_compat_support = exec("/usr/bin/grep 'LINUX_COMPAT_SUPPORT=' $grep_config | /usr/bin/cut -d'\"' -f2");
|
||||||
$jail_settings = "settings.conf";
|
$jail_settings = "settings.conf";
|
||||||
|
|
||||||
// Ensure the root directory is configured.
|
// Ensure the root directory is configured.
|
||||||
@@ -146,7 +160,7 @@ function get_state_zfs() {
|
|||||||
function get_all_release_list() {
|
function get_all_release_list() {
|
||||||
global $rootfolder;
|
global $rootfolder;
|
||||||
global $g;
|
global $g;
|
||||||
exec("/bin/echo; /bin/ls {$rootfolder}/releases | grep RELEASE 2>/dev/null | /usr/bin/tr -s ' ' '\n'",$relinfo);
|
exec("/bin/echo; /bin/ls {$rootfolder}/releases | /usr/bin/tr -s ' ' '\n'",$relinfo);
|
||||||
array_shift($relinfo);
|
array_shift($relinfo);
|
||||||
$rellist = [];
|
$rellist = [];
|
||||||
foreach($relinfo as $rel):
|
foreach($relinfo as $rel):
|
||||||
|
|||||||
+267
-257
@@ -3,7 +3,7 @@
|
|||||||
bastille_manager_add.php
|
bastille_manager_add.php
|
||||||
|
|
||||||
Copyright (c) 2019-2026 José Rivera (joserprg@gmail.com).
|
Copyright (c) 2019-2026 José Rivera (joserprg@gmail.com).
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||||
Copyright (c) 2018 XigmaNAS® <info@xigmanas.com>.
|
Copyright (c) 2018 XigmaNAS® <info@xigmanas.com>.
|
||||||
@@ -14,13 +14,13 @@
|
|||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions
|
||||||
are met:
|
are met:
|
||||||
1. Redistributions of source code must retain the above copyright
|
1. Redistributions of source code must retain the above copyright
|
||||||
notice, this list of conditions and the following disclaimer.
|
notice, this list of conditions and the following disclaimer.
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
notice, this list of conditions and the following disclaimer in the
|
notice, this list of conditions and the following disclaimer in the
|
||||||
documentation and/or other materials provided with the distribution.
|
documentation and/or other materials provided with the distribution.
|
||||||
3. Neither the name of the developer nor the names of contributors
|
3. Neither the name of the developer nor the names of contributors
|
||||||
may be used to endorse or promote products derived from this software
|
may be used to endorse or promote products derived from this software
|
||||||
without specific prior written permission.
|
without specific prior written permission.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
|
THIS SOFTWARE IS PROVIDED BY THE DEVELOPER ``AS IS'' AND
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
@@ -42,118 +42,120 @@ require_once("bastille_manager-lib.inc");
|
|||||||
$pgtitle = array(gtext("Extensions"), "Bastille", "Create");
|
$pgtitle = array(gtext("Extensions"), "Bastille", "Create");
|
||||||
|
|
||||||
$pconfig = [];
|
$pconfig = [];
|
||||||
|
$errormsg = "";
|
||||||
|
|
||||||
if(!(isset($pconfig['jailname']))):
|
if (!(isset($pconfig['jailname']))):
|
||||||
$pconfig['jailname'] = 'jail1';
|
$pconfig['jailname'] = 'jail1';
|
||||||
endif;
|
endif;
|
||||||
if(!(isset($pconfig['ipaddress']))):
|
if (!(isset($pconfig['ipaddress']))):
|
||||||
$pconfig['ipaddress'] = '';
|
$pconfig['ipaddress'] = '';
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if(!get_all_release_list()):
|
if (!get_all_release_list()):
|
||||||
$errormsg = gtext('No base releases extracted yet.')
|
$errormsg = gtext('No base releases extracted yet.')
|
||||||
. ' '
|
. ' '
|
||||||
. '<a href="' . 'bastille_manager_tarballs.php' . '">'
|
. '<a href="' . 'bastille_manager_tarballs.php' . '">'
|
||||||
. gtext('Please download a base release first.')
|
. gtext('Please download a base release first.')
|
||||||
. '</a>';
|
. '</a>';
|
||||||
$prerequisites_ok = false;
|
$prerequisites_ok = false;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$zfs_status = get_state_zfs();
|
$zfs_status = get_state_zfs();
|
||||||
if($zfs_status == "Invalid ZFS configuration"):
|
if ($zfs_status == "Invalid ZFS configuration"):
|
||||||
// Warning if invalid ZFS configuration.
|
// Warning if invalid ZFS configuration.
|
||||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if($_POST):
|
if ($_POST):
|
||||||
global $jail_dir;
|
global $jail_dir;
|
||||||
global $configfile;
|
global $configfile;
|
||||||
unset($input_errors);
|
unset($input_errors);
|
||||||
$pconfig = $_POST;
|
$pconfig = $_POST;
|
||||||
if(isset($_POST['Cancel']) && $_POST['Cancel']):
|
if (isset($_POST['Cancel']) && $_POST['Cancel']):
|
||||||
header('Location: bastille_manager_gui.php');
|
header('Location: bastille_manager_gui.php');
|
||||||
exit;
|
exit;
|
||||||
endif;
|
endif;
|
||||||
if(isset($_POST['Create']) && $_POST['Create']):
|
if (isset($_POST['Create']) && $_POST['Create']):
|
||||||
$zfs_status = get_state_zfs();
|
$zfs_status = get_state_zfs();
|
||||||
if($zfs_status == "Invalid ZFS configuration"):
|
if ($zfs_status == "Invalid ZFS configuration"):
|
||||||
// Abort jail creation if invalid ZFS configuration.
|
// Abort jail creation if invalid ZFS configuration.
|
||||||
$input_errors[] = gtext("Cannot create jail with an invalid ZFS configuration.");
|
$input_errors[] = gtext("Cannot create jail with an invalid ZFS configuration.");
|
||||||
else:
|
else:
|
||||||
|
|
||||||
$jname = $pconfig['jailname'];
|
$jname = $pconfig['jailname'];
|
||||||
$ipaddr = $pconfig['ipaddress'];
|
$ipaddr = $pconfig['ipaddress'];
|
||||||
$release = $pconfig['release'];
|
$release = $pconfig['release'];
|
||||||
$resolv_conf = "{$jail_dir}/{$jname}/root/etc/resolv.conf";
|
$resolv_conf = "{$jail_dir}/{$jname}/root/etc/resolv.conf";
|
||||||
$resolv_host = "/var/etc/resolv.conf";
|
$resolv_host = "/var/etc/resolv.conf";
|
||||||
$options = "";
|
$options = "";
|
||||||
if ($_POST['interface'] == 'Config'):
|
if ($_POST['interface'] == 'Config'):
|
||||||
$interface = "";
|
$interface = "";
|
||||||
else:
|
|
||||||
$interface = $pconfig['interface'];
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if($release == 'Ubuntu_1804'):
|
|
||||||
$release = "ubuntu-bionic";
|
|
||||||
elseif($release == 'Ubuntu_2004'):
|
|
||||||
$release = "ubuntu-focal";
|
|
||||||
elseif($release == 'Ubuntu_2204'):
|
|
||||||
$release = "ubuntu-jammy";
|
|
||||||
elseif($release == 'Debian9'):
|
|
||||||
$release = "debian-stretch";
|
|
||||||
elseif($release == 'Debian10'):
|
|
||||||
$release = "debian-buster";
|
|
||||||
elseif($release == 'Debian12'):
|
|
||||||
$release = "debian-bookworm";
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if(isset($_POST['thickjail']) && isset($_POST['vnetjail'])):
|
|
||||||
$options = "-T -V";
|
|
||||||
elseif(isset($_POST['thickjail']) && isset($_POST['bridgejail'])):
|
|
||||||
$options = "-T -B";
|
|
||||||
elseif(isset($_POST['thickjail'])):
|
|
||||||
$options = "-T";
|
|
||||||
elseif(isset($_POST['vnetjail'])):
|
|
||||||
$options = "-V";
|
|
||||||
elseif(isset($_POST['bridgejail'])):
|
|
||||||
$options = "-B";
|
|
||||||
elseif(isset($_POST['linuxjail'])):
|
|
||||||
$options = "-L";
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if(isset($_POST['emptyjail'])):
|
|
||||||
// Just create an empty container with minimal jail.conf.
|
|
||||||
$cmd = ("/usr/local/bin/bastille create -E {$jname}");
|
|
||||||
else:
|
|
||||||
if (isset($_POST['autostart'])):
|
|
||||||
$cmd = ("/usr/local/bin/bastille create {$options} {$jname} {$release} {$ipaddr} {$interface}");
|
|
||||||
else:
|
else:
|
||||||
$cmd = ("/usr/local/bin/bastille create --no-boot {$options} {$jname} {$release} {$ipaddr} {$interface}");
|
$interface = $pconfig['interface'];
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
|
|
||||||
if ($_POST['Create']):
|
if ($release == 'Ubuntu_1804'):
|
||||||
if(get_all_release_list()):
|
$release = "ubuntu-bionic";
|
||||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
elseif ($release == 'Ubuntu_2004'):
|
||||||
if($retval == 0):
|
$release = "ubuntu-focal";
|
||||||
//if (isset($_POST['autostart'])):
|
elseif ($release == 'Ubuntu_2204'):
|
||||||
// exec("/usr/sbin/sysrc -f {$configfile} {$jname}_AUTO_START=\"YES\"");
|
$release = "ubuntu-jammy";
|
||||||
//endif;
|
elseif ($release == 'Debian9'):
|
||||||
if(is_link($resolv_conf)):
|
$release = "debian-stretch";
|
||||||
if(unlink($resolv_conf)):
|
elseif ($release == 'Debian10'):
|
||||||
//exec("/usr/local/bin/bastille cp $jname $resolv_host etc");
|
$release = "debian-buster";
|
||||||
copy($resolv_host, $resolv_conf);
|
elseif ($release == 'Debian12'):
|
||||||
endif;
|
$release = "debian-bookworm";
|
||||||
endif;
|
endif;
|
||||||
header('Location: bastille_manager_gui.php');
|
|
||||||
exit;
|
if (isset($_POST['thickjail']) && isset($_POST['vnetjail'])):
|
||||||
|
$options = "-T -V";
|
||||||
|
elseif (isset($_POST['thickjail']) && isset($_POST['bridgejail'])):
|
||||||
|
$options = "-T -B";
|
||||||
|
elseif (isset($_POST['thickjail'])):
|
||||||
|
$options = "-T";
|
||||||
|
elseif (isset($_POST['vnetjail'])):
|
||||||
|
$options = "-V";
|
||||||
|
elseif (isset($_POST['bridgejail'])):
|
||||||
|
$options = "-B";
|
||||||
|
elseif (isset($_POST['linuxjail'])):
|
||||||
|
$options = "-L";
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if (isset($_POST['emptyjail'])):
|
||||||
|
// Just create an empty container with minimal jail.conf.
|
||||||
|
$cmd = ("/usr/local/bin/bastille create -E {$jname}");
|
||||||
|
else:
|
||||||
|
if (isset($_POST['autostart'])):
|
||||||
|
$cmd = ("/usr/local/bin/bastille create {$options} {$jname} {$release} {$ipaddr} {$interface}");
|
||||||
else:
|
else:
|
||||||
$errormsg .= gtext("Failed to create container.");
|
$cmd = ("/usr/local/bin/bastille create --no-boot {$options} {$jname} {$release} {$ipaddr} {$interface}");
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ($_POST['Create']):
|
||||||
|
if (get_all_release_list()):
|
||||||
|
unset($output, $retval);
|
||||||
|
mwexec2($cmd, $output, $retval);
|
||||||
|
if ($retval == 0):
|
||||||
|
//if (isset($_POST['autostart'])):
|
||||||
|
// exec("/usr/sbin/sysrc -f {$configfile} {$jname}_AUTO_START=\"YES\"");
|
||||||
|
//endif;
|
||||||
|
if (is_link($resolv_conf)):
|
||||||
|
if (unlink($resolv_conf)):
|
||||||
|
//exec("/usr/local/bin/bastille cp $jname $resolv_host etc");
|
||||||
|
copy($resolv_host, $resolv_conf);
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
header('Location: bastille_manager_gui.php');
|
||||||
|
exit;
|
||||||
|
else:
|
||||||
|
$errormsg .= gtext("Failed to create container.");
|
||||||
|
endif;
|
||||||
|
else:
|
||||||
|
$errormsg .= gtext(" <<< Failed to create container.");
|
||||||
endif;
|
endif;
|
||||||
else:
|
|
||||||
$errormsg .= gtext(" <<< Failed to create container.");
|
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
@@ -162,196 +164,204 @@ endif;
|
|||||||
include 'fbegin.inc';
|
include 'fbegin.inc';
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//<![CDATA[
|
//<![CDATA[
|
||||||
$(window).on("load",function() {
|
$(window).on("load", function () {
|
||||||
$("#iform").submit(function() { spinner(); });
|
$("#iform").submit(function () { spinner(); });
|
||||||
$(".spin").click(function() { spinner(); });
|
$(".spin").click(function () { spinner(); });
|
||||||
});
|
});
|
||||||
function emptyjail_change() {
|
function emptyjail_change() {
|
||||||
switch(document.iform.emptyjail.checked) {
|
switch (document.iform.emptyjail.checked) {
|
||||||
case false:
|
case false:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'show');
|
showElementById('vnetjail_tr', 'show');
|
||||||
showElementById('bridgejail_tr', 'show');
|
showElementById('bridgejail_tr', 'show');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
case true:
|
case true:
|
||||||
showElementById('ipaddress_tr','hide');
|
showElementById('ipaddress_tr', 'hide');
|
||||||
showElementById('interface_tr', 'hide');
|
showElementById('interface_tr', 'hide');
|
||||||
showElementById('release_tr', 'hide');
|
showElementById('release_tr', 'hide');
|
||||||
showElementById('thickjail_tr', 'hide');
|
showElementById('thickjail_tr', 'hide');
|
||||||
showElementById('vnetjail_tr', 'hide');
|
showElementById('vnetjail_tr', 'hide');
|
||||||
showElementById('bridgejail_tr', 'hide');
|
showElementById('bridgejail_tr', 'hide');
|
||||||
//showElementById('nowstart_tr', 'hide');
|
//showElementById('nowstart_tr', 'hide');
|
||||||
showElementById('autostart_tr', 'hide');
|
showElementById('autostart_tr', 'hide');
|
||||||
showElementById('linuxjail_tr', 'hide');
|
showElementById('linuxjail_tr', 'hide');
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function linuxjail_change() {
|
function linuxjail_change() {
|
||||||
switch(document.iform.linuxjail.checked) {
|
switch (document.iform.linuxjail.checked) {
|
||||||
case false:
|
case false:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'show');
|
showElementById('vnetjail_tr', 'show');
|
||||||
showElementById('bridgejail_tr', 'show');
|
showElementById('bridgejail_tr', 'show');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
showElementById('emptyjail_tr', 'show');
|
showElementById('emptyjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
case true:
|
case true:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'hide');
|
showElementById('thickjail_tr', 'hide');
|
||||||
showElementById('vnetjail_tr', 'hide');
|
showElementById('vnetjail_tr', 'hide');
|
||||||
showElementById('bridgejail_tr', 'hide');
|
showElementById('bridgejail_tr', 'hide');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('emptyjail_tr', 'hide');
|
showElementById('emptyjail_tr', 'hide');
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function vnetjail_change() {
|
function vnetjail_change() {
|
||||||
switch(document.iform.vnetjail.checked) {
|
switch (document.iform.vnetjail.checked) {
|
||||||
case false:
|
case false:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'show');
|
showElementById('vnetjail_tr', 'show');
|
||||||
showElementById('bridgejail_tr', 'show');
|
showElementById('bridgejail_tr', 'show');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
case true:
|
case true:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'show');
|
showElementById('vnetjail_tr', 'show');
|
||||||
showElementById('bridgejail_tr', 'hide');
|
showElementById('bridgejail_tr', 'hide');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function bridgejail_change() {
|
function bridgejail_change() {
|
||||||
switch(document.iform.bridgejail.checked) {
|
switch (document.iform.bridgejail.checked) {
|
||||||
case false:
|
case false:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'show');
|
showElementById('vnetjail_tr', 'show');
|
||||||
showElementById('bridgejail_tr', 'show');
|
showElementById('bridgejail_tr', 'show');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
case true:
|
case true:
|
||||||
showElementById('ipaddress_tr','show');
|
showElementById('ipaddress_tr', 'show');
|
||||||
showElementById('interface_tr', 'show');
|
showElementById('interface_tr', 'show');
|
||||||
showElementById('release_tr', 'show');
|
showElementById('release_tr', 'show');
|
||||||
showElementById('thickjail_tr', 'show');
|
showElementById('thickjail_tr', 'show');
|
||||||
showElementById('vnetjail_tr', 'hide');
|
showElementById('vnetjail_tr', 'hide');
|
||||||
showElementById('bridgejail_tr', 'show');
|
showElementById('bridgejail_tr', 'show');
|
||||||
//showElementById('nowstart_tr', 'show');
|
//showElementById('nowstart_tr', 'show');
|
||||||
showElementById('autostart_tr', 'show');
|
showElementById('autostart_tr', 'show');
|
||||||
showElementById('linuxjail_tr', 'show');
|
showElementById('linuxjail_tr', 'show');
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
$document = new co_DOMDocument();
|
$document = new co_DOMDocument();
|
||||||
$document->
|
$document->
|
||||||
add_area_tabnav()->
|
add_area_tabnav()->
|
||||||
push()->
|
push()->
|
||||||
add_tabnav_upper()->
|
add_tabnav_upper()->
|
||||||
ins_tabnav_record('bastille_manager_gui.php',gettext('Containers'),gettext('Reload page'),true)->
|
ins_tabnav_record('bastille_manager_gui.php', gettext('Containers'), gettext('Reload page'), true)->
|
||||||
ins_tabnav_record('bastille_manager_info.php',gettext('Information'),gettext('Reload page'),true)->
|
ins_tabnav_record('bastille_manager_info.php', gettext('Information'), gettext('Reload page'), true)->
|
||||||
ins_tabnav_record('bastille_manager_maintenance.php',gettext('Maintenance'),gettext('Reload page'),true);
|
ins_tabnav_record('bastille_manager_maintenance.php', gettext('Maintenance'), gettext('Reload page'), true);
|
||||||
$document->render();
|
$document->render();
|
||||||
?>
|
?>
|
||||||
<form action="bastille_manager_add.php" method="post" name="iform" id="iform"><table id="area_data"><tbody><tr><td id="area_data_frame">
|
<form action="bastille_manager_add.php" method="post" name="iform" id="iform">
|
||||||
<?php
|
<table id="area_data">
|
||||||
if(!empty($errormsg)):
|
|
||||||
print_error_box($errormsg);
|
|
||||||
endif;
|
|
||||||
if(!empty($savemsg)):
|
|
||||||
print_info_box($savemsg);
|
|
||||||
endif;
|
|
||||||
if(!empty($input_errors)):
|
|
||||||
print_input_errors($input_errors);
|
|
||||||
endif;
|
|
||||||
if(file_exists($d_sysrebootreqd_path)):
|
|
||||||
print_info_box(get_std_save_message(0));
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<table class="area_data_settings">
|
|
||||||
<colgroup>
|
|
||||||
<col class="area_data_settings_col_tag">
|
|
||||||
<col class="area_data_settings_col_data">
|
|
||||||
</colgroup>
|
|
||||||
<thead>
|
|
||||||
<?php
|
|
||||||
html_titleline2(gettext('Create new Container'));
|
|
||||||
?>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<tr>
|
||||||
html_inputbox2('jailname',gettext('Friendly name'),$pconfig['jailname'],'',true,20);
|
<td id="area_data_frame">
|
||||||
html_inputbox2('ipaddress',gettext('IP Address'),$pconfig['ipaddress'],'',true,20);
|
<?php
|
||||||
$a_action = $l_interfaces;
|
if (!empty($errormsg)):
|
||||||
$b_action = $l_release;
|
print_error_box($errormsg);
|
||||||
html_combobox2('interface',gettext('Network interface'),!empty($pconfig['interface']),$a_action,'',true,false);
|
endif;
|
||||||
html_combobox2('release',gettext('Base release'),!empty($pconfig['release']),$b_action,'',true,false);
|
if (!empty($savemsg)):
|
||||||
if($bastille_version_min > "0700000000"):
|
print_info_box($savemsg);
|
||||||
html_checkbox2('thickjail',gettext('Create a thick container'),!empty($pconfig['thickjail']) ? true : false,gettext('These containers consume more space, but are self contained and fully independent.'),'',false);
|
endif;
|
||||||
if($host_version > "12100"):
|
if (!empty($input_errors)):
|
||||||
html_checkbox2('vnetjail',gettext('Enable VNET(VIMAGE)'),!empty($pconfig['vnetjail']) ? true : false,gettext('VNET-enabled containers are attached to a virtual bridge interface for connectivity(Only supported on 13.x and above).'),'',false,false,'vnetjail_change()');
|
print_input_errors($input_errors);
|
||||||
html_checkbox2('bridgejail',gettext('Enable Bridge VNET(VIMAGE)'),!empty($pconfig['bridgejail']) ? true : false,gettext('Bridge VNET-enabled containers are attached to a specified, already existing external bridge(Only supported on 13.x and above).'),'',false,false,'bridgejail_change()');
|
endif;
|
||||||
endif;
|
if (file_exists($d_sysrebootreqd_path)):
|
||||||
html_checkbox2('emptyjail',gettext('Create an empty container'),!empty($pconfig['emptyjail']) ? true : false,gettext('This are ideal for custom builds, experimenting with unsupported RELEASES or Linux jails.'),'',false,false,'emptyjail_change()');
|
print_info_box(get_std_save_message(0));
|
||||||
if($linux_compat_support == "YES"):
|
endif;
|
||||||
//html_checkbox2('linuxjail',gettext('Create a Linux container'),!empty($pconfig['linuxjail']) ? true : false,gettext('This will create a Linux container, this is highly experimental and for testing purposes.'),'',false,false,'linuxjail_change()');
|
?>
|
||||||
endif;
|
<table class="area_data_settings">
|
||||||
endif;
|
<colgroup>
|
||||||
//html_checkbox2('nowstart',gettext('Start after creation'),!empty($pconfig['nowstart']) ? true : false,gettext('Start the container after creation(May be overridden by later bastille releases).'),'',false);
|
<col class="area_data_settings_col_tag">
|
||||||
html_checkbox2('autostart',gettext('Auto start on boot'),!empty($pconfig['autostart']) ? true : false,gettext('Automatically start the container at boot time.'),'',false);
|
<col class="area_data_settings_col_data">
|
||||||
?>
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<?php
|
||||||
|
html_titleline2(gettext('Create new Container'), 2);
|
||||||
|
?>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
html_inputbox2('jailname', gettext('Friendly name'), $pconfig['jailname'], '', true, 20);
|
||||||
|
html_inputbox2('ipaddress', gettext('IP Address'), $pconfig['ipaddress'], '', true, 20);
|
||||||
|
$a_action = $l_interfaces;
|
||||||
|
$b_action = $l_release;
|
||||||
|
html_combobox2('interface', gettext('Network interface'), !empty($pconfig['interface']), $a_action, '', true, false);
|
||||||
|
html_combobox2('release', gettext('Base release'), !empty($pconfig['release']), $b_action, '', true, false);
|
||||||
|
if ($bastille_version_min > "0700000000"):
|
||||||
|
html_checkbox2('thickjail', gettext('Create a thick container'), !empty($pconfig['thickjail']) ? true : false, gettext('These containers consume more space, but are self contained and fully independent.'), '', false);
|
||||||
|
if ($host_version > "12100"):
|
||||||
|
html_checkbox2('vnetjail', gettext('Enable VNET(VIMAGE)'), !empty($pconfig['vnetjail']) ? true : false, gettext('VNET-enabled containers are attached to a virtual bridge interface for connectivity(Only supported on 13.x and above).'), '', false, false, 'vnetjail_change()');
|
||||||
|
html_checkbox2('bridgejail', gettext('Enable Bridge VNET(VIMAGE)'), !empty($pconfig['bridgejail']) ? true : false, gettext('Bridge VNET-enabled containers are attached to a specified, already existing external bridge(Only supported on 13.x and above).'), '', false, false, 'bridgejail_change()');
|
||||||
|
endif;
|
||||||
|
html_checkbox2('emptyjail', gettext('Create an empty container'), !empty($pconfig['emptyjail']) ? true : false, gettext('This are ideal for custom builds, experimenting with unsupported RELEASES or Linux jails.'), '', false, false, 'emptyjail_change()');
|
||||||
|
if ($linux_compat_support == "YES"):
|
||||||
|
html_checkbox2('linuxjail', gettext('Create a Linux container'), !empty($pconfig['linuxjail']) ? true : false, gettext('This will create a Linux container, this is highly experimental and for testing purposes.'), '', false, false, 'linuxjail_change()');
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
//html_checkbox2('nowstart',gettext('Start after creation'),!empty($pconfig['nowstart']) ? true : false,gettext('Start the container after creation(May be overridden by later bastille releases).'),'',false);
|
||||||
|
html_checkbox2('autostart', gettext('Auto start on boot'), !empty($pconfig['autostart']) ? true : false, gettext('Automatically start the container at boot time.'), '', false);
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div id="submit">
|
||||||
|
<input name="Create" type="submit" class="formbtn" value="<?= gtext('Create'); ?>" />
|
||||||
|
<input name="Cancel" type="submit" class="formbtn" value="<?= gtext('Cancel'); ?>" />
|
||||||
|
</div>
|
||||||
|
<?php
|
||||||
|
include 'formend.inc';
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="submit">
|
</form>
|
||||||
<input name="Create" type="submit" class="formbtn" value="<?=gtext('Create');?>"/>
|
|
||||||
<input name="Cancel" type="submit" class="formbtn" value="<?=gtext('Cancel');?>" />
|
|
||||||
</div>
|
|
||||||
<?php
|
|
||||||
include 'formend.inc';
|
|
||||||
?>
|
|
||||||
</td></tr></tbody></table></form>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
emptyjail_change();
|
emptyjail_change();
|
||||||
linuxjail_change();
|
linuxjail_change();
|
||||||
//-->
|
//-->
|
||||||
</script>
|
</script>
|
||||||
<?php
|
<?php
|
||||||
include 'fend.inc';
|
include 'fend.inc';
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user