From 9cc370d4adfca563e9d7df09bc5c71781244a9a1 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 16 Nov 2019 17:46:29 -0400 Subject: [PATCH] Add option for thickjail creation if supported --- CHANGELOG | 1 + gui/bastille_manager-lib.inc | 1 + gui/bastille_manager_add.php | 15 ++++++++++++--- version | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5cb0309..c1ec812 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.0.8......Add option for thickjail creation if supported. 1.0.7......Added 12.1-RELEASE. 1.0.6......Reload page after base release download. 1.0.5......Add missing uninstall code. diff --git a/gui/bastille_manager-lib.inc b/gui/bastille_manager-lib.inc index ffc085f..17d92e8 100755 --- a/gui/bastille_manager-lib.inc +++ b/gui/bastille_manager-lib.inc @@ -53,6 +53,7 @@ $backup_path = exec("/bin/cat {$configfile} | /usr/bin/grep 'BACKUP_DIR=' | /usr $bastille_config = "{$rootfolder}/conf/bastille_config"; $jail_dir = "{$rootfolder}/jails"; $image_dir = "ext/bastille/images"; +$thick_jail = exec("/usr/local/bin/bastille create | grep -wo '\[option\]'"); // Ensure the root directory is configured. if ($rootfolder == "") diff --git a/gui/bastille_manager_add.php b/gui/bastille_manager_add.php index fbc1451..e18dc97 100644 --- a/gui/bastille_manager_add.php +++ b/gui/bastille_manager_add.php @@ -89,10 +89,16 @@ if($_POST): $interface = $pconfig['interface']; endif; - if ($_POST['nowstart']): - $cmd = ("/usr/local/bin/bastille create {$jname} {$release} {$ipaddr} {$interface} && /usr/local/bin/bastille start {$jname}"); + if($_POST['thickjail']): + $thick_jail = "-T"; else: - $cmd = ("/usr/local/bin/bastille create {$jname} {$release} {$ipaddr} {$interface}"); + $thick_jail = ""; + endif; + + if ($_POST['nowstart']): + $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$jname} {$release} {$ipaddr} {$interface} && /usr/local/bin/bastille start {$jname}"); + else: + $cmd = ("/usr/local/bin/bastille create {$thick_jail} {$jname} {$release} {$ipaddr} {$interface}"); endif; if ($_POST['Create']): @@ -169,6 +175,9 @@ $document->render(); $b_action = $l_release; html_combobox2('interface',gettext('Network interface'),$pconfig['interface'],$a_action,'',true,false,'action_change()'); html_combobox2('release',gettext('Base release'),$pconfig['release'],$b_action,'',true,false,'action_change()'); + if($thick_jail): + html_checkbox2('thickjail',gettext('Create a thick container'),!empty($pconfig['thickjail']) ? true : false,gettext('These containers consume more space, but are self contained.'),'',false); + endif; html_checkbox2('nowstart',gettext('Start after creation'),!empty($pconfig['nowstart']) ? true : false,gettext('Start the container after creation.'),'',false); html_checkbox2('autostart',gettext('Auto start on boot'),!empty($pconfig['autostart']) ? true : false,gettext('Automatically start the container at boot time.'),'',false); ?> diff --git a/version b/version index 238d6e8..b0f3d96 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.0.7 +1.0.8