mirror of
https://github.com/appwrite/appwrite
synced 2026-05-17 14:08:39 +00:00
Merge branch 'main' into update-sdks-devkeys
This commit is contained in:
commit
080cc4a93f
8 changed files with 80 additions and 37 deletions
|
|
@ -214,11 +214,42 @@ App::patch('/v1/proxy/rules/:ruleId/verification')
|
|||
throw new Exception(Exception::RULE_NOT_FOUND);
|
||||
}
|
||||
|
||||
$validators = [];
|
||||
$targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_TARGET_CNAME', ''));
|
||||
if ($targetCNAME->isKnown() && !$targetCNAME->isTest()) {
|
||||
$validators[] = new DNS($targetCNAME->get(), DNS::RECORD_CNAME);
|
||||
$targetCNAME = null;
|
||||
switch ($rule->getAttribute('type', '')) {
|
||||
case 'api':
|
||||
// For example: fra.cloud.appwrite.io
|
||||
$targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_TARGET_CNAME', ''));
|
||||
break;
|
||||
case 'redirect':
|
||||
// For example: appwrite.network
|
||||
$targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', ''));
|
||||
break;
|
||||
case 'deployment':
|
||||
switch ($rule->getAttribute('deploymentResourceType', '')) {
|
||||
case 'function':
|
||||
// For example: fra.appwrite.run
|
||||
$targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_FUNCTIONS', ''));
|
||||
break;
|
||||
case 'site':
|
||||
// For example: appwrite.network
|
||||
$targetCNAME = new Domain(System::getEnv('_APP_DOMAIN_SITES', ''));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// no break
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
$validators = [];
|
||||
|
||||
if (!is_null($targetCNAME)) {
|
||||
if ($targetCNAME->isKnown() && !$targetCNAME->isTest()) {
|
||||
$validators[] = new DNS($targetCNAME->get(), DNS::RECORD_CNAME);
|
||||
}
|
||||
}
|
||||
|
||||
if ((new IP(IP::V4))->isValid(System::getEnv('_APP_DOMAIN_TARGET_A', ''))) {
|
||||
$validators[] = new DNS(System::getEnv('_APP_DOMAIN_TARGET_A', ''), DNS::RECORD_A);
|
||||
}
|
||||
|
|
@ -260,7 +291,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();
|
||||
|
||||
|
|
|
|||
|
|
@ -479,35 +479,37 @@ switch ($type) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div x-show="page === 'trace'" class="error-trace">
|
||||
<button class="back-button" x-on:click="page = 'error'">
|
||||
Back
|
||||
</button>
|
||||
<div class="trace-grid-header">Error trace</div>
|
||||
<?php foreach ($trace as $index => $traceItem): ?>
|
||||
<div class="trace-grid">
|
||||
<?php if (isset($traceItem['file'])): ?>
|
||||
<div class="trace-label">file</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['file']); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($development) : ?>
|
||||
<div x-show="page === 'trace'" class="error-trace">
|
||||
<button class="back-button" x-on:click="page = 'error'">
|
||||
Back
|
||||
</button>
|
||||
<div class="trace-grid-header">Error trace</div>
|
||||
<?php foreach ($trace as $index => $traceItem): ?>
|
||||
<div class="trace-grid">
|
||||
<?php if (isset($traceItem['file'])): ?>
|
||||
<div class="trace-label">file</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['file']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($traceItem['line'])): ?>
|
||||
<div class="trace-label">line</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['line']); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($traceItem['line'])): ?>
|
||||
<div class="trace-label">line</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['line']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($traceItem['function'])): ?>
|
||||
<div class="trace-label">function</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['function']); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($traceItem['function'])): ?>
|
||||
<div class="trace-label">function</div>
|
||||
<div class="trace-value"><?php echo $this->print($traceItem['function']); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($traceItem['args'])): ?>
|
||||
<div class="trace-label">args</div>
|
||||
<div class="trace-args"><pre><?php echo $this->print(\var_export($traceItem['args'], true)); ?></pre></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php if (isset($traceItem['args'])): ?>
|
||||
<div class="trace-label">args</div>
|
||||
<div class="trace-args"><pre><?php echo $this->print(\var_export($traceItem['args'], true)); ?></pre></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div x-show="page === 'error'" class="brand">
|
||||
|
|
|
|||
|
|
@ -1218,13 +1218,22 @@ class Builds extends Action
|
|||
$message .= "\n[31m" . $error;
|
||||
}
|
||||
|
||||
// Combine with previous logs if deployment got past build process
|
||||
$previousLogs = '';
|
||||
if (!empty($deployment->getAttribute('buildEndedAt', ''))) {
|
||||
$previousLogs = $deployment->getAttribute('buildLogs', '');
|
||||
if (!empty($previousLogs)) {
|
||||
$message = $previousLogs . "\n" . $message;
|
||||
}
|
||||
}
|
||||
|
||||
$endTime = DateTime::now();
|
||||
$durationEnd = \microtime(true);
|
||||
$deployment->setAttribute('buildEndedAt', $endTime);
|
||||
$deployment->setAttribute('buildDuration', \intval(\ceil($durationEnd - $durationStart)));
|
||||
$deployment->setAttribute('status', 'failed');
|
||||
$deployment->setAttribute('buildLogs', $deployment->getAttribute('buildLogs', '') . "\n" . $message);
|
||||
|
||||
$deployment->setAttribute('buildLogs', $message);
|
||||
$deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment);
|
||||
|
||||
if ($deployment->getInternalId() === $resource->getAttribute('latestDeploymentInternalId', '')) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue