From 6ba11dc762c7d882f84144adbd3e173befdd3906 Mon Sep 17 00:00:00 2001 From: tschettervictor Date: Sat, 1 Mar 2025 18:48:14 -0700 Subject: [PATCH 01/20] bastille: Support user based config This PR will allow bastille to be configured based on the user you run as. To load the config for a specifig user, you must be logged in as the specified user, and there must be a file called "bastille_user.conf" inside /usr/local/etc/bastille or else bastille will just load the default config file. --- usr/local/share/bastille/bootstrap.sh | 2 +- usr/local/share/bastille/clone.sh | 2 +- usr/local/share/bastille/cmd.sh | 2 +- usr/local/share/bastille/common.sh | 17 ++++++++++++----- usr/local/share/bastille/config.sh | 2 +- usr/local/share/bastille/console.sh | 2 +- usr/local/share/bastille/convert.sh | 2 +- usr/local/share/bastille/cp.sh | 2 +- usr/local/share/bastille/create.sh | 2 +- usr/local/share/bastille/destroy.sh | 2 +- usr/local/share/bastille/edit.sh | 2 +- usr/local/share/bastille/etcupdate.sh | 2 +- usr/local/share/bastille/export.sh | 2 +- usr/local/share/bastille/htop.sh | 2 +- usr/local/share/bastille/import.sh | 2 +- usr/local/share/bastille/jcp.sh | 2 +- usr/local/share/bastille/limits.sh | 2 +- usr/local/share/bastille/list.sh | 2 +- usr/local/share/bastille/mount.sh | 2 +- usr/local/share/bastille/pkg.sh | 2 +- usr/local/share/bastille/rcp.sh | 2 +- usr/local/share/bastille/rdr.sh | 2 +- usr/local/share/bastille/rename.sh | 2 +- usr/local/share/bastille/service.sh | 1 + usr/local/share/bastille/setup.sh | 4 +--- usr/local/share/bastille/start.sh | 2 +- usr/local/share/bastille/stop.sh | 2 +- usr/local/share/bastille/sysrc.sh | 2 +- usr/local/share/bastille/tags.sh | 2 +- usr/local/share/bastille/template.sh | 2 +- usr/local/share/bastille/top.sh | 2 +- usr/local/share/bastille/umount.sh | 2 +- usr/local/share/bastille/update.sh | 2 +- usr/local/share/bastille/upgrade.sh | 2 +- usr/local/share/bastille/verify.sh | 2 +- usr/local/share/bastille/zfs.sh | 2 +- 36 files changed, 47 insertions(+), 41 deletions(-) diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index 74219638..c7d97dbc 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille bootstrap [option(s)] [RELEASE|TEMPLATE] [update|arch]" diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 0db63835..74a88b78 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille clone [option(s)] TARGET NEW_NAME IP_ADDRESS" diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index 0d958973..cca0082e 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille cmd [option(s)] TARGET command" diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index fd62d6e2..763b0d17 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -30,11 +30,6 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# Source config file -if [ -f /usr/local/etc/bastille/bastille.conf ]; then - . /usr/local/etc/bastille/bastille.conf -fi - COLOR_RED= COLOR_GREEN= COLOR_YELLOW= @@ -48,6 +43,18 @@ bastille_root_check() { fi } +load_config() { + _user="$(id -un)" + if [ "${_user}" != "root" ] && [ -r "/usr/local/etc/bastille/bastille_${_user}.conf" ]; then + . /usr/local/etc/bastille/bastille_${_user}.conf + else + . /usr/local/etc/bastille/bastille.conf + fi +} + +# Load configuration file +load_config + enable_color() { . /usr/local/share/bastille/colors.pre.sh } diff --git a/usr/local/share/bastille/config.sh b/usr/local/share/bastille/config.sh index a6ff11c5..0323d470 100644 --- a/usr/local/share/bastille/config.sh +++ b/usr/local/share/bastille/config.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille config TARGET [get|set] PROPERTY_NAME NEW_VALUE" diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index 33851a05..7b133287 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille console [option(s)] TARGET [user]" diff --git a/usr/local/share/bastille/convert.sh b/usr/local/share/bastille/convert.sh index d5d5b582..8b6d66fe 100644 --- a/usr/local/share/bastille/convert.sh +++ b/usr/local/share/bastille/convert.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille convert [option(s)] TARGET" diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 0d1b53a1..c23a17e7 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille cp [option(s)] TARGET HOST_PATH JAIL_PATH" diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 8ddcd11a..2f3783a5 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { # Build an independent usage for the create command diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index b18a670a..d590adf1 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille destroy [option(s)] [JAIL|RELEASE]" diff --git a/usr/local/share/bastille/edit.sh b/usr/local/share/bastille/edit.sh index 50c0ed88..0298da89 100644 --- a/usr/local/share/bastille/edit.sh +++ b/usr/local/share/bastille/edit.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille edit [option(s)] TARGET [filename]" diff --git a/usr/local/share/bastille/etcupdate.sh b/usr/local/share/bastille/etcupdate.sh index 2f625d41..4db33e7b 100644 --- a/usr/local/share/bastille/etcupdate.sh +++ b/usr/local/share/bastille/etcupdate.sh @@ -28,7 +28,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille etcupdate [option(s)] [bootstrap|TARGET] [diff|resolve|update RELEASE]" diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index f4d07fd4..584f1e36 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { # Build an independent usage for the export command diff --git a/usr/local/share/bastille/htop.sh b/usr/local/share/bastille/htop.sh index d6b108d8..1e0f796e 100644 --- a/usr/local/share/bastille/htop.sh +++ b/usr/local/share/bastille/htop.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille htop [option(s)] TARGET" diff --git a/usr/local/share/bastille/import.sh b/usr/local/share/bastille/import.sh index d76c8858..ec55fbd4 100644 --- a/usr/local/share/bastille/import.sh +++ b/usr/local/share/bastille/import.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { # Build an independent usage for the import command diff --git a/usr/local/share/bastille/jcp.sh b/usr/local/share/bastille/jcp.sh index fc8cf05e..ac2aa490 100644 --- a/usr/local/share/bastille/jcp.sh +++ b/usr/local/share/bastille/jcp.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille jcp [option(s)] SOURCE_JAIL JAIL_PATH DEST_JAIL JAIL_PATH" diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index 0418ffd7..b20b2a12 100644 --- a/usr/local/share/bastille/limits.sh +++ b/usr/local/share/bastille/limits.sh @@ -32,7 +32,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille limits [option(s)] TARGET OPTION VALUE" diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index c01875ab..3fd0dec5 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille list [option(s)] [-j|-a] [RELEASE (-p)] [template] [JAIL|CONTAINER] [log] [limit] [import] [export] [backup]" diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index f13c98ed..dd0e7bc0 100644 --- a/usr/local/share/bastille/mount.sh +++ b/usr/local/share/bastille/mount.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille mount [option(s)] TARGET HOST_PATH JAIL_PATH [filesystem_type options dump pass_number]" diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index c69f6763..fe4a000e 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille pkg [option(s)] TARGET COMMAND args" diff --git a/usr/local/share/bastille/rcp.sh b/usr/local/share/bastille/rcp.sh index f3880a0f..0c82b299 100644 --- a/usr/local/share/bastille/rcp.sh +++ b/usr/local/share/bastille/rcp.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille rcp [option(s)] TARGET JAIL_PATH HOST_PATH" diff --git a/usr/local/share/bastille/rdr.sh b/usr/local/share/bastille/rdr.sh index ef1e60a8..bc9c26b7 100644 --- a/usr/local/share/bastille/rdr.sh +++ b/usr/local/share/bastille/rdr.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille rdr [option(s)] TARGET [clear|reset|list|(tcp|udp)] HOST_PORT JAIL_PORT [log ['(' logopts ')'] ]" diff --git a/usr/local/share/bastille/rename.sh b/usr/local/share/bastille/rename.sh index 7aa887b8..41600f75 100644 --- a/usr/local/share/bastille/rename.sh +++ b/usr/local/share/bastille/rename.sh @@ -29,7 +29,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille rename [option(s)] TARGET NEW_NAME" diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 40551def..1bb7fc27 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -31,6 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh +load_config usage() { error_notify "Usage: bastille service [options(s)] TARGET SERVICE_NAME ACTION" diff --git a/usr/local/share/bastille/setup.sh b/usr/local/share/bastille/setup.sh index 020d2cf4..726c08f8 100644 --- a/usr/local/share/bastille/setup.sh +++ b/usr/local/share/bastille/setup.sh @@ -30,10 +30,8 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -bastille_config="/usr/local/etc/bastille/bastille.conf" . /usr/local/share/bastille/common.sh -# shellcheck source=/usr/local/etc/bastille/bastille.conf -. ${bastille_config} +load_config usage() { error_exit "Usage: bastille setup [pf|network|zfs|vnet]" diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 8a0960d1..923b338b 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille start [option(s)] TARGET" diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index faafe4cc..0a921baf 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille stop [option(s)] TARGET" diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index f2361ab1..3b5bbb19 100644 --- a/usr/local/share/bastille/sysrc.sh +++ b/usr/local/share/bastille/sysrc.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille sysrc [option(s)] TARGET args" diff --git a/usr/local/share/bastille/tags.sh b/usr/local/share/bastille/tags.sh index 0285570f..3bba6941 100644 --- a/usr/local/share/bastille/tags.sh +++ b/usr/local/share/bastille/tags.sh @@ -32,7 +32,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille tags TARGET [add|delete|list] [tag1,tag2]" diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index eec08752..5c4de5ee 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille template [option(s)] TARGET [--convert|project/template]" diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index ef2a8bcb..3883b126 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille top [options(s)] TARGET" diff --git a/usr/local/share/bastille/umount.sh b/usr/local/share/bastille/umount.sh index 89017dfd..36a147cc 100644 --- a/usr/local/share/bastille/umount.sh +++ b/usr/local/share/bastille/umount.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille umount [option(s)] TARGET JAIL_PATH" diff --git a/usr/local/share/bastille/update.sh b/usr/local/share/bastille/update.sh index 1a387b36..a5665b78 100644 --- a/usr/local/share/bastille/update.sh +++ b/usr/local/share/bastille/update.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille update [option(s)] TARGET" diff --git a/usr/local/share/bastille/upgrade.sh b/usr/local/share/bastille/upgrade.sh index 5d92d181..eb2b7e0a 100644 --- a/usr/local/share/bastille/upgrade.sh +++ b/usr/local/share/bastille/upgrade.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille upgrade [option(s)] TARGET [NEWRELEASE|install]" diff --git a/usr/local/share/bastille/verify.sh b/usr/local/share/bastille/verify.sh index b82b5d93..7309883d 100644 --- a/usr/local/share/bastille/verify.sh +++ b/usr/local/share/bastille/verify.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille verify [RELEASE|TEMPLATE]" diff --git a/usr/local/share/bastille/zfs.sh b/usr/local/share/bastille/zfs.sh index 8ffef062..8d1e6cc2 100644 --- a/usr/local/share/bastille/zfs.sh +++ b/usr/local/share/bastille/zfs.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf +load_config usage() { error_notify "Usage: bastille zfs TARGET [set|get|snap|destroy_snap|df|usage] [key=value|date]" From b09ee860372143c888c132827ef0bca28681b9c4 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 18:51:17 -0700 Subject: [PATCH 02/20] Fix shellcheck --- usr/local/share/bastille/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index 763b0d17..ddc00a91 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -46,6 +46,7 @@ bastille_root_check() { load_config() { _user="$(id -un)" if [ "${_user}" != "root" ] && [ -r "/usr/local/etc/bastille/bastille_${_user}.conf" ]; then + # shellcheck disable=SC1090 . /usr/local/etc/bastille/bastille_${_user}.conf else . /usr/local/etc/bastille/bastille.conf From b5611e9196eba458c7736210110aee4af77b15e3 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 20:03:03 -0700 Subject: [PATCH 03/20] common: Load config as variable --- usr/local/share/bastille/common.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index ddc00a91..262e6ecf 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -44,13 +44,8 @@ bastille_root_check() { } load_config() { - _user="$(id -un)" - if [ "${_user}" != "root" ] && [ -r "/usr/local/etc/bastille/bastille_${_user}.conf" ]; then - # shellcheck disable=SC1090 - . /usr/local/etc/bastille/bastille_${_user}.conf - else - . /usr/local/etc/bastille/bastille.conf - fi + # shellcheck disable=SC1090 + . ${BASTILLE_CONFIG} } # Load configuration file From fab14ffe7c72dae03544ed7e53dacce33e66a857 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:14:56 -0700 Subject: [PATCH 04/20] bastille: Allow setting config file --- usr/local/bin/bastille | 61 +++++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index d347952c..9be4f78f 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -31,6 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PATH=${PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +. /usr/local/share/bastille/common.sh ## check for config existence bastille_conf_check() { @@ -54,12 +55,6 @@ bastille_conf_check() { fi } -bastille_conf_check - -## we only load this if conf_check passes -. /usr/local/share/bastille/common.sh -. /usr/local/etc/bastille/bastille.conf - ## bastille_prefix should be 0750 ## this restricts file system access to privileged users bastille_perms_check() { @@ -72,11 +67,6 @@ bastille_perms_check() { fi } -bastille_perms_check - -## version -BASTILLE_VERSION="0.13.20250126" - usage() { cat << EOF Bastille is an open-source system for automating deployment and management of @@ -131,6 +121,48 @@ EOF exit 1 } +bastille_conf_check +bastille_perms_check + +BASTILLE_VERSION="0.13.20250126" + +# Handle options +while [ "$#" -gt 0 ]; do + case "${1}" in + -h|--help|help) + usage + ;; + version|-v|--version) + info "${BASTILLE_VERSION}" + exit 0 + ;; + -c|--config) + BASTILLE_CONFIG="${2}" + if [ -r "${BASTILLE_CONFIG}" ]; then + info "Using custom config: ${BASTILLE_CONFIG}" + elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then + BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}" + info "Using custom config: ${BASTILLE_CONFIG}" + else + error_exit "Not a valid config file: ${BASTILLE_CONFIG}" + fi + shift 2 + ;; + -*) + for _opt in $(echo ${1} | sed 's/-//g' | fold -w1); do + case ${_opt} in + x) enable_debug ;; + a) AUTO=1 ;; + *) error_exit "Unknown Option: \"${1}\"" ;; + esac + done + shift + ;; + *) + break + ;; + esac +done if [ "$#" -lt 1 ]; then usage else @@ -140,13 +172,6 @@ fi # Handle special-case commands first. case "${CMD}" in - version|-v|--version) - info "${BASTILLE_VERSION}" - exit 0 - ;; - help|-h|--help) - usage - ;; bootstrap| \ clone| \ cmd| \ From efcfe7c2b09a718dcd29b637c6d946cd013b1f6d Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:21:18 -0700 Subject: [PATCH 05/20] bastille: export BASTILLE_CONFIG --- usr/local/bin/bastille | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 9be4f78f..7024050f 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -116,6 +116,7 @@ Available Commands: Use "bastille -v|--version" for version information. Use "bastille command -h|--help" for more information about a command. +Use "bastille -c|--config command" to slecify a non-defaukt config file. EOF exit 1 @@ -125,6 +126,8 @@ bastille_conf_check bastille_perms_check BASTILLE_VERSION="0.13.20250126" +BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf +export BASTILLE_CONFIG # Handle options while [ "$#" -gt 0 ]; do @@ -140,9 +143,11 @@ while [ "$#" -gt 0 ]; do BASTILLE_CONFIG="${2}" if [ -r "${BASTILLE_CONFIG}" ]; then info "Using custom config: ${BASTILLE_CONFIG}" + export BASTILLE_CONFIG elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}" info "Using custom config: ${BASTILLE_CONFIG}" + export BASTILLE_CONFIG else error_exit "Not a valid config file: ${BASTILLE_CONFIG}" fi From 3dd3956a88857317e5d0e258a4e29bf38eaff62c Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:33:54 -0700 Subject: [PATCH 06/20] bastille: Export only if env not set --- usr/local/bin/bastille | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 7024050f..ce42753a 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -116,7 +116,7 @@ Available Commands: Use "bastille -v|--version" for version information. Use "bastille command -h|--help" for more information about a command. -Use "bastille -c|--config command" to slecify a non-defaukt config file. +Use "bastille -c|--config command" to specify a non-defaukt config file. EOF exit 1 @@ -126,8 +126,10 @@ bastille_conf_check bastille_perms_check BASTILLE_VERSION="0.13.20250126" -BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf -export BASTILLE_CONFIG +if [ -z "${BASTILLE_CONFIG}" ]; then + BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf + export BASTILLE_CONFIG +fi # Handle options while [ "$#" -gt 0 ]; do From 58cb2ccdf769ec72eb4151f9ec8e5dbcdfc584d8 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:38:13 -0700 Subject: [PATCH 07/20] Load config after setting BASTILLE_CONFIG --- usr/local/bin/bastille | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index ce42753a..ae0da199 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PATH=${PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin -. /usr/local/share/bastille/common.sh ## check for config existence bastille_conf_check() { @@ -131,6 +130,9 @@ if [ -z "${BASTILLE_CONFIG}" ]; then export BASTILLE_CONFIG fi +# Load common.sh after setting BASTILLE_CONFIG +. /usr/local/share/bastille/common.sh + # Handle options while [ "$#" -gt 0 ]; do case "${1}" in From 9c1fa6eb91c8ebb16ae659ab890164dfaa5abc35 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:00:06 -0700 Subject: [PATCH 08/20] bastille: Load config if set in ENV --- usr/local/bin/bastille | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index ae0da199..228b9eaf 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -128,7 +128,16 @@ BASTILLE_VERSION="0.13.20250126" if [ -z "${BASTILLE_CONFIG}" ]; then BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf export BASTILLE_CONFIG -fi +elif [ -r "${BASTILLE_CONFIG}" ]; then + info "Using custom config: ${BASTILLE_CONFIG}" + export BASTILLE_CONFIG +elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then + BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}" + info "Using custom config: ${BASTILLE_CONFIG}" + export BASTILLE_CONFIG +else + error_exit "Not a valid config file: ${BASTILLE_CONFIG}" +fi # Load common.sh after setting BASTILLE_CONFIG . /usr/local/share/bastille/common.sh From 4a1fb4bf89f9f6f895f28e490949f41e1e5ab06f Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:02:01 -0700 Subject: [PATCH 09/20] bastille: Exit instead of info --- usr/local/bin/bastille | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 228b9eaf..f5afeda9 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -129,14 +129,13 @@ if [ -z "${BASTILLE_CONFIG}" ]; then BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf export BASTILLE_CONFIG elif [ -r "${BASTILLE_CONFIG}" ]; then - info "Using custom config: ${BASTILLE_CONFIG}" export BASTILLE_CONFIG elif [ -r "/usr/local/etc/bastille/${BASTILLE_CONFIG}" ]; then BASTILLE_CONFIG="/usr/local/etc/bastille/${BASTILLE_CONFIG}" - info "Using custom config: ${BASTILLE_CONFIG}" export BASTILLE_CONFIG else - error_exit "Not a valid config file: ${BASTILLE_CONFIG}" + echo "Not a valid config file: ${BASTILLE_CONFIG}" + exit 1 fi # Load common.sh after setting BASTILLE_CONFIG From 454288b2b13d7746cec8d006029b54562503ef2d Mon Sep 17 00:00:00 2001 From: tschettervictor Date: Sun, 2 Mar 2025 11:23:35 -0700 Subject: [PATCH 10/20] bastille: Load config only from commons.sh Since all files source common.sh anyway, we don't want to source the config twice. --- usr/local/bin/bastille | 11 ++++++----- usr/local/share/bastille/bootstrap.sh | 1 - usr/local/share/bastille/clone.sh | 1 - usr/local/share/bastille/cmd.sh | 1 - usr/local/share/bastille/common.sh | 13 +++++-------- usr/local/share/bastille/config.sh | 2 +- usr/local/share/bastille/console.sh | 1 - usr/local/share/bastille/convert.sh | 1 - usr/local/share/bastille/cp.sh | 1 - usr/local/share/bastille/create.sh | 1 - usr/local/share/bastille/destroy.sh | 1 - usr/local/share/bastille/edit.sh | 1 - usr/local/share/bastille/etcupdate.sh | 1 - usr/local/share/bastille/export.sh | 1 - usr/local/share/bastille/htop.sh | 1 - usr/local/share/bastille/import.sh | 1 - usr/local/share/bastille/jcp.sh | 1 - usr/local/share/bastille/limits.sh | 1 - usr/local/share/bastille/list.sh | 1 - usr/local/share/bastille/mount.sh | 1 - usr/local/share/bastille/pkg.sh | 1 - usr/local/share/bastille/rcp.sh | 1 - usr/local/share/bastille/rdr.sh | 1 - usr/local/share/bastille/rename.sh | 1 - usr/local/share/bastille/service.sh | 1 - usr/local/share/bastille/setup.sh | 1 - usr/local/share/bastille/start.sh | 1 - usr/local/share/bastille/stop.sh | 1 - usr/local/share/bastille/sysrc.sh | 1 - usr/local/share/bastille/tags.sh | 1 - usr/local/share/bastille/template.sh | 1 - usr/local/share/bastille/top.sh | 1 - usr/local/share/bastille/umount.sh | 1 - usr/local/share/bastille/update.sh | 1 - usr/local/share/bastille/upgrade.sh | 1 - usr/local/share/bastille/verify.sh | 1 - usr/local/share/bastille/zfs.sh | 1 - 37 files changed, 12 insertions(+), 48 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index f5afeda9..5f6fab92 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -32,6 +32,8 @@ PATH=${PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin +BASTILLE_VERSION="0.13.20250126" + ## check for config existence bastille_conf_check() { if [ ! -r "/usr/local/etc/bastille/bastille.conf" ]; then @@ -72,7 +74,7 @@ Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD. Usage: - bastille command TARGET [args] + bastille command [option(s)] TARGET [args] Available Commands: bootstrap Bootstrap a FreeBSD release for container base. @@ -113,9 +115,9 @@ Available Commands: verify Compare release against a "known good" index. zfs Manage (get|set) ZFS attributes on targeted container(s). -Use "bastille -v|--version" for version information. -Use "bastille command -h|--help" for more information about a command. -Use "bastille -c|--config command" to specify a non-defaukt config file. +Use "bastille [-v|--version]" for version information. +Use "bastille command [-h|--help]" for more information about a command. +Use "bastille [-c|--config config.conf] command" to specify a non-default config file. EOF exit 1 @@ -124,7 +126,6 @@ EOF bastille_conf_check bastille_perms_check -BASTILLE_VERSION="0.13.20250126" if [ -z "${BASTILLE_CONFIG}" ]; then BASTILLE_CONFIG=/usr/local/etc/bastille/bastille.conf export BASTILLE_CONFIG diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index c7d97dbc..d4336da8 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille bootstrap [option(s)] [RELEASE|TEMPLATE] [update|arch]" diff --git a/usr/local/share/bastille/clone.sh b/usr/local/share/bastille/clone.sh index 74a88b78..64eb0d23 100644 --- a/usr/local/share/bastille/clone.sh +++ b/usr/local/share/bastille/clone.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille clone [option(s)] TARGET NEW_NAME IP_ADDRESS" diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index cca0082e..21fe6722 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille cmd [option(s)] TARGET command" diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index 262e6ecf..9cec63f9 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -30,6 +30,11 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Load config. This only has to be done here +# becasue all commands load this file +# shellcheck disable=SC1090 +. ${BASTILLE_CONFIG} + COLOR_RED= COLOR_GREEN= COLOR_YELLOW= @@ -43,14 +48,6 @@ bastille_root_check() { fi } -load_config() { - # shellcheck disable=SC1090 - . ${BASTILLE_CONFIG} -} - -# Load configuration file -load_config - enable_color() { . /usr/local/share/bastille/colors.pre.sh } diff --git a/usr/local/share/bastille/config.sh b/usr/local/share/bastille/config.sh index 0323d470..b15a03fb 100644 --- a/usr/local/share/bastille/config.sh +++ b/usr/local/share/bastille/config.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config + usage() { error_notify "Usage: bastille config TARGET [get|set] PROPERTY_NAME NEW_VALUE" diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index 7b133287..cc66da6d 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille console [option(s)] TARGET [user]" diff --git a/usr/local/share/bastille/convert.sh b/usr/local/share/bastille/convert.sh index 8b6d66fe..b7659638 100644 --- a/usr/local/share/bastille/convert.sh +++ b/usr/local/share/bastille/convert.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille convert [option(s)] TARGET" diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index c23a17e7..314cb239 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille cp [option(s)] TARGET HOST_PATH JAIL_PATH" diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 2f3783a5..cbea793b 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { # Build an independent usage for the create command diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index d590adf1..6c7902d7 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille destroy [option(s)] [JAIL|RELEASE]" diff --git a/usr/local/share/bastille/edit.sh b/usr/local/share/bastille/edit.sh index 0298da89..03ab215e 100644 --- a/usr/local/share/bastille/edit.sh +++ b/usr/local/share/bastille/edit.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille edit [option(s)] TARGET [filename]" diff --git a/usr/local/share/bastille/etcupdate.sh b/usr/local/share/bastille/etcupdate.sh index 4db33e7b..b3f08cbe 100644 --- a/usr/local/share/bastille/etcupdate.sh +++ b/usr/local/share/bastille/etcupdate.sh @@ -28,7 +28,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille etcupdate [option(s)] [bootstrap|TARGET] [diff|resolve|update RELEASE]" diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index 584f1e36..d1274798 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { # Build an independent usage for the export command diff --git a/usr/local/share/bastille/htop.sh b/usr/local/share/bastille/htop.sh index 1e0f796e..fe2607d0 100644 --- a/usr/local/share/bastille/htop.sh +++ b/usr/local/share/bastille/htop.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille htop [option(s)] TARGET" diff --git a/usr/local/share/bastille/import.sh b/usr/local/share/bastille/import.sh index ec55fbd4..15e4677a 100644 --- a/usr/local/share/bastille/import.sh +++ b/usr/local/share/bastille/import.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { # Build an independent usage for the import command diff --git a/usr/local/share/bastille/jcp.sh b/usr/local/share/bastille/jcp.sh index ac2aa490..391511cf 100644 --- a/usr/local/share/bastille/jcp.sh +++ b/usr/local/share/bastille/jcp.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille jcp [option(s)] SOURCE_JAIL JAIL_PATH DEST_JAIL JAIL_PATH" diff --git a/usr/local/share/bastille/limits.sh b/usr/local/share/bastille/limits.sh index b20b2a12..2d511987 100644 --- a/usr/local/share/bastille/limits.sh +++ b/usr/local/share/bastille/limits.sh @@ -32,7 +32,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille limits [option(s)] TARGET OPTION VALUE" diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index 3fd0dec5..01baf641 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille list [option(s)] [-j|-a] [RELEASE (-p)] [template] [JAIL|CONTAINER] [log] [limit] [import] [export] [backup]" diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index dd0e7bc0..d58664fe 100644 --- a/usr/local/share/bastille/mount.sh +++ b/usr/local/share/bastille/mount.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille mount [option(s)] TARGET HOST_PATH JAIL_PATH [filesystem_type options dump pass_number]" diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index fe4a000e..c51b9ea4 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille pkg [option(s)] TARGET COMMAND args" diff --git a/usr/local/share/bastille/rcp.sh b/usr/local/share/bastille/rcp.sh index 0c82b299..b6273ae7 100644 --- a/usr/local/share/bastille/rcp.sh +++ b/usr/local/share/bastille/rcp.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille rcp [option(s)] TARGET JAIL_PATH HOST_PATH" diff --git a/usr/local/share/bastille/rdr.sh b/usr/local/share/bastille/rdr.sh index bc9c26b7..8edfe474 100644 --- a/usr/local/share/bastille/rdr.sh +++ b/usr/local/share/bastille/rdr.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille rdr [option(s)] TARGET [clear|reset|list|(tcp|udp)] HOST_PORT JAIL_PORT [log ['(' logopts ')'] ]" diff --git a/usr/local/share/bastille/rename.sh b/usr/local/share/bastille/rename.sh index 41600f75..00a2e541 100644 --- a/usr/local/share/bastille/rename.sh +++ b/usr/local/share/bastille/rename.sh @@ -29,7 +29,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille rename [option(s)] TARGET NEW_NAME" diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index 1bb7fc27..40551def 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille service [options(s)] TARGET SERVICE_NAME ACTION" diff --git a/usr/local/share/bastille/setup.sh b/usr/local/share/bastille/setup.sh index 726c08f8..71b9d1c0 100644 --- a/usr/local/share/bastille/setup.sh +++ b/usr/local/share/bastille/setup.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_exit "Usage: bastille setup [pf|network|zfs|vnet]" diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 923b338b..bdb2cc91 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille start [option(s)] TARGET" diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 0a921baf..8e8a1f2a 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille stop [option(s)] TARGET" diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index 3b5bbb19..de715e13 100644 --- a/usr/local/share/bastille/sysrc.sh +++ b/usr/local/share/bastille/sysrc.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille sysrc [option(s)] TARGET args" diff --git a/usr/local/share/bastille/tags.sh b/usr/local/share/bastille/tags.sh index 3bba6941..be0fc13a 100644 --- a/usr/local/share/bastille/tags.sh +++ b/usr/local/share/bastille/tags.sh @@ -32,7 +32,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille tags TARGET [add|delete|list] [tag1,tag2]" diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 5c4de5ee..f8cad31e 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille template [option(s)] TARGET [--convert|project/template]" diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index 3883b126..9c767079 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille top [options(s)] TARGET" diff --git a/usr/local/share/bastille/umount.sh b/usr/local/share/bastille/umount.sh index 36a147cc..57c3081c 100644 --- a/usr/local/share/bastille/umount.sh +++ b/usr/local/share/bastille/umount.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille umount [option(s)] TARGET JAIL_PATH" diff --git a/usr/local/share/bastille/update.sh b/usr/local/share/bastille/update.sh index a5665b78..ba3ea52f 100644 --- a/usr/local/share/bastille/update.sh +++ b/usr/local/share/bastille/update.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille update [option(s)] TARGET" diff --git a/usr/local/share/bastille/upgrade.sh b/usr/local/share/bastille/upgrade.sh index eb2b7e0a..45088490 100644 --- a/usr/local/share/bastille/upgrade.sh +++ b/usr/local/share/bastille/upgrade.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille upgrade [option(s)] TARGET [NEWRELEASE|install]" diff --git a/usr/local/share/bastille/verify.sh b/usr/local/share/bastille/verify.sh index 7309883d..f1983902 100644 --- a/usr/local/share/bastille/verify.sh +++ b/usr/local/share/bastille/verify.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille verify [RELEASE|TEMPLATE]" diff --git a/usr/local/share/bastille/zfs.sh b/usr/local/share/bastille/zfs.sh index 8d1e6cc2..675cb0e1 100644 --- a/usr/local/share/bastille/zfs.sh +++ b/usr/local/share/bastille/zfs.sh @@ -31,7 +31,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . /usr/local/share/bastille/common.sh -load_config usage() { error_notify "Usage: bastille zfs TARGET [set|get|snap|destroy_snap|df|usage] [key=value|date]" From af2bf4b235c3ecdc9682be36dd498d691f2b8489 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 12:53:13 -0700 Subject: [PATCH 11/20] bastille: version and help not optional --- usr/local/bin/bastille | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index 5f6fab92..c70721f8 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -115,8 +115,8 @@ Available Commands: verify Compare release against a "known good" index. zfs Manage (get|set) ZFS attributes on targeted container(s). -Use "bastille [-v|--version]" for version information. -Use "bastille command [-h|--help]" for more information about a command. +Use "bastille -v|--version" for version information. +Use "bastille command -h|--help" for more information about a command. Use "bastille [-c|--config config.conf] command" to specify a non-default config file. EOF From d1156cbb05b37ab6ca055e4e3f0319373be07f87 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 13:19:26 -0700 Subject: [PATCH 12/20] common: typo and trailing whitespace --- usr/local/share/bastille/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index 9cec63f9..b0d5cf58 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -31,7 +31,7 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Load config. This only has to be done here -# becasue all commands load this file +# because all commands load this file # shellcheck disable=SC1090 . ${BASTILLE_CONFIG} From e834b84dd62f4ce59d47ca76f32188efa5a47a4b Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 13:20:14 -0700 Subject: [PATCH 13/20] Update bastille --- usr/local/bin/bastille | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index c70721f8..93691788 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -117,7 +117,7 @@ Available Commands: Use "bastille -v|--version" for version information. Use "bastille command -h|--help" for more information about a command. -Use "bastille [-c|--config config.conf] command" to specify a non-default config file. +Use "bastille [-c|--config FILE] command" to specify a non-default config file. EOF exit 1 From 1c184840eaebe32fcf8183bb37078eacefebcf12 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:10:46 -0700 Subject: [PATCH 14/20] docs: Spacing fix --- docs/chapters/gettingstarted.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/chapters/gettingstarted.rst b/docs/chapters/gettingstarted.rst index 6a5d053c..2d776fac 100644 --- a/docs/chapters/gettingstarted.rst +++ b/docs/chapters/gettingstarted.rst @@ -1,4 +1,3 @@ -=============== Getting Started =============== From d489ffad67e15292b2d12a702b4a5a7778ba2565 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:28:11 -0700 Subject: [PATCH 15/20] docs: Add configuration and document custom config --- docs/chapters/configuration.rst | 106 ++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 docs/chapters/configuration.rst diff --git a/docs/chapters/configuration.rst b/docs/chapters/configuration.rst new file mode 100644 index 00000000..d9bcd0f9 --- /dev/null +++ b/docs/chapters/configuration.rst @@ -0,0 +1,106 @@ +Configuration +============= + +Bastille is configured using a default config file located at `/usr/local/etc/bastille/bastille.conf`. When first installing +bastille, you will be asked if you want to copy the sample config file to this location. The default are sensible for UFS, but +if you want to use ZFS, you will have to change a few options. See the chapter on ZFS Support. + +This is the default `bastille.conf` file. + +.. code-block:: shell + + ##################### + ## [ BastilleBSD ] ## + ##################### + + ## default paths + bastille_prefix="/usr/local/bastille" ## default: "/usr/local/bastille" + bastille_backupsdir="${bastille_prefix}/backups" ## default: "${bastille_prefix}/backups" + bastille_cachedir="${bastille_prefix}/cache" ## default: "${bastille_prefix}/cache" + bastille_jailsdir="${bastille_prefix}/jails" ## default: "${bastille_prefix}/jails" + bastille_releasesdir="${bastille_prefix}/releases" ## default: "${bastille_prefix}/releases" + bastille_templatesdir="${bastille_prefix}/templates" ## default: "${bastille_prefix}/templates" + bastille_logsdir="/var/log/bastille" ## default: "/var/log/bastille" + + ## pf configuration path + bastille_pf_conf="/etc/pf.conf" ## default: "/etc/pf.conf" + + ## bastille scripts directory (assumed by bastille pkg) + bastille_sharedir="/usr/local/share/bastille" ## default: "/usr/local/share/bastille" + + ## bootstrap archives, which components of the OS to install. + ## base - The base OS, kernel + userland + ## lib32 - Libraries for compatibility with 32 bit binaries + ## ports - The FreeBSD ports (3rd party applications) tree + ## src - The source code to the kernel + userland + ## test - The FreeBSD test suite + ## this is a whitespace separated list: + ## bastille_bootstrap_archives="base lib32 ports src test" + bastille_bootstrap_archives="base" ## default: "base" + + ## default timezone + bastille_tzdata="" ## default: empty to use host's time zone + + ## default jail resolv.conf + bastille_resolv_conf="/etc/resolv.conf" ## default: "/etc/resolv.conf" + + ## bootstrap urls + bastille_url_freebsd="http://ftp.freebsd.org/pub/FreeBSD/releases/" ## default: "http://ftp.freebsd.org/pub/FreeBSD/releases/" + bastille_url_hardenedbsd="https://installers.hardenedbsd.org/pub/" ## default: "https://installer.hardenedbsd.org/pub/HardenedBSD/releases/" + bastille_url_midnightbsd="https://www.midnightbsd.org/ftp/MidnightBSD/releases/" ## default: "https://www.midnightbsd.org/pub/MidnightBSD/releases/" + + ## ZFS options + bastille_zfs_enable="NO" ## default: "NO" + bastille_zfs_zpool="" ## default: "" + bastille_zfs_prefix="bastille" ## default: "bastille" + bastille_zfs_options="-o compress=lz4 -o atime=off" ## default: "-o compress=lz4 -o atime=off" + + ## Export/Import options + bastille_compress_xz_options="-0 -v" ## default "-0 -v" + bastille_decompress_xz_options="-c -d -v" ## default "-c -d -v" + bastille_compress_gz_options="-1 -v" ## default "-1 -v" + bastille_decompress_gz_options="-k -d -c -v" ## default "-k -d -c -v" + bastille_export_options="" ## default "" predefined export options, e.g. "--safe --gz" + + ## Networking + bastille_network_loopback="bastille0" ## default: "bastille0" + bastille_network_pf_ext_if="ext_if" ## default: "ext_if" + bastille_network_pf_table="jails" ## default: "jails" + bastille_network_shared="" ## default: "" + bastille_network_gateway="" ## default: "" + bastille_network_gateway6="" ## default: "" + + ## Default Templates + bastille_template_base="default/base" ## default: "default/base" + bastille_template_empty="" ## default: "default/empty" + bastille_template_thick="default/thick" ## default: "default/thick" + bastille_template_clone="default/clone" ## default: "default/clone" + bastille_template_thin="default/thin" ## default: "default/thin" + bastille_template_vnet="default/vnet" ## default: "default/vnet" + +Notes +----- + +The options here are fairly self explanitory, but there are some things to note. + +* If you use ZFS, DO NOT create the bastille dataset. Bastille expects to do this, and you will have issues if you try. All you need to do is create the parent. So if you want bastille to live at `zroot/data/bastille` you should set `bastille_zfs_zpool` to `zroot` and `bastille_zfs_prefix` to `data/bastille` but you should only create `zroot/data` before running bastille for the first time. + +* Bastille will mount the dataset it creates at `bastille_prefix` which defaults to `/usr/local/bastille`. So if you want to navigate to your jails, you will use the `bastille_prefix` as the location because this is where the will be mounted. + +Custom Configuration +-------------------- + +Bastille now supports using a custom config in addition to the default one. This is nice if you have multiple users, or want to store different +jails at different locations based on your needs. + +Simply copy the default config file and edit it according to your new environment or user. Then, it can be used in a couple of ways. + +1. Run Bastille using `bastille --config /path/to/config.conf bootstrap 14.2-RELEASE` to bootstrap the release using the new config. + +2. As a specific user, export the `BASTILLE_CONFIG` variable using `export BASTILLE_CONFIG=/path/to/config.conf`. This config will then always be used when running Bastille with that user. See notes below... + +- Exporting the `BASTILLE_CONFIG` variable will only export it for the current session. If you want to persist the export, see documentation for the shell that you use. + +- If you use sudo, you will need to run it with `sudo -E bastille bootstrap...` to preserve your users environment. This can also be persisted by editing the sudoers file. + +- If you do set the `BASTILLE_CONFIG` variable, you do not need to specify the config file when running Bastille as that specified user. From b273540e05458c3b0dc68d3246eb21d131e0155c Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:28:57 -0700 Subject: [PATCH 16/20] docs: Add configuration to index tree --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index ff3d0103..b0aaff65 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,6 +13,7 @@ https://docs.bastillebsd.org. chapters/installation chapters/gettingstarted + chapters/configuration chapters/upgrading chapters/networking chapters/usage From fa187baf8c811ca89d0ba776040255851638e68c Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 3 Mar 2025 08:19:01 -0700 Subject: [PATCH 17/20] docs: Fix wording on configuration --- docs/chapters/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/chapters/configuration.rst b/docs/chapters/configuration.rst index d9bcd0f9..1ae65cf5 100644 --- a/docs/chapters/configuration.rst +++ b/docs/chapters/configuration.rst @@ -83,7 +83,7 @@ Notes The options here are fairly self explanitory, but there are some things to note. -* If you use ZFS, DO NOT create the bastille dataset. Bastille expects to do this, and you will have issues if you try. All you need to do is create the parent. So if you want bastille to live at `zroot/data/bastille` you should set `bastille_zfs_zpool` to `zroot` and `bastille_zfs_prefix` to `data/bastille` but you should only create `zroot/data` before running bastille for the first time. +* If you use ZFS, DO NOT create the bastille dataset. You must only create the parent. Bastille must be allowed to create the `bastille` child dataset, or you will have issues. So, if you want bastille to live at `zroot/data/bastille` you should set `bastille_zfs_zpool` to `zroot` and `bastille_zfs_prefix` to `data/bastille` but you should only create `zroot/data` before running bastille for the first time. * Bastille will mount the dataset it creates at `bastille_prefix` which defaults to `/usr/local/bastille`. So if you want to navigate to your jails, you will use the `bastille_prefix` as the location because this is where the will be mounted. From 7d5955fd8c19a718bfb15cad9b8c4d3349208544 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:24:02 -0700 Subject: [PATCH 18/20] docs: Add config option to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ca2d2d38..5c44667e 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ Available Commands: Use "bastille -v|--version" for version information. Use "bastille command -h|--help" for more information about a command. +Use "bastille [-c|--config FILE] command" to specify a non-default config file. ``` From 3fd1b01831bca0584664069250f9d4672b15fa07 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:24:41 -0700 Subject: [PATCH 19/20] docs: Add config to usage page --- docs/chapters/usage.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/chapters/usage.rst b/docs/chapters/usage.rst index e21d659d..c9c5c6f0 100644 --- a/docs/chapters/usage.rst +++ b/docs/chapters/usage.rst @@ -1,4 +1,3 @@ -===== Usage ===== @@ -51,4 +50,4 @@ Usage Use "bastille -v|--version" for version information. Use "bastille command -h|--help" for more information about a command. - + Use "bastille [-c|--config FILE] command" to specify a non-default config file. From 79304cd75e755e505dd4bdd2959186558e320d47 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Fri, 7 Mar 2025 06:04:49 -0700 Subject: [PATCH 20/20] docs: Configuration - hyphen --- docs/chapters/configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/chapters/configuration.rst b/docs/chapters/configuration.rst index 1ae65cf5..1249c822 100644 --- a/docs/chapters/configuration.rst +++ b/docs/chapters/configuration.rst @@ -81,7 +81,7 @@ This is the default `bastille.conf` file. Notes ----- -The options here are fairly self explanitory, but there are some things to note. +The options here are fairly self-explanitory, but there are some things to note. * If you use ZFS, DO NOT create the bastille dataset. You must only create the parent. Bastille must be allowed to create the `bastille` child dataset, or you will have issues. So, if you want bastille to live at `zroot/data/bastille` you should set `bastille_zfs_zpool` to `zroot` and `bastille_zfs_prefix` to `data/bastille` but you should only create `zroot/data` before running bastille for the first time.