From 7a131d3508016a1eedd8110502e31abdd37a52f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 14 Mar 2025 13:56:37 +0100 Subject: [PATCH] Post-merge fixes --- .../Platform/Modules/Proxy/Http/Rules/API/Create.php | 10 ++++++++++ .../Modules/Proxy/Http/Rules/Function/Create.php | 10 ++++++++++ .../Modules/Proxy/Http/Rules/Redirect/Create.php | 10 ++++++++++ .../Platform/Modules/Proxy/Http/Rules/Site/Create.php | 10 ++++++++++ 4 files changed, 40 insertions(+) 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 4c7b38d80f..50c56b7ea3 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/API/Create.php @@ -117,6 +117,14 @@ class Create extends Action } } + $owner = ''; + if ( + ($functionsDomain != '' && \str_ends_with($domain->get(), $functionsDomain)) || + ($sitesDomain != '' && \str_ends_with($domain->get(), $sitesDomain)) + ) { + $owner = 'Appwrite'; + } + $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -127,6 +135,8 @@ class Create extends Action 'trigger' => 'manual', 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get()]), + 'owner' => $owner, + 'region' => $project->getAttribute('region') ]); try { 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 fea02ddde9..890eb00dec 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Function/Create.php @@ -125,6 +125,14 @@ class Create extends Action } } + $owner = ''; + if ( + ($functionsDomain != '' && \str_ends_with($domain->get(), $functionsDomain)) || + ($sitesDomain != '' && \str_ends_with($domain->get(), $sitesDomain)) + ) { + $owner = 'Appwrite'; + } + $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -141,6 +149,8 @@ class Create extends Action 'deploymentVcsProviderBranch' => $branch, 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get(), $branch]), + 'owner' => $owner, + 'region' => $project->getAttribute('region') ]); try { 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 26e1dd8809..5e6f69af4b 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Redirect/Create.php @@ -117,6 +117,14 @@ class Create extends Action } } + $owner = ''; + if ( + ($functionsDomain != '' && \str_ends_with($domain->get(), $functionsDomain)) || + ($sitesDomain != '' && \str_ends_with($domain->get(), $sitesDomain)) + ) { + $owner = 'Appwrite'; + } + $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -129,6 +137,8 @@ class Create extends Action 'redirectStatusCode' => $statusCode, 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get()]), + 'owner' => $owner, + 'region' => $project->getAttribute('region') ]); try { 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 4090750285..4506f10dce 100644 --- a/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php +++ b/src/Appwrite/Platform/Modules/Proxy/Http/Rules/Site/Create.php @@ -125,6 +125,14 @@ class Create extends Action } } + $owner = ''; + if ( + ($functionsDomain != '' && \str_ends_with($domain->get(), $functionsDomain)) || + ($sitesDomain != '' && \str_ends_with($domain->get(), $sitesDomain)) + ) { + $owner = 'Appwrite'; + } + $rule = new Document([ '$id' => $ruleId, 'projectId' => $project->getId(), @@ -141,6 +149,8 @@ class Create extends Action 'deploymentVcsProviderBranch' => $branch, 'certificateId' => '', 'search' => implode(' ', [$ruleId, $domain->get(), $branch]), + 'owner' => $owner, + 'region' => $project->getAttribute('region') ]); try {