Enable / Disable firewall rule from a script?

Hey,

Not done any research on this at all yet so apologies if it’s obvious.

I have port 80 and 443 blocked on one of my servers (traffic comes in on 8443) but I also want to have a lets encrypt cert automatically renew when it needs to. I currently wait for it to expire, enable 80/443, nenew, disable but I feel like I should be able to automate this.

Any ideas?

There is probably a way to do it but I don’t know how. My solution is to use DNS renewal.

I should look at that again. Last time I checked my hosting platform (plesk) was not supported so it would have been a bit of a pain in the arse to use. I’m sure things will have progressed though so maybe there’s a way (or I could move the DNS to a provider that is supported)

@garethw I’d also user DNS renewal. If you can’t (maybe your DNS server doesn’t have an API) you can always use NGINX acting as a reverse proxy.

Not sure what version of Plesk you’re using though. I got Obsidian working with Auto Let’s Encrypt renewal.

Yeah, so Plesk supports lets encrypt and works fine. My problem is that the server I want the cert on is not the Plesk box, it’s another server.

It may be that plesk supports whatever is required to allow another server running LE to update DNS records but I’ve never tried.