diff --git a/CHANGELOG b/CHANGELOG index 36284ac..515760a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ ====================== Version Description +1.1.18......Code and Cosmetic changes, some PHP8.x warning fixes. 1.1.17......Cosmetic changes, some PHP8.x warning fixes. 1.1.16......Add help support section for useful commands. 1.1.15......Add required files from FreeBSD 13.1 base release, update config. diff --git a/gui/bastille_manager_add.php b/gui/bastille_manager_add.php index 5779d29..647c1db 100644 --- a/gui/bastille_manager_add.php +++ b/gui/bastille_manager_add.php @@ -41,10 +41,12 @@ require_once("bastille_manager-lib.inc"); $pgtitle = array(gtext("Extensions"), "Bastille", "Create"); -if(!$pconfig['jailname']): +$pconfig = []; + +if(!(isset($pconfig['jailname']))): $pconfig['jailname'] = 'jail1'; endif; -if(!$pconfig['ipaddress']): +if(!(isset($pconfig['ipaddress']))): $pconfig['ipaddress'] = ''; endif; @@ -89,21 +91,21 @@ if($_POST): $release = "debian-buster"; endif; - if($_POST['thickjail'] && $_POST['vnetjail']): + if(isset($_POST['thickjail']) && isset($_POST['vnetjail'])): $options = "-T -V"; - elseif($_POST['thickjail']): + elseif(isset($_POST['thickjail'])): $options = "-T"; - elseif($_POST['vnetjail']): + elseif(isset($_POST['vnetjail'])): $options = "-V"; - elseif($_POST['linuxjail']): + elseif(isset($_POST['linuxjail'])): $options = "-L"; endif; - if($_POST['emptyjail']): + if(isset($_POST['emptyjail'])): // Just create an empty container with minimal jail.conf. $cmd = ("/usr/local/bin/bastille create -E {$jname}"); else: - if ($_POST['nowstart']): + if (isset($_POST['nowstart'])): $cmd = ("/usr/local/bin/bastille create {$options} {$jname} {$release} {$ipaddr} {$interface} && /usr/local/bin/bastille start {$jname}"); else: $cmd = ("/usr/local/bin/bastille create {$options} {$jname} {$release} {$ipaddr} {$interface}"); @@ -114,7 +116,7 @@ if($_POST): if(get_all_release_list()): unset($output,$retval);mwexec2($cmd,$output,$retval); if($retval == 0): - if ($_POST['autostart']): + if (isset($_POST['autostart'])): exec("/usr/sbin/sysrc -f {$configfile} {$jname}_AUTO_START=\"YES\""); endif; if(is_link($resolv_conf)): @@ -238,17 +240,17 @@ $document->render(); html_inputbox2('ipaddress',gettext('IP Address'),$pconfig['ipaddress'],'',true,20); $a_action = $l_interfaces; $b_action = $l_release; - html_combobox2('interface',gettext('Network interface'),$pconfig['interface'],$a_action,'',true,false); - html_combobox2('release',gettext('Base release'),$pconfig['release'],$b_action,'',true,false); + 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.'),'',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(Advanced).'),'',false); + 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); 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()'); - - 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()'); - + 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); diff --git a/gui/bastille_manager_gui.php b/gui/bastille_manager_gui.php index e3ee342..fedbbd0 100644 --- a/gui/bastille_manager_gui.php +++ b/gui/bastille_manager_gui.php @@ -287,6 +287,7 @@ $document->render();
> {$logfile}"); @@ -180,7 +182,8 @@ if ($_POST) { endif; // Update extension config. $cmd = "/usr/sbin/sysrc -f {$configfile} BACKUP_DIR={$backup_path}"; - unset($retval);mwexec($cmd,$retval); + //unset($retval); + mwexec($cmd,$retval); if ($retval == 0) { $savemsg .= gtext("Extension settings saved successfully."); exec("echo '{$date}: {$application}: Extension settings saved successfully' >> {$logfile}"); @@ -253,7 +256,8 @@ if ($_POST) { else: if (is_file($backup_file)) { $cmd = ("/usr/local/bin/bastille import '{$filename_trim}'"); - unset($output,$retval);mwexec2($cmd,$output,$retval); + //unset($output,$retval); + mwexec2($cmd,$output,$retval); if ($retval == 0) { $savemsg .= gtext("Container restored successfully."); exec("echo '{$date}: {$application}: Container restored successfully from {$filename_trim}' >> {$logfile}"); diff --git a/gui/bastille_manager_tarballs.php b/gui/bastille_manager_tarballs.php index 529d458..1c1b056 100644 --- a/gui/bastille_manager_tarballs.php +++ b/gui/bastille_manager_tarballs.php @@ -44,6 +44,7 @@ $pgtitle = [gtext("Extensions"), gtext('Bastille'),gtext('Releases')]; $sphere_array = []; $sphere_record = []; +$pconfig = []; function get_rel_list() { global $rootfolder; @@ -74,6 +75,7 @@ if ($linux_compat_support == "YES"): '13.1-RELEASE' => gettext('13.1-RELEASE'), '13.0-RELEASE' => gettext('13.0-RELEASE'), '12.3-RELEASE' => gettext('12.3-RELEASE'), + //'12.4-RELEASE' => gettext('12.4-RELEASE'), -> To be uncommented when avail '12.2-RELEASE' => gettext('12.2-RELEASE'), '12.1-RELEASE' => gettext('12.1-RELEASE'), '12.0-RELEASE' => gettext('12.0-RELEASE'), @@ -91,6 +93,7 @@ else: '13.1-RELEASE' => gettext('13.1-RELEASE'), '13.0-RELEASE' => gettext('13.0-RELEASE'), '12.3-RELEASE' => gettext('12.3-RELEASE'), + //'12.4-RELEASE' => gettext('12.4-RELEASE'), -> To be uncommented when avail '12.2-RELEASE' => gettext('12.2-RELEASE'), '12.1-RELEASE' => gettext('12.1-RELEASE'), '12.0-RELEASE' => gettext('12.0-RELEASE'), @@ -111,19 +114,22 @@ if($_POST): endif; if (isset($_POST['Download']) && $_POST['Download']): + $lib32 = ""; + $ports = ""; + $src = ""; $get_release = $pconfig['release_item']; $check_release = ("{$rootfolder}/releases/{$get_release}"); $cmd = sprintf('/bin/echo "Y" | /usr/local/bin/bastille bootstrap %1$s > %2$s',$get_release,$logevent); $base_mandatory = "base"; - unset($lib32,$ports,$src); - if ($_POST['lib32']): + //unset($lib32,$ports,$src); + if (isset($_POST['lib32'])): $lib32 = "lib32"; endif; - if ($_POST['ports']): + if (isset($_POST['ports'])): $ports = "ports"; endif; - if ($_POST['src']): + if (isset($_POST['src'])): $src = "src"; endif; $opt_tarballs = "$lib32 $ports $src"; @@ -134,6 +140,8 @@ if($_POST): //else: // Download a FreeBSD base release. if ($_POST['Download']): + $savemsg = ""; + $errormsg = ""; if ($opt_tarballs): if ($config_path): // Override default distfiles once. @@ -161,7 +169,6 @@ if($_POST): if (isset($_POST['Destroy']) && $_POST['Destroy']): if ($_POST['Destroy']): - $get_release = $pconfig['release_item']; if($get_release == 'ubuntu-bionic'): $get_release = "Ubuntu_1804"; @@ -279,8 +286,7 @@ $document->render(); render(); ?>