Skip to content
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

unify run/renew command #290

Open
hanoii opened this issue Sep 28, 2016 · 6 comments
Open

unify run/renew command #290

hanoii opened this issue Sep 28, 2016 · 6 comments
Labels

Comments

@hanoii
Copy link

hanoii commented Sep 28, 2016

I wonder if it shouldn't be nice to use one command for run/renew. It could be a new one. run would be the initial request and any subsequent request would renew. With this you can automate generate/renewal from the start.

@xenolf
Copy link
Member

xenolf commented Oct 17, 2016

This is on my todo list for the LE V2 API update.
The renew command is basically just a wrapper for run with some added code for SAN handling.

@ulope
Copy link

ulope commented Nov 23, 2016

Do you have a recommended way of automating run / renew with the current version?

@hanoii
Copy link
Author

hanoii commented Nov 23, 2016

@ulope to be honest I just run run manually and then renew on cron, if you were to do it truly automatic I guess you can cook up a script that looks for the cert files, if not present run run, otherwise renew.

@pavels
Copy link

pavels commented Dec 7, 2016

I did some work on automation, see https://github.com/pavels/nginx-lego - the idea is not mine, it was taken from here https://github.com/ilg/nginx-letsencrypt-aws and seems like it works ok

@Duologic
Copy link

Just dropping this here as a simple workaround:

DOMAIN=example.com
CERT_EXISTS=$(stat -c %s certificates/$DOMAIN.crt && echo "success" || echo "fail")

if [[ $CERT_EXISTS == *"success"* ]]
then
    ./lego -a --path $PWD --domains $DOMAIN --dns route53 renew --days 30
else
    ./lego -a --path $PWD --domains $DOMAIN --dns route53 run
fi

# TODO: using binary, doesn't have --pem option yet
cat certificates/$DOMAIN.crt > certificates/$DOMAIN.pem
cat certificates/$DOMAIN.key >> certificates/$DOMAIN.pem

@Duologic
Copy link

Duologic commented Jan 4, 2018

I haven't run into it yet, but what would happen if you use 'renew' with a different or extended SAN-set?

FYI, updated the above script to support SAN and using Route53 for it: https://gist.github.com/Duologic/bf23bf65f6a7f03b8108827686b9398a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

6 participants