Custom actions with Virtualmin's Letsencypt renewals?

Definitely not this. Virtualmin calls certbot, and then does stuff with the resulting certs, not the other way around.

Virtualmin has pre and post hooks, though, so you can write scripts in whatever language you like (including bash shell scripts) to run before or after changes. Renewing certs is a change, and the hook runs. To know if it’s a TLS cert change, you’d check for SSL_DOMAIN.

There’s an example of copying certs for a service not supported directly by Virtualmin here: Domain Management API | Virtualmin — Open Source Web Hosting Control Panel

So, you could base your post script on that, and then configure Virtualmin to run it in Virtualmin Configuration->Actions upon server and user creation->Command to run after making changes to a server

2 Likes