orchid/renewal/find-next-cert.sql

10 lines
360 B
MySQL
Raw Normal View History

2023-06-29 02:37:00 +01:00
select cert.id, cert.not_after, dns.type, dns.token
2023-06-26 11:56:21 +01:00
from certificates as cert
left outer join dns on cert.dns = dns.id
where cert.active = 1
and cert.auto_renew = 1
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())
order by cert.not_after DESC NULLS FIRST