-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run, renew and --days conceptual issue #693
Labels
Comments
just for the record, my new code is now: script = ''
cd ${stateDir}/${identifier}/acmeSupplied
echo "lego certificate renewal check"
set +e
${pkgs.nixcloud.lego}/bin/lego ${allDomains} --email="${c.email}" --exclude="dns-01" --exclude="tls-alpn-01" --webroot="/run/nixcloud/lego/${identifier}/challenges" --path="${path}" --accept-tos --server="${c.acmeApiEndpoint}" renew --days=15
status=$?
echo "return code was $status"
set -e
if [ "$status" != "0" ]; then
echo "initial lego certificate query"
${pkgs.nixcloud.lego}/bin/lego ${allDomains} --email="${c.email}" --exclude="dns-01" --exclude="tls-alpn-01" --webroot="/run/nixcloud/lego/${identifier}/challenges" --path="${path}" --accept-tos --server="${c.acmeApiEndpoint}" run
fi
''; this is an ugly hack but until this is sorted it works. |
Hi. I use the following logic in my script:
|
This was referenced May 12, 2020
Do you still use this logic today? Would you mind sharing your code, in particular the "SANs in the certificate.crt" part? I found that the following code does the trick but you may have something simpler/cleaner to share. openssl x509 -text -in example.com.crt -noout | perl -l -0777 -ne '@names=/\bDNS:([^\s,]+)/g; print join("\n", sort @names);' |
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i've a problem understanding how to initially get certificates and how to renew them when doing script based automation.
my primary problem is, why does a
run
call 'change' the already existing and correct certificates at all? why would anyone want that? the output below shows that the files were changed.why does
run
not support--days=15
? what are the pre-conditions torun
, should i manually check if there is a certificate file and a key? or should i first try torenew
it, and if that fails call therun
?a call to
run
when i call the
run
command it changes my certificates... why?my code
at the moment i'm running this code:
also: why is --days=15 not a default? why would i want to update the certificates on every call by default?
oh and the examples on the webpage, https://github.com/xenolf/lego#cli-example, are inconsistent in parameter handling. should it not be --days=15 in
lego --email="[email protected]" --domains="example.com" renew --days 30
when all the other arguments use a --foo=bar syntax?The text was updated successfully, but these errors were encountered: