chore: use md5 if enabled

This commit is contained in:
Chirag Aggarwal 2025-07-29 16:53:55 +05:30
parent 1731212ebb
commit 66786f20f0

View file

@ -122,9 +122,14 @@ class Maintenance extends Action
Console::info("[{$time}] Found " . \count($certificates) . " certificates for renewal, scheduling jobs.");
foreach ($certificates as $certificate) {
$rule = $dbForPlatform->findOne('rules', [
Query::equal('domain', [$certificate->getAttribute('domain')]),
]);
$domain = $certificate->getAttribute('domain');
if (System::getEnv('_APP_RULES_FORMAT') === 'md5') {
$rule = $dbForPlatform->getDocument('rules', md5($domain));
} else {
$rule = $dbForPlatform->findOne('rules', [
Query::equal('domain', [$domain]),
]);
}
if ($rule->isEmpty() || $rule->getAttribute('region') !== System::getEnv('_APP_REGION', 'default')) {
continue;