Please provide the file changes (diffs) for me to generate a commit message.
This commit is contained in:
@@ -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");
|
|
||||||
|
// 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;
|
$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):
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ 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';
|
||||||
@@ -134,7 +135,8 @@ if($_POST):
|
|||||||
|
|
||||||
if ($_POST['Create']):
|
if ($_POST['Create']):
|
||||||
if (get_all_release_list()):
|
if (get_all_release_list()):
|
||||||
unset($output,$retval);mwexec2($cmd,$output,$retval);
|
unset($output, $retval);
|
||||||
|
mwexec2($cmd, $output, $retval);
|
||||||
if ($retval == 0):
|
if ($retval == 0):
|
||||||
//if (isset($_POST['autostart'])):
|
//if (isset($_POST['autostart'])):
|
||||||
// exec("/usr/sbin/sysrc -f {$configfile} {$jname}_AUTO_START=\"YES\"");
|
// 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);
|
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">
|
||||||
|
<table id="area_data">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td id="area_data_frame">
|
||||||
<?php
|
<?php
|
||||||
if (!empty($errormsg)):
|
if (!empty($errormsg)):
|
||||||
print_error_box($errormsg);
|
print_error_box($errormsg);
|
||||||
@@ -311,7 +317,7 @@ $document->render();
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<?php
|
<?php
|
||||||
html_titleline2(gettext('Create new Container'));
|
html_titleline2(gettext('Create new Container'), 2);
|
||||||
?>
|
?>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -330,7 +336,7 @@ $document->render();
|
|||||||
endif;
|
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('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"):
|
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;
|
||||||
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('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
|
<?php
|
||||||
include 'formend.inc';
|
include 'formend.inc';
|
||||||
?>
|
?>
|
||||||
</td></tr></tbody></table></form>
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
emptyjail_change();
|
emptyjail_change();
|
||||||
|
|||||||
Reference in New Issue
Block a user