mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-13 15:13:33 +01:00
Define an allowed prefix for custom config settings #176
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @whereisaaron on GitHub (Dec 23, 2016).
Proposal
I'd like to propose defining an allowed prefix that end-user can use to add custom settings to
dehydratedconfigfiles, e.g.CUSTOM_. This would work in the mainconfigfile and any custom settings can be added to, or overridden in the per-certificateconfigfiles.Any settings with the
CUSTOM_prefix would be exported in to the environment used to run the hook script (via the HOOK setting). This would allow the hook script author to add parameterized custom behaviors on a global or per-cert basis.For example to control the
deploy_certbehavior user could define per-certificate settings like:or other behavior settings e.g.
It would be up to hook script author to pull these settings from the script environment and implement the behaviors with in the hook functions.
Background
dehydratedonly a fixed set of settings in itsconfigfile and only allows a fixed set of settings to be overridden in per-certificateconfigfiles. This is to protect the user from overriding an internal variable by mistake and breaking things. The custom prefix would be a safe way to extend the settings while keeping this protection.@lukas2511 commented on GitHub (Jan 30, 2017):
I don't think this is necessary: CERTDIR is exported and the certificate name is given for all important hooks, so you could easily just create a custom config file and source it inside your hook, no need to modify dehydrated for this and I think it's actually cleaner because you have your separate config file for your hook script.
@whereisaaron commented on GitHub (Jan 30, 2017):
I get that. The
hook.shcould check for and source e.g.$CERTDIR/hook-configto get this stuff.