certificate status exception

This commit is contained in:
Hemachandar 2025-12-18 13:46:56 +05:30
parent 6f1d2d094a
commit 62b391ef68
4 changed files with 20 additions and 2 deletions

View file

@ -10,6 +10,8 @@ interface Adapter
public function isInstantGeneration(string $domain, ?string $domainType): bool;
public function getCertificateStatus(string $domain, ?string $domainType): string;
public function isRenewRequired(string $domain, ?string $domainType, Log $log): bool;
public function deleteCertificate(string $domain): void;

View file

@ -0,0 +1,10 @@
<?php
namespace Appwrite\Certificates\Exceptions;
use Exception;
// Exception thrown during certificate status retrieval
class CertificateStatus extends Exception
{
}

View file

@ -2,6 +2,7 @@
namespace Appwrite\Certificates;
use Appwrite\Certificates\Exceptions\CertificateStatus as CertificateStatusException;
use Exception;
use Utopia\App;
use Utopia\CLI\Console;
@ -89,6 +90,11 @@ class LetsEncrypt implements Adapter
return true;
}
public function getCertificateStatus(string $domain, ?string $domainType): string
{
throw new CertificateStatusException('Certificate status retrieval is not supported for LetsEncrypt.');
}
public function isRenewRequired(string $domain, ?string $domainType, Log $log): bool
{
$certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem';

View file

@ -30,8 +30,8 @@ class MaintenanceRules extends Action
public function action(Database $dbForPlatform, Certificate $queueForCertificates): void
{
Console::title('Interval V1');
Console::success(APP_NAME . ' interval process v1 has started');
Console::title('Rule maintenance V1');
Console::success(APP_NAME . ' rule maintenance process v1 has started');
$intervalRuleDomainVerification = (int) System::getEnv('_APP_MAINTENANCE_RULE_DOMAIN_VERIFICATION_INTERVAL', '60'); // 1 minute
$intervalRuleCertificateRenewal = (int) System::getEnv('_APP_MAINTENANCE_RULE_CERTIFICATE_RENEWAL_INTERVAL', '86400'); // 1 day