Re-add Linux jails, WebGUI fixes and improvements
Re-add Linux jail feature, overall WebGUI fixes and improvements.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager-lib.inc
|
||||
|
||||
Copyright (c) 2019-2020 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -70,15 +70,17 @@ $linux_compat_support = exec("/usr/bin/grep 'LINUX_COMPAT_SUPPORT=' $configfile
|
||||
$jail_settings = "settings.conf";
|
||||
|
||||
// Ensure the root directory is configured.
|
||||
if ($rootfolder == "")
|
||||
if ($rootfolder == ""):
|
||||
$input_errors[] = gtext("Extension installed with fault");
|
||||
else {
|
||||
else:
|
||||
// Initialize locales.
|
||||
$textdomain = "/usr/local/share/locale";
|
||||
$textdomain_bastille = "/usr/local/share/locale-bastille";
|
||||
if (!is_link($textdomain_bastille)) { mwexec("ln -s {$rootfolder}/locale-bastille {$textdomain_bastille}", true); }
|
||||
if (!is_link($textdomain_bastille)):
|
||||
mwexec("ln -s {$rootfolder}/locale-bastille {$textdomain_bastille}", true);
|
||||
endif;
|
||||
bindtextdomain("xigmanas", $textdomain_bastille);
|
||||
}
|
||||
endif;
|
||||
if (is_file("{$rootfolder}/postinit")) unlink("{$rootfolder}/postinit");
|
||||
|
||||
// Check releases dir.
|
||||
@@ -90,18 +92,17 @@ function is_dir_empty($reldir) {
|
||||
// Get bastille version
|
||||
function get_version_bastille() {
|
||||
global $tarballversion, $prdname;
|
||||
if (is_file("{$tarballversion}")) {
|
||||
if (is_file("{$tarballversion}")):
|
||||
// For some reason bastille bin version value isn't double quoted anymore so we can't use the old delimiter.
|
||||
// we will keep the old line for reference.
|
||||
|
||||
//exec("/usr/bin/grep 'BASTILLE_VERSION=' {$tarballversion} | cut -d'\"' -f2", $result);
|
||||
exec("/usr/bin/grep 'BASTILLE_VERSION=' {$tarballversion} | cut -d'=' -f2", $result);
|
||||
return ($result[0] ?? '');
|
||||
}
|
||||
else {
|
||||
else:
|
||||
exec("/usr/local/bin/{$prdname} version | awk 'NR==1'", $result);
|
||||
return ($result[0] ?? '');
|
||||
}
|
||||
endif;
|
||||
}
|
||||
|
||||
// Initial install banner
|
||||
@@ -148,7 +149,9 @@ function get_state_zfs() {
|
||||
function get_all_release_list() {
|
||||
global $rootfolder;
|
||||
global $g;
|
||||
exec("/bin/echo; /bin/ls {$rootfolder}/releases 2>/dev/null | /usr/bin/tr -s ' ' '\n'",$relinfo);
|
||||
// Don't show Linux base releases under create jail page for now.
|
||||
#exec("/bin/echo; /bin/ls {$rootfolder}/releases 2>/dev/null | /usr/bin/tr -s ' ' '\n'",$relinfo);
|
||||
exec("/bin/echo; /bin/ls {$rootfolder}/releases | grep RELEASE 2>/dev/null | /usr/bin/tr -s ' ' '\n'",$relinfo);
|
||||
array_shift($relinfo);
|
||||
$rellist = [];
|
||||
foreach($relinfo as $rel):
|
||||
@@ -223,6 +226,7 @@ function get_jail_infos() {
|
||||
if (!$r['id']):
|
||||
$r['id'] = "-";
|
||||
endif;
|
||||
|
||||
// Set the IP address on the running jails using bastille list command instead.
|
||||
//$r['ip'] = exec("/usr/bin/grep -w 'ip4.addr' {$jail_dir}/{$item}/jail.conf | /usr/bin/awk '{print $3}' | /usr/bin/tr -d ';'");
|
||||
$r['ip'] = exec("/usr/local/bin/bastille list {$item} | awk '{print $7}' | sed 1d");
|
||||
@@ -236,11 +240,18 @@ function get_jail_infos() {
|
||||
if (!$r['ip']):
|
||||
$r['ip'] = "-";
|
||||
endif;
|
||||
|
||||
// Display release.
|
||||
$r['rel'] = exec("/usr/sbin/jexec {$item} freebsd-version 2>/dev/null");
|
||||
if (!$r['rel']):
|
||||
$r['rel'] = exec("/usr/sbin/jexec {$item} uname -o 2>/dev/null");
|
||||
elseif (!$r['rel']):
|
||||
if(is_file("{$jail_dir}/{$item}/root/etc/os-release")):
|
||||
$r['rel'] = exec("/bin/cat {$jail_dir}/{$item}/root/etc/os-release | grep 'PRETTY_NAME=' | tr -d 'PRETTY_NAME=\"'");
|
||||
else:
|
||||
$r['rel'] = exec("/usr/sbin/jexec {$item} uname -o 2>/dev/null");
|
||||
endif;
|
||||
endif;
|
||||
// We can't get release version info or jail stopped.
|
||||
if (!$r['rel']):
|
||||
$r['rel'] = "-";
|
||||
endif;
|
||||
|
||||
@@ -269,16 +280,18 @@ function get_jail_infos() {
|
||||
if (!$r['path']):
|
||||
$r['path'] = "-";
|
||||
endif;
|
||||
|
||||
// Display auto-start settings.
|
||||
//$jail_autostart = exec("/usr/bin/grep -w {$item}_AUTO_START $configfile | cut -d'=' -f2 | tr -d '\"'");
|
||||
$jail_autostart = exec("/usr/bin/grep -w boot {$jail_dir}/{$item}/settings.conf | cut -d'=' -f2 | tr -d '\"'");
|
||||
if ($jail_autostart == 'on') {
|
||||
if ($jail_autostart == 'on'):
|
||||
$r['boot'] = $img_path['ena'];
|
||||
} elseif ($jail_autostart == 'off') {
|
||||
elseif ($jail_autostart == 'off'):
|
||||
$r['boot'] = $img_path['dis'];
|
||||
} else {
|
||||
else:
|
||||
$r['boot'] = $img_path['dis'];
|
||||
}
|
||||
endif;
|
||||
|
||||
// Display running status icons.
|
||||
$jail_running = exec("/usr/sbin/jls name | /usr/bin/awk '/^{$item}\$/'");
|
||||
if ($jail_running):
|
||||
@@ -286,6 +299,7 @@ function get_jail_infos() {
|
||||
else:
|
||||
$r['stat'] = $img_path['dis'];
|
||||
endif;
|
||||
|
||||
// Display custom template icons if available.
|
||||
$template_icon = "{$jail_dir}/{$item}/plugin_icon.png";
|
||||
if(file_exists($template_icon)):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_add.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
@@ -59,6 +59,12 @@ if(!get_all_release_list()):
|
||||
$prerequisites_ok = false;
|
||||
endif;
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
if($_POST):
|
||||
global $jail_dir;
|
||||
global $configfile;
|
||||
@@ -69,6 +75,12 @@ if($_POST):
|
||||
exit;
|
||||
endif;
|
||||
if(isset($_POST['Create']) && $_POST['Create']):
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Abort jail creation if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("Cannot create jail with an invalid ZFS configuration.");
|
||||
else:
|
||||
|
||||
$jname = $pconfig['jailname'];
|
||||
$ipaddr = $pconfig['ipaddress'];
|
||||
$release = $pconfig['release'];
|
||||
@@ -142,6 +154,8 @@ if($_POST):
|
||||
$errormsg .= gtext(" <<< Failed to create container.");
|
||||
endif;
|
||||
endif;
|
||||
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
@@ -316,7 +330,7 @@ $document->render();
|
||||
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()');
|
||||
//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);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_config.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Copyright (c) 2018 Andreas Schmidhuber
|
||||
@@ -64,6 +64,12 @@ if(!initial_install_banner()):
|
||||
$prerequisites_ok = false;
|
||||
endif;
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
function htmlInput($name, $title, $value="", $size=80) {
|
||||
$result = "<input name='{$name}' size='{$size}' title='{$title}' placeholder='{$title}' value='{$value}' />";
|
||||
return $result;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_editor.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_gui.php
|
||||
|
||||
Copyright (c) 2019-2020 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
@@ -53,11 +53,13 @@ $gt_record_mod = gtext('Utilities');
|
||||
$gt_selection_start = gtext('Start Selected');
|
||||
$gt_selection_stop = gtext('Stop Selected');
|
||||
$gt_selection_restart = gtext('Restart Selected');
|
||||
$gt_selection_autoboot = gtext('Auto-boot Selected');
|
||||
$gt_record_conf = gtext('Jail Configuration');
|
||||
$gt_record_inf = gtext('Information');
|
||||
$gt_selection_start_confirm = gtext('Do you really want to start selected jail(s)?');
|
||||
$gt_selection_stop_confirm = gtext('Do you want to stop the selected jail(s)?');
|
||||
$gt_selection_restart_confirm = gtext('Do you want to restart the selected jail(s)?');
|
||||
$gt_selection_autoboot_confirm = gtext('Do you want to set auto-boot on selected jail(s)?');
|
||||
$img_path = [
|
||||
'add' => 'images/add.png',
|
||||
'mod' => 'images/edit.png',
|
||||
@@ -90,6 +92,12 @@ if(!initial_install_banner()):
|
||||
$prerequisites_ok = false;
|
||||
endif;
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
if($_POST):
|
||||
if(isset($_POST['apply']) && $_POST['apply']):
|
||||
$ret = array('output' => [], 'retval' => 0);
|
||||
@@ -159,6 +167,24 @@ if($_POST):
|
||||
endif;
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
if(isset($_POST['autoboot_selected_jail']) && $_POST['autoboot_selected_jail']):
|
||||
$checkbox_member_array = isset($_POST[$checkbox_member_name]) ? $_POST[$checkbox_member_name] : [];
|
||||
foreach($checkbox_member_array as $checkbox_member_record):
|
||||
if(false !== ($index = array_search_ex($checkbox_member_record, $sphere_array, 'jailname'))):
|
||||
if(!isset($sphere_array[$index]['protected'])):
|
||||
$cmd = ("/usr/local/bin/bastille config {$checkbox_member_record} set boot on");
|
||||
$return_val = mwexec($cmd);
|
||||
if($return_val == 0):
|
||||
//$savemsg .= gtext("Jail(s) restarted successfully.");
|
||||
header($sphere_header);
|
||||
else:
|
||||
$errormsg .= gtext("Failed to restart jail(s).");
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
endforeach;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$pgtitle = [gtext("Extensions"), gtext('Bastille')];
|
||||
@@ -177,6 +203,9 @@ $(window).on("load", function() {
|
||||
$("#restart_selected_jail").click(function () {
|
||||
return confirm('<?=$gt_selection_restart_confirm;?>');
|
||||
});
|
||||
$("#autoboot_selected_jail").click(function () {
|
||||
return confirm('<?=$gt_selection_restart_confirm;?>');
|
||||
});
|
||||
// Disable action buttons.
|
||||
disableactionbuttons(true);
|
||||
|
||||
@@ -192,6 +221,7 @@ function disableactionbuttons(ab_disable) {
|
||||
$("#start_selected_jail").prop("disabled", ab_disable);
|
||||
$("#stop_selected_jail").prop("disabled", ab_disable);
|
||||
$("#restart_selected_jail").prop("disabled", ab_disable);
|
||||
$("#autoboot_selected_jail").prop("disabled", ab_disable);
|
||||
}
|
||||
|
||||
function controlactionbuttons(ego, triggerbyname) {
|
||||
@@ -362,6 +392,7 @@ $document->render();
|
||||
<input name="start_selected_jail" id="start_selected_jail" type="submit" class="formbtn" value="<?=$gt_selection_start;?>"/>
|
||||
<input name="stop_selected_jail" id="stop_selected_jail" type="submit" class="formbtn" value="<?=$gt_selection_stop;?>"/>
|
||||
<input name="restart_selected_jail" id="restart_selected_jail" type="submit" class="formbtn" value="<?=$gt_selection_restart;?>"/>
|
||||
<input name="autoboot_selected_jail" id="autoboot_selected_jail" type="submit" class="formbtn" value="<?=$gt_selection_autoboot;?>"/>
|
||||
</div>
|
||||
<?php
|
||||
include 'formend.inc';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_info.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
@@ -39,6 +39,12 @@ require_once 'auth.inc';
|
||||
require_once 'guiconfig.inc';
|
||||
require_once("bastille_manager-lib.inc");
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
function jls_get_jail_list(string $entity_name = NULL) {
|
||||
if(isset($entity_name)):
|
||||
$cmd = "/usr/sbin/jls -v -j $entity_name 2>&1";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_jconf.inc
|
||||
|
||||
Copyright (c) 2020 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -34,6 +34,12 @@ require_once 'auth.inc';
|
||||
require_once 'guiconfig.inc';
|
||||
require_once("bastille_manager-lib.inc");
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
if (isset($_GET['uuid']))
|
||||
$uuid = $_GET['uuid'];
|
||||
if (isset($_POST['uuid']))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_maintenance.php
|
||||
|
||||
Copyright (c) 2019-2020 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Copyright (c) 2016 Andreas Schmidhuber
|
||||
@@ -54,6 +54,12 @@ if(!initial_install_banner()):
|
||||
$prerequisites_ok = false;
|
||||
endif;
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
// For legacy product versions.
|
||||
$legacy_check = mwexec("/bin/cat /etc/prd.version | cut -d'.' -f1 | /usr/bin/grep '10'", true);
|
||||
if ($legacy_check == 0) {
|
||||
@@ -120,8 +126,8 @@ if ($_POST) {
|
||||
$uninstall_cmd = "echo 'y' | /usr/local/sbin/bastille-init -U";
|
||||
mwexec($uninstall_cmd, true);
|
||||
if (is_link("/usr/local/share/{$prdname}")) mwexec("rm /usr/local/share/{$prdname}", true);
|
||||
if (is_link("/var/cache/pkg")) mwexec("rm /var/cache/pkg", true);
|
||||
if (is_link("/var/db/pkg")) mwexec("rm /var/db/pkg && mkdir /var/db/pkg", true);
|
||||
//if (is_link("/var/cache/pkg")) mwexec("rm /var/cache/pkg", true);
|
||||
//if (is_link("/var/db/pkg")) mwexec("rm /var/db/pkg && mkdir /var/db/pkg", true);
|
||||
|
||||
// Remove start postinit cmd in later product versions.
|
||||
if (is_array($config['rc']) && is_array($config['rc']['param'])) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_tarballs.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
@@ -67,6 +67,13 @@ function get_rel_list() {
|
||||
endif;
|
||||
return $result;
|
||||
}
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
$rel_list = get_rel_list();
|
||||
$sphere_array = $rel_list;
|
||||
|
||||
@@ -76,26 +83,17 @@ if ($linux_compat_support == "YES"):
|
||||
'14.2-RELEASE' => gettext('14.2-RELEASE'),
|
||||
'14.1-RELEASE' => gettext('14.1-RELEASE'),
|
||||
'14.0-RELEASE' => gettext('14.0-RELEASE'),
|
||||
'13.5-RELEASE' => gettext('13.4-RELEASE'),
|
||||
'13.4-RELEASE' => gettext('13.4-RELEASE'),
|
||||
'13.3-RELEASE' => gettext('13.3-RELEASE'),
|
||||
'13.2-RELEASE' => gettext('13.2-RELEASE'),
|
||||
'13.1-RELEASE' => gettext('13.1-RELEASE'),
|
||||
'13.0-RELEASE' => gettext('13.0-RELEASE'),
|
||||
'12.4-RELEASE' => gettext('12.4-RELEASE'),
|
||||
'12.3-RELEASE' => gettext('12.3-RELEASE'),
|
||||
'12.2-RELEASE' => gettext('12.2-RELEASE'),
|
||||
'12.1-RELEASE' => gettext('12.1-RELEASE'),
|
||||
'12.0-RELEASE' => gettext('12.0-RELEASE'),
|
||||
'11.4-RELEASE' => gettext('11.4-RELEASE'),
|
||||
'11.3-RELEASE' => gettext('11.3-RELEASE'),
|
||||
'11.2-RELEASE' => gettext('11.2-RELEASE'),
|
||||
'ubuntu-jammy' => gettext('Ubuntu-Jammy'),
|
||||
'ubuntu-focal' => gettext('Ubuntu-Focal'),
|
||||
'ubuntu-bionic' => gettext('Ubuntu-Bionic'),
|
||||
'debian-bookworm' => gettext('Debian-Bookworm'),
|
||||
'debian-bullseye' => gettext('Debian-Bullseye'),
|
||||
'debian-buster' => gettext('Debian-Buster'),
|
||||
//'debian-stretch' => gettext('Debian-Stretch'), -> Obsolete, removed from bastille boostrap.
|
||||
// Linux base release bootstrap is allowed from command-line.
|
||||
//'ubuntu-jammy' => gettext('Ubuntu-noble'),
|
||||
//'ubuntu-jammy' => gettext('Ubuntu-Jammy'),
|
||||
//'ubuntu-focal' => gettext('Ubuntu-Focal'),
|
||||
//'ubuntu-bionic' => gettext('Ubuntu-Bionic'),
|
||||
//'debian-bookworm' => gettext('Debian-Bookworm'),
|
||||
//'debian-bullseye' => gettext('Debian-Bullseye'),
|
||||
//'debian-buster' => gettext('Debian-Buster'),
|
||||
//'debian-stretch' => gettext('Debian-Stretch'),
|
||||
];
|
||||
else:
|
||||
$a_action = [
|
||||
@@ -103,19 +101,8 @@ else:
|
||||
'14.2-RELEASE' => gettext('14.2-RELEASE'),
|
||||
'14.1-RELEASE' => gettext('14.1-RELEASE'),
|
||||
'14.0-RELEASE' => gettext('14.0-RELEASE'),
|
||||
'13.5-RELEASE' => gettext('13.4-RELEASE'),
|
||||
'13.4-RELEASE' => gettext('13.4-RELEASE'),
|
||||
'13.3-RELEASE' => gettext('13.3-RELEASE'),
|
||||
'13.2-RELEASE' => gettext('13.2-RELEASE'),
|
||||
'13.1-RELEASE' => gettext('13.1-RELEASE'),
|
||||
'13.0-RELEASE' => gettext('13.0-RELEASE'),
|
||||
'12.4-RELEASE' => gettext('12.4-RELEASE'),
|
||||
'12.3-RELEASE' => gettext('12.3-RELEASE'),
|
||||
'12.2-RELEASE' => gettext('12.2-RELEASE'),
|
||||
'12.1-RELEASE' => gettext('12.1-RELEASE'),
|
||||
'12.0-RELEASE' => gettext('12.0-RELEASE'),
|
||||
'11.4-RELEASE' => gettext('11.4-RELEASE'),
|
||||
'11.3-RELEASE' => gettext('11.3-RELEASE'),
|
||||
'11.2-RELEASE' => gettext('11.2-RELEASE'),
|
||||
];
|
||||
endif;
|
||||
|
||||
@@ -137,6 +124,7 @@ if($_POST):
|
||||
$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";
|
||||
$zfs_status = get_state_zfs();
|
||||
|
||||
//unset($lib32,$ports,$src);
|
||||
if (isset($_POST['lib32'])):
|
||||
@@ -150,12 +138,12 @@ if($_POST):
|
||||
endif;
|
||||
$opt_tarballs = "$lib32 $ports $src";
|
||||
|
||||
// FreeBSD base release check.
|
||||
//if(file_exists($check_release)):
|
||||
// $savemsg .= sprintf(gtext('%s base appears to be already extracted.'),$get_release);
|
||||
//else:
|
||||
// Download a FreeBSD base release.
|
||||
if ($_POST['Download']):
|
||||
// Download a FreeBSD base release.
|
||||
if ($_POST['Download']):
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Abort bootstrap if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("Cannot bootstrap with an invalid ZFS configuration.");
|
||||
else:
|
||||
$savemsg = "";
|
||||
$errormsg = "";
|
||||
if ($opt_tarballs):
|
||||
@@ -179,8 +167,9 @@ if($_POST):
|
||||
else:
|
||||
$errormsg .= sprintf(gtext('%s Failed to download and/or extract release base.'),$get_release);
|
||||
endif;
|
||||
|
||||
endif;
|
||||
//endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if (isset($_POST['Destroy']) && $_POST['Destroy']):
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
bastille_manager_util.php
|
||||
|
||||
Copyright (c) 2019 José Rivera (joserprg@gmail.com).
|
||||
Copyright (c) 2019-2025 Jose Rivera (joserprg@gmail.com).
|
||||
All rights reserved.
|
||||
|
||||
Portions of XigmaNAS® (https://www.xigmanas.com).
|
||||
@@ -39,6 +39,12 @@ require_once 'auth.inc';
|
||||
require_once 'guiconfig.inc';
|
||||
require_once("bastille_manager-lib.inc");
|
||||
|
||||
$zfs_status = get_state_zfs();
|
||||
if($zfs_status == "Invalid ZFS configuration"):
|
||||
// Warning if invalid ZFS configuration.
|
||||
$input_errors[] = gtext("WARNING: Invalid ZFS configuration detected.");
|
||||
endif;
|
||||
|
||||
if(isset($_GET['uuid'])):
|
||||
$uuid = $_GET['uuid'];
|
||||
endif;
|
||||
|
||||
Reference in New Issue
Block a user