diff --git a/app/controllers/api/proxy.php b/app/controllers/api/proxy.php index e96f8bfb2c..8c30025551 100644 --- a/app/controllers/api/proxy.php +++ b/app/controllers/api/proxy.php @@ -260,7 +260,8 @@ App::patch('/v1/proxy/rules/:ruleId/verification') // Issue a TLS certificate when domain is verified $queueForCertificates ->setDomain(new Document([ - 'domain' => $rule->getAttribute('domain') + 'domain' => $rule->getAttribute('domain'), + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), ])) ->trigger(); diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php index 8ae48ab345..e4d0d2899f 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php @@ -174,7 +174,7 @@ class Create extends Action $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain'), - 'domainType' => 'api', + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), ])) ->trigger(); } diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php index 15d58c7b29..6c5a87a68d 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php @@ -192,7 +192,7 @@ class Create extends Action $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain'), - 'domainType' => 'function', + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), ])) ->trigger(); } diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php index 0ff41e5ac2..d0c9dbbbe3 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php @@ -180,7 +180,7 @@ class Create extends Action $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain'), - 'domainType' => 'redirect', + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), ])) ->trigger(); } diff --git a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php index f5f6628d68..894c954a32 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php @@ -192,7 +192,7 @@ class Create extends Action $queueForCertificates ->setDomain(new Document([ 'domain' => $rule->getAttribute('domain'), - 'domainType' => 'site', + 'domainType' => $rule->getAttribute('deploymentResourceType', $rule->getAttribute('type')), ])) ->trigger(); } diff --git a/src/Appwrite/Platform/Workers/Certificates.php b/src/Appwrite/Platform/Workers/Certificates.php index 4e83497cdd..0dce51cb52 100644 --- a/src/Appwrite/Platform/Workers/Certificates.php +++ b/src/Appwrite/Platform/Workers/Certificates.php @@ -96,7 +96,7 @@ class Certificates extends Action $log->addTag('domain', $domain->get()); - $domainType = $payload['domainType'] ?? null; + $domainType = $document->getAttribute('domainType'); $this->execute($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan); }