Check/update bastille config parameters on runtime

This commit is contained in:
JRGTH
2026-02-05 23:59:40 -04:00
parent 9c8043a71f
commit d818e9a96c
4 changed files with 29 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
======================
Version Description
1.3.01......Check/update bastille config parameters on runtime.
1.3.00......Code improvements/fixes and dashboard cosmetic changes.
1.2.31......Minor cosmetic/wording changes.
1.2.30......Add auto and live export modes, add ZST compression support.

19
bastille-init Normal file → Executable file
View File

@@ -1516,6 +1516,25 @@ update_config()
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_decompress_zst_options="-k -d -c -v"
fi
# Check/append pkgbase parameters.
if ! grep -qw 'bastille_pkgbase_packages=' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_pkgbase_packages="base-jail"
fi
# Check/append monitor parameters.
if ! grep -qw 'bastille_monitor_cron_path=' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_monitor_cron_path="/usr/local/etc/cron.d/bastille-monitor"
fi
if ! grep -qw 'bastille_monitor_cron=' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_monitor_cron="*/5 * * * * root /usr/local/bin/bastille monitor ALL >/dev/null 2>&1"
fi
if ! grep -qw 'bastille_monitor_logfile=' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_monitor_logfile="\${bastille_logsdir}/monitor.log"
fi
if ! grep -qw 'bastille_monitor_healthchecks=' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} bastille_monitor_healthchecks=""
fi
# Remove deprecated parameters based on minimum version.
if grep -qw 'bastille_jail_interface' ${INSTALLPATH}/${BASTILLECONF}; then
sysrc -f ${INSTALLPATH}/${BASTILLECONF} -x bastille_jail_interface

View File

@@ -9,12 +9,12 @@ bastille_logsdir="${bastille_prefix}/logs"
bastille_pf_conf="${bastille_prefix}/pf.conf"
bastille_sharedir="/usr/local/share/bastille"
bastille_bootstrap_archives="base"
bastille_pkgbase_packages="base-jail"
bastille_tzdata="etc/UTC"
bastille_resolv_conf="/etc/resolv.conf"
bastille_url_freebsd="http://ftp.freebsd.org/pub/FreeBSD/releases/"
bastille_url_hardenedbsd="https://installers.hardenedbsd.org/pub/"
bastille_url_midnightbsd="https://www.midnightbsd.org/ftp/MidnightBSD/releases/"
bastille_url_midnightbsd="https://www.midnightbsd.org/ftp/MidnightBSD/releases/"
bastille_zfs_enable=""
bastille_zfs_zpool=""
bastille_zfs_prefix="bastille"
@@ -23,13 +23,15 @@ bastille_compress_xz_options="-0 -v"
bastille_decompress_xz_options="-c -d -v"
bastille_compress_gz_options="-1 -v"
bastille_decompress_gz_options="-k -d -c -v"
bastille_compress_zst_options="-3 -v"
bastille_decompress_zst_options="-k -d -c -v"
bastille_network_vnet_type="if_bridge"
bastille_network_loopback=""
bastille_network_pf_ext_if="ext_if"
bastille_network_pf_table="jails"
bastille_network_shared=""
bastille_network_gateway=""
bastille_network_gateway6=""
bastille_network_gateway6=""
bastille_template_base="default/base"
bastille_template_empty=""
bastille_template_thick="default/thick"
@@ -37,3 +39,7 @@ bastille_template_clone="default/clone"
bastille_template_thin="default/thin"
bastille_template_vnet="default/vnet"
bastille_template_vlan="default/vlan"
bastille_monitor_cron_path="/usr/local/etc/cron.d/bastille-monitor"
bastille_monitor_cron="*/5 * * * * root /usr/local/bin/bastille monitor ALL >/dev/null 2>&1"
bastille_monitor_logfile="${bastille_logsdir}/monitor.log"
bastille_monitor_healthchecks=""

View File

@@ -1 +1 @@
1.3.00
1.3.01