Argument to get certalias in hook script #600

Closed
opened 2025-12-29 01:27:43 +01:00 by adam · 1 comment
Owner

Originally created by @RinkAttendant6 on GitHub (Mar 21, 2023).

In the docs there is an option to use certalias in domains.txt like this example.net example.org > certalias
https://github.com/dehydrated-io/dehydrated/blob/v0.7.1/docs/examples/domains.txt#L13

It would be nice for the certalias value to be passed to the deploy_cert (and maybe unchanged_cert) hooks.

My current workaround works to some extent, but it will get the CERTDIR if there was no alias:

# bash
local CERTALIAS = basename "$(dirname "${3}")"
// JavaScript
const CERTALIAS = path.basename(path.dirname(process.argv[3]))

I suppose that I can mitigate this in my case by adding some kind of validation/lint script to ensure all entries in domains.txt have an alias.

In the bigger picture, I'm using the certalias values to determine where the files are supposed to be deployed to.

Originally created by @RinkAttendant6 on GitHub (Mar 21, 2023). In the docs there is an option to use certalias in domains.txt like this `example.net example.org > certalias` https://github.com/dehydrated-io/dehydrated/blob/v0.7.1/docs/examples/domains.txt#L13 It would be nice for the `certalias` value to be passed to the `deploy_cert` (and maybe `unchanged_cert`) hooks. My current workaround works to some extent, but it will get the CERTDIR if there was no alias: ```bash # bash local CERTALIAS = basename "$(dirname "${3}")" ``` ```js // JavaScript const CERTALIAS = path.basename(path.dirname(process.argv[3])) ``` I suppose that I can mitigate this in my case by adding some kind of validation/lint script to ensure all entries in domains.txt have an alias. In the bigger picture, I'm using the certalias values to determine where the files are supposed to be deployed to.
adam closed this issue 2025-12-29 01:27:43 +01:00
Author
Owner

@lukas2511 commented on GitHub (May 14, 2023):

There is an alias environment variable that should be accessible in the hook scripts. In cases where no alias is defined it's content will be the default name (first domain).

@lukas2511 commented on GitHub (May 14, 2023): There is an `alias` environment variable that should be accessible in the hook scripts. In cases where no alias is defined it's content will be the default name (first domain).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#600