Please provide the file changes (diffs) for me to generate a commit message.

This commit is contained in:
2026-02-22 10:26:29 +01:00
parent ae70375f08
commit 239445a29d
3 changed files with 298 additions and 267 deletions
+7
View File
@@ -1 +1,8 @@
.idea
/mock/
/bin/
/releases/
/jails/
/router.php
/debug_vars.php
/conf/bastille_config
+22 -8
View File
@@ -46,8 +46,18 @@ $prdname = "bastille";
$application = "Bastille Manager";
$restore_name = "restore";
$confdir = "/var/etc/bastille_conf";
$cwdir = exec("/usr/bin/grep 'INSTALL_DIR=' $confdir/conf/bastille_config | /usr/bin/cut -d'\"' -f2");
// 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_bastille = "$rootfolder/bastille-dist/usr/local/etc/bastille/bastille.conf";
$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.
$logfile = "$rootfolder/log/bastille_ext.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";
$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");
$jail_dir = "{$rootfolder}/jails";
$image_dir = "ext/bastille/images";
$reldir = "{$rootfolder}/releases";
$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_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $configfile | /usr/bin/cut -d'\"' -f2");
$tarballversion = "/usr/local/bin/bastille";
$zfs_support = exec("/usr/bin/grep 'ZFS_SUPPORT=' $grep_config | /usr/bin/cut -d'\"' -f2");
$zfs_activated = exec("/usr/bin/grep 'ZFS_ACTIVATED=' $grep_config | /usr/bin/cut -d'\"' -f2");
if (!isset($tarballversion)) $tarballversion = "/usr/local/bin/bastille";
$bastille_version_min = exec("grep 'BASTILLE_VERSION=' $tarballversion | cut -d '\"' -f2 | 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";
// Ensure the root directory is configured.
@@ -146,7 +160,7 @@ function get_state_zfs() {
function get_all_release_list() {
global $rootfolder;
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);
$rellist = [];
foreach($relinfo as $rel):
+15 -5
View File
@@ -42,6 +42,7 @@ require_once("bastille_manager-lib.inc");
$pgtitle = array(gtext("Extensions"), "Bastille", "Create");
$pconfig = [];
$errormsg = "";
if (!(isset($pconfig['jailname']))):
$pconfig['jailname'] = 'jail1';
@@ -134,7 +135,8 @@ if($_POST):
if ($_POST['Create']):
if (get_all_release_list()):
unset($output,$retval);mwexec2($cmd,$output,$retval);
unset($output, $retval);
mwexec2($cmd, $output, $retval);
if ($retval == 0):
//if (isset($_POST['autostart'])):
// exec("/usr/sbin/sysrc -f {$configfile} {$jname}_AUTO_START=\"YES\"");
@@ -289,7 +291,11 @@ $document->
ins_tabnav_record('bastille_manager_maintenance.php', gettext('Maintenance'), gettext('Reload page'), true);
$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">
<table id="area_data">
<tbody>
<tr>
<td id="area_data_frame">
<?php
if (!empty($errormsg)):
print_error_box($errormsg);
@@ -311,7 +317,7 @@ $document->render();
</colgroup>
<thead>
<?php
html_titleline2(gettext('Create new Container'));
html_titleline2(gettext('Create new Container'), 2);
?>
</thead>
<tbody>
@@ -330,7 +336,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);
@@ -345,7 +351,11 @@ $document->render();
<?php
include 'formend.inc';
?>
</td></tr></tbody></table></form>
</td>
</tr>
</tbody>
</table>
</form>
<script type="text/javascript">
<!--
emptyjail_change();