76 Commits

Author SHA1 Message Date
Michael Osipov
82958fb7b7 Trim trailing whitespace 2025-09-23 18:51:04 +02:00
tschettervictor
4b860d9f5e support altroot 2025-05-17 18:46:36 -06:00
tschettervictor
510807657b Update import.sh 2025-05-06 15:36:59 -06:00
tschettervictor
a60f76b3b6 import: Fix TARGET_TRIM var 2025-05-06 15:18:43 -06:00
tschettervictor
356a2264c7 import: Prepare for migrate command 2025-05-04 18:51:39 -06:00
tschettervictor
68f4aecddf finish refactor of line spacing 2025-05-01 17:39:50 -06:00
tschettervictor
824ffb2980 Add \n to info _jail 2025-04-30 18:49:14 -06:00
tschettervictor
bb47671cf0 half way point 2025-04-30 11:21:41 -06:00
tschettervictor
8c0b2b887b import: Support netgraph 2025-04-25 20:57:32 -06:00
tschettervictor
49a4bed126 Merge branch 'BastilleBSD:master' into custom-config 2025-03-03 16:26:54 -07:00
tschettervictor
454288b2b1 bastille: Load config only from commons.sh
Since all files source common.sh anyway, we don't want to source the config twice.
2025-03-02 11:23:35 -07:00
tschettervictor
6ba11dc762 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.
2025-03-01 18:48:14 -07:00
tschettervictor
eed70dc129 import: Fix shellcheck 2025-02-28 23:13:57 -07:00
tschettervictor
efee919b49 import: Fix import to release for bastille jails 2025-02-28 23:12:31 -07:00
tschettervictor
b498fca79e import: Fix import to a release from iocage 2025-02-28 23:10:04 -07:00
tschettervictor
2bd35fc9d2 import: Manual network only if definitions not set 2025-02-28 22:31:13 -07:00
tschettervictor
0106df5259 import: Support importing to specific release
#360
2025-02-28 00:18:42 -07:00
tschettervictor
00368cb71f import: Get default interface in set to "none" or auto 2025-02-28 00:07:14 -07:00
tschettervictor
b333a99cdc import: Import jails using new interface format (iocage,ezjail)
Imported jails from iocage and ezjail should now be imported using the new "if|ip" format and overall better handling on the network side of the import.
2025-02-27 23:50:00 -07:00
tschettervictor
dd4b1fb6ba import: Fix var -n > -eq 2025-02-27 22:58:51 -07:00
tschettervictor
5b599dc593 import: Fix var names 2025-02-27 17:02:54 -07:00
tschettervictor
c22bd866eb import: Use new functions 2025-02-27 16:54:50 -07:00
Juan David Hurtado G
8b0411c111 Add SPDX license identifiers and update copyright years
Added SPDX-License-Identifier to all scripts for better license clarity and compliance. Updated the copyright years from 2024 to 2025 in various files to reflect the current maintenance period.
2025-01-11 14:07:41 -05:00
Juan David Hurtado G
8808e8a5a4 [WIP] shellcheck linting 2024-12-08 20:57:43 -05:00
Juan David Hurtado G
7dbe1e761b rel: update copyright year and release version 2024-11-24 09:46:09 -05:00
Christer Edwards
622c926917 support lowercase values in bastille.conf (issue #368) 2023-11-25 15:09:11 -07:00
Romain Tartière
157125c4af Relax validation of -BETA / -RC releases
Accross the code, release names are checked against some variation of
-BETAx / -RCx which are inconsistent in the range of accepted values for
`x`.

As  a consequence, some commands cannot be successfuly run while they
are valid, e.g. `bastille create test 14.0-RC4 10.0.0.2` is rejected
because only `*-RC1` and `*-RC2` are accepted as a RC release name.

Find out these lists of specific BETA and RC patterns and adjust them to
allow any one-digit value at the end.  We generaly do up to 4 BETA / RC
releases, so a one digit limit is probably enough for the time being.
2023-11-10 08:09:51 -10:00
JRGTH
72bd211f7b Validate jib during jail import 2023-07-19 10:56:20 -04:00
Christer Edwards
4efcc5021c update copyright dates 2023-07-14 21:02:14 -06:00
Lars Engels
64c3b6045e Allow running bastille and subcomands with help flags as regular user 2023-03-16 20:58:11 +01:00
Christer Edwards
aafc2b3323 0.9.20220216 release 2022-02-16 23:28:09 -07:00
Rob Arnold
c98d03a8e5 Import basic vnet settings from iocage
There's quite a bit more we could do here, but this hits my basic usage
with vnets. Future work here would be things like ipv6 support or trying
to infer what a custom `interfaces` setting means.
2022-01-13 21:04:15 -08:00
Rob Arnold
523c3f0bde Import iocage basejails as Bastille thin jails
I think these are the same concept, but with slightly different execution.
The main idea is to have a central base system that is shared (readonly) among
multiple jails. When this base system is updated, all the jails that reference
it immediately see the new system files.

This is implemented in iocage as a set of individual zfs mounts, one per
system directory. In Bastille, each system directory is symlinked into a
subdirectory of a single zfs mount.

My test plan here was to import an exported iocage basejail and verify that
its Bastille version has the right fstab and symlink changes:
```
Validating file: ssl_2021-11-19.zip...
File validation successful!
Importing 'ssl' from foreign compressed .zip archive.
Archive:  ssl_2021-11-19.zip
 extracting: ssl_2021-11-19
 extracting: ssl_2021-11-19_root
Receiving ZFS data stream...
Generating jail.conf...
Updating symlinks...
ln: usr/src: Directory not empty
Warning: directory usr/src on imported jail was not empty and will not be updated by Bastille
Container 'ssl' imported successfully.
```
2022-01-09 18:05:05 -08:00
Christer Edwards
faf3b2b691 use full path when calling jls binary 2021-12-17 19:09:49 -07:00
Rob Arnold
5aba3df6ae Use the devfs_ruleset number from imported iocage jails
This property is not set by default on all iocage jails. By default, iocage assumes this value is 4. Confusingly, if you query this value from iocage while the jail is running, it will give a dynamically generated value. However, a jail must be stopped to be exported, so we can trust the value in config.json.
2021-11-19 21:46:22 -08:00
JRGTH
f39168b9c2 Be more specific with export/import command options 2021-07-14 15:02:12 -04:00
JRGTH
50c09d0359 Feature to disable output colors 2021-07-13 04:49:25 -04:00
JRGTH
ee2c25697c Cleanup obsolete code 2021-07-10 09:01:28 -04:00
JRGTH
0a7db32490 Restored usage after file debug 2021-07-10 08:52:08 -04:00
JRGTH
f0c3620fac Add export/import standard I/O redirection
This update enhances the export and import command to fully support jail export/import user standard input/output redirection
2021-07-10 08:35:50 -04:00
JRGTH
d73645facb Add the new tgz compress format to UFS systems too 2021-07-08 17:41:27 -04:00
JRGTH
17ea19bf65 Deprecate command parameters not starting with dash here too 2021-07-08 15:37:36 -04:00
JRGTH
5c4d69775f Deprecate command parameters not starting with dash 2021-07-08 15:29:31 -04:00
JRGTH
b0f947ca00 Standardized options position in export/import commands, improve option checks 2021-07-08 13:48:02 -04:00
JRGTH
961731b063 New features and improvements revised and re-added 2021-07-07 05:05:38 -04:00
Jose
89c6ce9e78 Revert the improved import command due conflicts, later re add. 2021-05-15 08:16:10 -04:00
Jose
5583ab1d78 Add support bastille RAW image exports/imports, also extended help usage 2021-02-03 18:31:41 -04:00
Christer Edwards
6fa744bbda update 2021 copyright 2021-01-15 20:00:26 -07:00
Chris Wells
5e9578ca5e Use uppercase ZFS when appropriate. 2020-11-27 19:20:47 -05:00
Chris Wells
8b4d18f8f3 Create info() and warn() for cleaner print statements. 2020-11-25 21:19:08 -05:00