Closed Jip-Hop closed 1 week ago
Like it very much - best to surround additions with a BEGIN/END comment
What do you mean? If it's the END
tags then I'm afraid it's not possible to use a different tag for BEGIN
and END
as this is heredoc syntax. But I agree it's probably better to use another delimiter than END
but that's up to the user anyway.
Not 'tags' per se, but comments showing to the human where the machine put stuff they didn't write. if, in the example you supplied:
initial_setup=apt-get update
apt-get install -y curl
And the auto-config will add distro
and release
, the resulting config will look like:
initial_setup=apt-get update
apt-get install -y curl
#### AUTOMATICALLY ADDED #### BEGIN ####
distro=debian
release=bookworm
#### AUTOMATICALLY ADDED ##### END #####
Hmm that's one option for sure. But I think I rather have something more complete like the default config at the top of jlmkr.py
https://github.com/Jip-Hop/jailmaker/blob/c1f6990b7fca6e2e7e93eca645d3e9b9e141f3e6/jlmkr.py#L37-L101
I see... interesting. Not against - just never seen it like that.
Closing as not planned due to End of Life October 2024 Announcement.
When providing an incomplete config file, fallback to the default config for the missing values and write the interpolated config file.
Currently this works:
But the resulting config file is very minimal:
And this doesn't work (because
image
anddistro
don't fallback to defaults duringjlmkr create
:However keep in mind that comments should be preserved when the user provides a complete (or almost complete?) config file. In that case we don't want to take the default config (with comments) as the base.