fritz-tls icon indicating copy to clipboard operation
fritz-tls copied to clipboard

More info on LE auto renew

Open valentinocossar opened this issue 4 years ago • 4 comments

Hi, I don't understand how to handle cert renew automatically, is it possible with this CLI?

valentinocossar avatar May 17 '21 09:05 valentinocossar

Hey! I do run it via cron for some FRITZ!Box I "manage". I guess it could be a bit smarter, like running once a week/day and check the remaining validity of the certificate or something.

Can you elaborate a bit more on your question?

tisba avatar May 17 '21 09:05 tisba

Yes, sorry, do you run it locally on your Mac/PC, or do you have a server that handles this for you? I have a MacBook Pro, what happens if the MacBook Pro is not at home when the renewal cron runs? LE allows renewal 30 days before the cert expire date, I imagine that the only problem is if the computer that runs the renewal cron is not at home at least one day before the cert expire date. I'm right?

valentinocossar avatar May 17 '21 10:05 valentinocossar

Actually, the codes does not even try to do a renew, see here: https://github.com/tisba/fritz-tls/blob/61c6f7f3826f1aca243af7cbca424f977a85728b/acme.go#L80-L83

From what I understand and also got confirmed here there is no real difference from obtaining a "new" certificate from renewing.

I do have a Mac Mini running at home, before that I used a Raspberry Pi - that was actually the reason I added ARM binaries :)

For your case, if you don't have a "stationary" system running, we could add an option, that inspects the current certificates and only tries to obtain a new one if the current one is approaching its expire date. If that's in place, it should be rather simple to have fritz-tls run via launchd on a schedule once a day or week.

tisba avatar May 17 '21 11:05 tisba

@tisba super, this would be great!

valentinocossar avatar May 20 '21 21:05 valentinocossar

Hey @valentinocossar 👋 Not sure if this is still relevant for you, but v0.14.0 now does not renew if the found certificate is still valid (not expired and for the correct domain). So you can run it daily for example and it will only renew once every 30 days.

tisba avatar Oct 19 '22 19:10 tisba

Hi @tisba, thank you! 🎉

valentinocossar avatar Oct 23 '22 20:10 valentinocossar