From e2b4f84cfe0a2977e8a5caa695d303da5e8b6326 Mon Sep 17 00:00:00 2001 From: Christer Edwards Date: Mon, 4 Feb 2019 21:08:00 -0700 Subject: [PATCH 1/2] update copyright; fixes #28 --- LICENSE | 2 +- README.md | 8 ++++---- docs/conf.py | 2 +- usr/local/bin/bastille | 4 ++-- usr/local/etc/bastille/bastille.conf | 1 + usr/local/share/bastille/bootstrap.sh | 9 ++------- usr/local/share/bastille/cmd.sh | 2 +- usr/local/share/bastille/console.sh | 2 +- usr/local/share/bastille/cp.sh | 2 +- usr/local/share/bastille/create.sh | 2 +- usr/local/share/bastille/destroy.sh | 7 ++++--- usr/local/share/bastille/htop.sh | 2 +- usr/local/share/bastille/list.sh | 2 +- usr/local/share/bastille/pkg.sh | 2 +- usr/local/share/bastille/restart.sh | 2 +- usr/local/share/bastille/service.sh | 2 +- usr/local/share/bastille/start.sh | 2 +- usr/local/share/bastille/stop.sh | 3 +-- usr/local/share/bastille/sysrc.sh | 2 +- usr/local/share/bastille/template.sh | 2 +- usr/local/share/bastille/top.sh | 2 +- usr/local/share/bastille/update.sh | 2 +- usr/local/share/bastille/upgrade.sh | 2 +- usr/local/share/bastille/verify.sh | 2 +- 24 files changed, 32 insertions(+), 36 deletions(-) diff --git a/LICENSE b/LICENSE index 18f2d807..507ba892 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2018, Christer Edwards +Copyright (c) 2018-2019, Christer Edwards All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 15069a60..cb222372 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Then, install via `pkg`. Example: ```shell -pkg add https://github.com/BastilleBSD/bastille/releases/download/0.3.20181130/bastille-0.3.20181130_2.txz +pkg add https://github.com/BastilleBSD/bastille/releases/download/0.3.20190204/bastille-0.3.20190204.txz ``` BETA binary packages are signed. These can be verified with this pubkey: @@ -191,15 +191,15 @@ a private (rfc1918) IP address. - ip ```shell -ishmael ~ # bastille create folsom 11.2-RELEASE 10.8.62.1 +ishmael ~ # bastille create folsom 12.0-RELEASE 10.8.62.1 -RELEASE: 11.2-RELEASE. +RELEASE: 12.0-RELEASE. NAME: folsom. IP: 10.8.62.1. ``` -This command will create a 11.2-RELEASE jail assigning the 10.8.62.1 ip address +This command will create a 12.0-RELEASE jail assigning the 10.8.62.1 ip address to the new system. I recommend using private (rfc1918) ip address ranges for your jails. diff --git a/docs/conf.py b/docs/conf.py index b937144c..f822839d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,7 +8,7 @@ # -- Project information ----------------------------------------------------- project = 'Bastille' -copyright = '2018, Christer Edwards' +copyright = '2018-2019, Christer Edwards' author = 'Christer Edwards' # The short X.Y version diff --git a/usr/local/bin/bastille b/usr/local/bin/bastille index b3f7823d..d73f4c6a 100755 --- a/usr/local/bin/bastille +++ b/usr/local/bin/bastille @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ . /usr/local/etc/bastille/bastille.conf ## version -BASTILLE_VERSION="0.3.20190102" +BASTILLE_VERSION="0.3.20190204" usage() { cat << EOF diff --git a/usr/local/etc/bastille/bastille.conf b/usr/local/etc/bastille/bastille.conf index a89da0b7..d5981a62 100644 --- a/usr/local/etc/bastille/bastille.conf +++ b/usr/local/etc/bastille/bastille.conf @@ -9,3 +9,4 @@ bastille_logsdir=${bastille_prefix}/logs bastille_releasesdir=${bastille_prefix}/releases bastille_templatesdir=${bastille_prefix}/templates bastille_sharedir=/usr/local/share/bastille +bastille_bootstrap_archives=base diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index fbd5dc37..b7eecc9a 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,20 +60,15 @@ bootstrap_release() { ### create $bastille_base/release/$release directory ### fetch $release/base.txz -o $bastille_base/cache/$release/base.txz - ### fetch $release/lib32.txz -o $bastille_base/cache/$release/lib32.txz ### extract $release/base.txz to $bastille_base/release/$release - ### extract $release/lib32.txz to $bastille_base/release/$release if [ ! -d "${bastille_releasesdir}/${RELEASE}" ]; then mkdir -p "${bastille_releasesdir}/${RELEASE}" - sh ${bastille_sharedir}/freebsd_dist_fetch.sh -r ${RELEASE} base lib32 + sh ${bastille_sharedir}/freebsd_dist_fetch.sh -r ${RELEASE} ${bastille_bootstrap_archives} echo echo -e "${COLOR_GREEN}Extracting FreeBSD ${RELEASE} base.txz.${COLOR_RESET}" /usr/bin/tar -C "${bastille_releasesdir}/${RELEASE}" -xf "${bastille_cachedir}/${RELEASE}/base.txz" - echo -e "${COLOR_GREEN}Extracting FreeBSD ${RELEASE} lib32.txz.${COLOR_RESET}" - /usr/bin/tar -C "${bastille_releasesdir}/${RELEASE}" -xf "${bastille_cachedir}/${RELEASE}/lib32.txz" - echo -e "${COLOR_GREEN}Bootstrap successful.${COLOR_RESET}" echo -e "${COLOR_GREEN}See 'bastille --help' for available commands.${COLOR_RESET}" echo diff --git a/usr/local/share/bastille/cmd.sh b/usr/local/share/bastille/cmd.sh index 22eaac19..795a88cc 100644 --- a/usr/local/share/bastille/cmd.sh +++ b/usr/local/share/bastille/cmd.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index a9db63fb..0e9ba154 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/cp.sh b/usr/local/share/bastille/cp.sh index 74ad6ea2..cfa955e7 100644 --- a/usr/local/share/bastille/cp.sh +++ b/usr/local/share/bastille/cp.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index df1265c6..fc6f371a 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/destroy.sh b/usr/local/share/bastille/destroy.sh index bc922432..375deeb8 100644 --- a/usr/local/share/bastille/destroy.sh +++ b/usr/local/share/bastille/destroy.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -55,8 +55,9 @@ destroy_jail() { echo -e "${COLOR_GREEN}Deleting Jail: ${NAME}.${COLOR_RESET}" chflags -R noschg ${bastille_jail_base} rm -rf ${bastille_jail_base} - echo -e "${COLOR_GREEN}Note: jail console logs not destroyed.${COLOR_RESET}" - echo -e "${COLOR_GREEN}${bastille_jail_log}${COLOR_RESET}" + mv ${bastille_jail_log} ${bastille_jail_log}-$(date +%F) + echo -e "${COLOR_GREEN}Note: jail console logs archived.${COLOR_RESET}" + echo -e "${COLOR_GREEN}${bastille_jail_log}-$(date +%F)${COLOR_RESET}" echo fi } diff --git a/usr/local/share/bastille/htop.sh b/usr/local/share/bastille/htop.sh index 63953513..b69ef548 100644 --- a/usr/local/share/bastille/htop.sh +++ b/usr/local/share/bastille/htop.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index 51064751..0b39b194 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/pkg.sh b/usr/local/share/bastille/pkg.sh index e26bad66..0c4ef7c9 100644 --- a/usr/local/share/bastille/pkg.sh +++ b/usr/local/share/bastille/pkg.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/restart.sh b/usr/local/share/bastille/restart.sh index b3f115cd..65478dc0 100644 --- a/usr/local/share/bastille/restart.sh +++ b/usr/local/share/bastille/restart.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/service.sh b/usr/local/share/bastille/service.sh index ccd0ed4b..a943c4a4 100644 --- a/usr/local/share/bastille/service.sh +++ b/usr/local/share/bastille/service.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/start.sh b/usr/local/share/bastille/start.sh index 502f0c32..40e6e9fa 100644 --- a/usr/local/share/bastille/start.sh +++ b/usr/local/share/bastille/start.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/stop.sh b/usr/local/share/bastille/stop.sh index 01bcaad3..84eb0e96 100644 --- a/usr/local/share/bastille/stop.sh +++ b/usr/local/share/bastille/stop.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -57,6 +57,5 @@ fi for _jail in ${JAILS}; do echo -e "${COLOR_GREEN}[${_jail}]:${COLOR_RESET}" jail -f "${bastille_jailsdir}/${_jail}/jail.conf" -r ${_jail} - pfctl -f /etc/pf.conf echo done diff --git a/usr/local/share/bastille/sysrc.sh b/usr/local/share/bastille/sysrc.sh index aa737fec..20838448 100644 --- a/usr/local/share/bastille/sysrc.sh +++ b/usr/local/share/bastille/sysrc.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/template.sh b/usr/local/share/bastille/template.sh index 3bdc2f37..298cea41 100644 --- a/usr/local/share/bastille/template.sh +++ b/usr/local/share/bastille/template.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/top.sh b/usr/local/share/bastille/top.sh index 45f45aff..5e630848 100644 --- a/usr/local/share/bastille/top.sh +++ b/usr/local/share/bastille/top.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/update.sh b/usr/local/share/bastille/update.sh index 22f48bfb..2f9bef5b 100644 --- a/usr/local/share/bastille/update.sh +++ b/usr/local/share/bastille/update.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/upgrade.sh b/usr/local/share/bastille/upgrade.sh index 545a7a1c..39e125e7 100644 --- a/usr/local/share/bastille/upgrade.sh +++ b/usr/local/share/bastille/upgrade.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/usr/local/share/bastille/verify.sh b/usr/local/share/bastille/verify.sh index c3b29687..7abadb80 100644 --- a/usr/local/share/bastille/verify.sh +++ b/usr/local/share/bastille/verify.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2018, Christer Edwards +# Copyright (c) 2018-2019, Christer Edwards # All rights reserved. # # Redistribution and use in source and binary forms, with or without From 957465dfa4af5c15868a90724b78dba228367e64 Mon Sep 17 00:00:00 2001 From: Christer Edwards Date: Mon, 4 Feb 2019 21:31:34 -0700 Subject: [PATCH 2/2] update bootstrap to support configurable archives --- usr/local/share/bastille/bootstrap.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/local/share/bastille/bootstrap.sh b/usr/local/share/bastille/bootstrap.sh index b7eecc9a..58fcf813 100644 --- a/usr/local/share/bastille/bootstrap.sh +++ b/usr/local/share/bastille/bootstrap.sh @@ -58,16 +58,15 @@ bootstrap_release() { mkdir -p "${bastille_cachedir}/${RELEASE}" fi - ### create $bastille_base/release/$release directory - ### fetch $release/base.txz -o $bastille_base/cache/$release/base.txz - ### extract $release/base.txz to $bastille_base/release/$release if [ ! -d "${bastille_releasesdir}/${RELEASE}" ]; then mkdir -p "${bastille_releasesdir}/${RELEASE}" sh ${bastille_sharedir}/freebsd_dist_fetch.sh -r ${RELEASE} ${bastille_bootstrap_archives} echo - echo -e "${COLOR_GREEN}Extracting FreeBSD ${RELEASE} base.txz.${COLOR_RESET}" - /usr/bin/tar -C "${bastille_releasesdir}/${RELEASE}" -xf "${bastille_cachedir}/${RELEASE}/base.txz" + for _archive in ${bastille_bootstrap_archives}; do + echo -e "${COLOR_GREEN}Extracting FreeBSD ${RELEASE} ${_archive}.txz.${COLOR_RESET}" + /usr/bin/tar -C "${bastille_releasesdir}/${RELEASE}" -xf "${bastille_cachedir}/${RELEASE}/${_archive}.txz" + done echo -e "${COLOR_GREEN}Bootstrap successful.${COLOR_RESET}" echo -e "${COLOR_GREEN}See 'bastille --help' for available commands.${COLOR_RESET}"