mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
ai review fixes
This commit is contained in:
@@ -341,7 +341,7 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
|
||||
$projectId = $project->getId();
|
||||
|
||||
// Deployment preview
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
$ruleId = md5($domain);
|
||||
$previewRuleId = $ruleId;
|
||||
|
||||
@@ -1105,7 +1105,7 @@ App::init()
|
||||
// 5. Create new rule
|
||||
$owner = '';
|
||||
|
||||
// Mark owner as Appwrite if its appwirte-owned domain
|
||||
// Mark owner as Appwrite if its appwrite-owned domain
|
||||
$appwriteDomains = [];
|
||||
$appwriteDomainEnvs = [
|
||||
System::getEnv('_APP_DOMAIN_FUNCTIONS_FALLBACK', ''),
|
||||
|
||||
@@ -105,6 +105,9 @@ function dispatch(Server $server, int $fd, int $type, $data = null): int
|
||||
$risky = true;
|
||||
} else {
|
||||
foreach (\explode(',', System::getEnv('_APP_DOMAIN_FUNCTIONS')) as $riskyDomain) {
|
||||
if (empty($riskyDomain)) {
|
||||
continue;
|
||||
}
|
||||
if (str_ends_with($domain, $riskyDomain)) {
|
||||
$risky = true;
|
||||
break;
|
||||
|
||||
@@ -235,7 +235,7 @@ class Base extends Action
|
||||
->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', ''));
|
||||
$dbForProject->updateDocument('sites', $site->getId(), $site);
|
||||
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
|
||||
// TODO: (@Meldiron) Remove after 1.7.x migration
|
||||
|
||||
@@ -92,7 +92,7 @@ class Get extends Action
|
||||
|
||||
$functionsDomains = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
foreach (\explode(',', $functionsDomains) as $functionsDomain) {
|
||||
if (empty($sitesDomain)) {
|
||||
if (empty($functionsDomain)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -1037,7 +1037,7 @@ class Builds extends Action
|
||||
// VCS branch
|
||||
$branchName = $deployment->getAttribute('providerBranch');
|
||||
if (!empty($branchName)) {
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$branchPrefix = substr($branchName, 0, 16);
|
||||
if (strlen($branchName) > 16) {
|
||||
$remainingChars = substr($branchName, 16);
|
||||
|
||||
@@ -50,7 +50,7 @@ class Action extends PlatformAction
|
||||
|
||||
$functionsDomains = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
|
||||
foreach (\explode(',', $functionsDomains) as $functionsDomain) {
|
||||
if (empty($sitesDomain)) {
|
||||
if (empty($functionsDomains)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -67,14 +67,6 @@ class Action extends PlatformAction
|
||||
throw new Exception(Exception::GENERAL_ARGUMENT_INVALID, 'This domain name is not allowed. Please use a different domain.');
|
||||
}
|
||||
|
||||
if (!empty($sitesDomain)) {
|
||||
$deniedDomains[] = $sitesDomain;
|
||||
}
|
||||
|
||||
if (!empty($functionsDomain)) {
|
||||
$deniedDomains[] = $functionsDomain;
|
||||
}
|
||||
|
||||
$denyListDomains = System::getEnv('_APP_CUSTOM_DOMAIN_DENY_LIST', '');
|
||||
$denyListDomains = \array_map('trim', explode(',', $denyListDomains));
|
||||
foreach ($denyListDomains as $denyListDomain) {
|
||||
@@ -141,11 +133,17 @@ class Action extends PlatformAction
|
||||
if ($resourceType === 'function') {
|
||||
// For example: fra.appwrite.run
|
||||
foreach (\explode(',', System::getEnv('_APP_DOMAIN_FUNCTIONS', '')) as $targetCNAME) {
|
||||
if (empty($targetCNAME)) {
|
||||
continue;
|
||||
}
|
||||
$targetCNAMEs[] = new Domain($targetCNAME);
|
||||
}
|
||||
} elseif ($resourceType === 'site') {
|
||||
// For example: appwrite.network
|
||||
foreach (\explode(',', System::getEnv('_APP_DOMAIN_SITES', '')) as $targetCNAME) {
|
||||
if (empty($targetCNAME)) {
|
||||
continue;
|
||||
}
|
||||
$targetCNAMEs[] = new Domain($targetCNAME);
|
||||
}
|
||||
} elseif ($ruleType === 'api') {
|
||||
|
||||
@@ -274,7 +274,7 @@ class Create extends Action
|
||||
->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', ''));
|
||||
$dbForProject->updateDocument('sites', $site->getId(), $site);
|
||||
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
|
||||
// TODO: (@Meldiron) Remove after 1.7.x migration
|
||||
@@ -344,7 +344,7 @@ class Create extends Action
|
||||
->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', ''));
|
||||
$dbForProject->updateDocument('sites', $site->getId(), $site);
|
||||
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
$ruleId = md5($domain);
|
||||
$authorization->skip(
|
||||
|
||||
@@ -145,7 +145,7 @@ class Create extends Action
|
||||
$dbForProject->updateDocument('sites', $site->getId(), $site);
|
||||
|
||||
// Preview deployments for sites
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
|
||||
// TODO: (@Meldiron) Remove after 1.7.x migration
|
||||
|
||||
@@ -189,7 +189,7 @@ class Create extends Base
|
||||
->setAttribute('latestDeploymentStatus', $deployment->getAttribute('status', ''));
|
||||
$dbForProject->updateDocument('sites', $site->getId(), $site);
|
||||
|
||||
$sitesDomain = $platform['sitePreviewDomain'];
|
||||
$sitesDomain = $platform['sitesDomain'];
|
||||
$domain = ID::unique() . "." . $sitesDomain;
|
||||
|
||||
// TODO: (@Meldiron) Remove after 1.7.x migration
|
||||
|
||||
@@ -312,6 +312,7 @@ class ProxyCustomServerTest extends Scope
|
||||
$rule = $this->getRule($wildcardRuleId);
|
||||
$this->assertSame(200, $rule['headers']['status-code']);
|
||||
$this->assertSame('verified', $rule['body']['status']);
|
||||
$this->cleanupRule($wildcardRuleId);
|
||||
}
|
||||
|
||||
$rules = $this->listRules([
|
||||
|
||||
Reference in New Issue
Block a user