Call deploy_cert() in hooks-file with alias #384

Closed
opened 2025-12-29 01:24:11 +01:00 by adam · 4 comments
Owner

Originally created by @muffl0n on GitHub (Nov 1, 2018).

When defining a SAN-certificate in domains.txt it's possible to specify an alias. E.g.

foo.example.com bar.example.com > example.com

Unfortunately it's not possible to use the alias ("example.com" in this case) in the hooks-file.

Our use case is: In deploy_cert() we update the certificate in our loadbalancer. The only "name" I can use for referencing the certificate in the lb is DOMAIN. So I have no chance to name the certificate "le-cert-example.com" because the hooks-file does not know about the alias.

My workaround in deploy_cert() for the time being is

ALIAS=`/bin/echo -n "${KEYFILE}" | /usr/bin/awk -F "/" '{print $(NF-1)}'`
Originally created by @muffl0n on GitHub (Nov 1, 2018). When defining a SAN-certificate in domains.txt it's possible to specify an alias. E.g. ``` foo.example.com bar.example.com > example.com ``` Unfortunately it's not possible to use the alias ("example.com" in this case) in the hooks-file. Our use case is: In deploy_cert() we update the certificate in our loadbalancer. The only "name" I can use for referencing the certificate in the lb is DOMAIN. So I have no chance to name the certificate "le-cert-example.com" because the hooks-file does not know about the alias. My workaround in deploy_cert() for the time being is ``` ALIAS=`/bin/echo -n "${KEYFILE}" | /usr/bin/awk -F "/" '{print $(NF-1)}'` ```
adam closed this issue 2025-12-29 01:24:12 +01:00
Author
Owner

@lukas2511 commented on GitHub (Nov 1, 2018):

There should already be a variable alias (lowercase) exported to the hooks environment ;)

@lukas2511 commented on GitHub (Nov 1, 2018): There should already be a variable `alias` (lowercase) exported to the hooks environment ;)
Author
Owner

@muffl0n commented on GitHub (Nov 1, 2018):

Your're right, thank you very much! Just found the commit for that: b6b56d0df7
Didn't find anything in the documentation, though. Is there a reason why it's not a parameter? Would be way more explicit, feels a bit "magical" this way.

@muffl0n commented on GitHub (Nov 1, 2018): Your're right, thank you very much! Just found the commit for that: https://github.com/lukas2511/dehydrated/commit/b6b56d0df7af02a6d9f28255fc36d5aede7a2b38 Didn't find anything in the documentation, though. Is there a reason why it's not a parameter? Would be way more explicit, feels a bit "magical" this way.
Author
Owner

@lukas2511 commented on GitHub (Nov 1, 2018):

It's not a parameter because I didn't want to change the syntax. Aliases were mostly designed for use with edge-cases on some wildcard certificates so they are not really a "first class feature".

Documentation needs a lot of work, there's a lot of things missing but I don't want to just throw everything in as it might result in more confusion. It's something I'm trying to work on but I didn't really find the time yet.

@lukas2511 commented on GitHub (Nov 1, 2018): It's not a parameter because I didn't want to change the syntax. Aliases were mostly designed for use with edge-cases on some wildcard certificates so they are not really a "first class feature". Documentation needs a lot of work, there's a lot of things missing but I don't want to just throw everything in as it might result in more confusion. It's something I'm trying to work on but I didn't really find the time yet.
Author
Owner

@muffl0n commented on GitHub (Nov 1, 2018):

Sounds reasonable! 👍 Thank you very much for your great work!

@muffl0n commented on GitHub (Nov 1, 2018): Sounds reasonable! :+1: Thank you very much for your great work!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#384