orchid/renewal/find-next-cert.sql

10 lines
444 B
MySQL
Raw Normal View History

select cert.id, cert.not_after, dns_acme.type, dns_acme.token, cert.temp_parent
2023-06-26 11:56:21 +01:00
from certificates as cert
left outer join dns_acme on cert.dns = dns_acme.id
2023-06-26 11:56:21 +01:00
where cert.active = 1
2023-07-10 17:51:14 +01:00
and (cert.auto_renew = 1 or cert.not_after IS NULL)
2023-06-26 11:56:21 +01:00
and cert.renewing = 0
and cert.renew_failed = 0
2023-06-29 02:37:00 +01:00
and (cert.not_after IS NULL or DATETIME(cert.not_after, 'utc', '-30 days') < DATETIME())
2023-07-10 17:51:14 +01:00
order by cert.temp_parent, cert.not_after DESC NULLS FIRST