Compare commits

..
Author SHA1 Message Date
Matej Bačo d710b48ef5 Fix: flutter starter 2025-05-20 10:40:21 +02:00
Matej BačoandGitHub 1a7982f855 Merge pull request #9828 from appwrite/sites-certificates
certificates: add domainType to certificate worker
2025-05-20 10:16:14 +02:00
Fabian Gruber 14873824ce certificates: add domainType to certificate worker 2025-05-20 09:56:46 +02:00
Christy JacobandGitHub 24312e69f4 Merge pull request #9814 from appwrite/task-coroutine-hooks
fix: task coroutine hooks
2025-05-19 16:59:16 +04:00
Fabian Gruber 3274a38c9b fix: task coroutine hooks 2025-05-19 14:02:47 +02:00
Matej BačoandGitHub eb3b09cf0d Merge pull request #9816 from appwrite/chore-upgrade-libs
Chore: upgrade detection, executor and console
2025-05-19 13:16:24 +02:00
Matej Bačo e203ae7327 upgrade detection, executor and console 2025-05-19 13:02:04 +02:00
Matej BačoandGitHub 0ec7ff2cee Merge pull request #9812 from appwrite/fix-remove-search
Remove: `search` to maintain document structure
2025-05-19 11:59:04 +02:00
Darshan fc279cb30c remove: search from deployments. 2025-05-19 15:12:50 +05:30
Darshan abd2cead73 remove: search. 2025-05-19 15:03:59 +05:30
Eldad A. FuxandGitHub e7c9b3d900 Merge pull request #9810 from appwrite/fix-chunk-reading-realtime
Fix logic of chunk reading
2025-05-19 03:39:16 +01:00
Matej Bačo 6090ca50fc Fix logic of chunk reading 2025-05-19 04:35:44 +02:00
Christy JacobandGitHub 3ba0565e44 Merge pull request #9808 from appwrite/chore-update-domains
chore: update domains
2025-05-19 03:45:43 +02:00
Eldad A. FuxandGitHub 6dbb14bf7b Merge pull request #9809 from appwrite/1.7.x
1.7.x
2025-05-19 02:42:37 +01:00
Christy Jacob b8b0db7a2f chore: update domains 2025-05-19 05:34:38 +04:00
Eldad A. FuxandGitHub 728b758db5 Merge pull request #9806 from appwrite/feat-x-edge-bypass-gateway
feat: bypass gateway
2025-05-18 23:36:37 +01:00
loks0n 33dc7ea97c feat: bypass gateway 2025-05-18 23:23:06 +01:00
Matej BačoandGitHub da811de615 Merge pull request #9805 from appwrite/fix-site-env-vars
Fix: site env vars at runtime
2025-05-19 00:13:36 +02:00
Matej Bačo c1315019cb Litner fix 2025-05-18 23:53:56 +02:00
Matej Bačo 1eb642aff0 Fix site env vars at runtime 2025-05-18 23:53:43 +02:00
Matej BačoandGitHub 908d80e8d9 Merge pull request #9804 from appwrite/fix-function-create-compatibility
Fix: backwards compatibility for function creation
2025-05-18 23:15:59 +02:00
17 changed files with 78 additions and 50 deletions
+3
View File
@@ -10,6 +10,7 @@ use Appwrite\Event\StatsUsage;
use Appwrite\Platform\Appwrite;
use Appwrite\Runtimes\Runtimes;
use Executor\Executor;
use Swoole\Runtime;
use Swoole\Timer;
use Utopia\Cache\Adapter\Sharding;
use Utopia\Cache\Cache;
@@ -298,4 +299,6 @@ $cli
$cli->shutdown()->action(fn () => Timer::clearAll());
// Enable coroutines, but disable TCP hooks. These don't work until we use `\Utopia\Cache\Adapter\Pool` and `\Utopia\Database\Adapter\Pool`.
Runtime::enableCoroutine(SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP);
run($cli->run(...));
+1 -1
View File
@@ -478,7 +478,7 @@ return [
'frameworks' => [
getFramework('FLUTTER', [
'providerRootDirectory' => './',
'buildCommand' => 'bash build.sh',
'buildCommand' => 'bash prepare.sh && bash build.sh',
]),
],
'vcsProvider' => 'github',
-1
View File
@@ -252,7 +252,6 @@ $createGitDeployments = function (GitHub $github, string $providerInstallationId
'providerCommitUrl' => $providerCommitUrl,
'providerCommentId' => \strval($latestCommentId),
'providerBranch' => $providerBranch,
'search' => implode(' ', [$deploymentId, $resource->getAttribute('entrypoint', '')]),
'activate' => $activate,
])));
+26 -9
View File
@@ -452,16 +452,33 @@ function router(App $utopia, Database $dbForPlatform, callable $getProjectDB, Sw
$endpoint = $protocol . '://' . $hostname . "/v1";
// Appwrite vars
if ($type === 'function') {
$vars = \array_merge($vars, [
'APPWRITE_FUNCTION_API_ENDPOINT' => $endpoint,
'APPWRITE_FUNCTION_ID' => $resource->getId(),
'APPWRITE_FUNCTION_NAME' => $resource->getAttribute('name'),
'APPWRITE_FUNCTION_DEPLOYMENT' => $deployment->getId(),
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
'APPWRITE_FUNCTION_CPUS' => $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT,
'APPWRITE_FUNCTION_MEMORY' => $spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT,
]);
} elseif ($type === 'site') {
$vars = \array_merge($vars, [
'APPWRITE_SITE_API_ENDPOINT' => $endpoint,
'APPWRITE_SITE_ID' => $resource->getId(),
'APPWRITE_SITE_NAME' => $resource->getAttribute('name'),
'APPWRITE_SITE_DEPLOYMENT' => $deployment->getId(),
'APPWRITE_SITE_PROJECT_ID' => $project->getId(),
'APPWRITE_SITE_RUNTIME_NAME' => $runtime['name'] ?? '',
'APPWRITE_SITE_RUNTIME_VERSION' => $runtime['version'] ?? '',
'APPWRITE_SITE_CPUS' => $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT,
'APPWRITE_SITE_MEMORY' => $spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT,
]);
}
$vars = \array_merge($vars, [
'APPWRITE_FUNCTION_API_ENDPOINT' => $endpoint,
'APPWRITE_FUNCTION_ID' => $resource->getId(),
'APPWRITE_FUNCTION_NAME' => $resource->getAttribute('name'),
'APPWRITE_FUNCTION_DEPLOYMENT' => $deployment->getId(),
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
'APPWRITE_FUNCTION_CPUS' => $spec['cpus'] ?? APP_COMPUTE_CPUS_DEFAULT,
'APPWRITE_FUNCTION_MEMORY' => $spec['memory'] ?? APP_COMPUTE_MEMORY_DEFAULT,
'APPWRITE_VERSION' => APP_VERSION_STABLE,
'APPWRITE_REGION' => $project->getAttribute('region'),
'APPWRITE_DEPLOYMENT_TYPE' => $deployment->getAttribute('type', ''),
+1 -1
View File
@@ -54,7 +54,7 @@
"utopia-php/config": "0.2.*",
"utopia-php/detector": "0.1.*",
"utopia-php/database": "0.69.*",
"utopia-php/domains": "0.5.*",
"utopia-php/domains": "0.8.0",
"utopia-php/dsn": "0.2.1",
"utopia-php/framework": "0.33.*",
"utopia-php/fetch": "0.4.*",
Generated
+21 -20
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b6f5295db11727cb4e88e702dc97809d",
"content-hash": "9f5de64d73e2ef73d796fa64f2baf232",
"packages": [
{
"name": "adhocore/jwt",
@@ -3555,16 +3555,16 @@
},
{
"name": "utopia-php/detector",
"version": "0.1.4",
"version": "0.1.5",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/detector.git",
"reference": "895a4147463965b5f9cbc083b764b6476f547879"
"reference": "b5d6ba51352485b524589bc0ee8d07a9efafe718"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/detector/zipball/895a4147463965b5f9cbc083b764b6476f547879",
"reference": "895a4147463965b5f9cbc083b764b6476f547879",
"url": "https://api.github.com/repos/utopia-php/detector/zipball/b5d6ba51352485b524589bc0ee8d07a9efafe718",
"reference": "b5d6ba51352485b524589bc0ee8d07a9efafe718",
"shasum": ""
},
"require": {
@@ -3594,30 +3594,31 @@
],
"support": {
"issues": "https://github.com/utopia-php/detector/issues",
"source": "https://github.com/utopia-php/detector/tree/0.1.4"
"source": "https://github.com/utopia-php/detector/tree/0.1.5"
},
"time": "2025-04-09T11:50:45+00:00"
"time": "2025-05-19T11:01:28+00:00"
},
{
"name": "utopia-php/domains",
"version": "0.5.0",
"version": "0.8.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/domains.git",
"reference": "bf07f60326f8389f378ddf6fcde86217e5cfe18c"
"reference": "650463d2a1525273eb03223c48da9fb1a768bbf7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/domains/zipball/bf07f60326f8389f378ddf6fcde86217e5cfe18c",
"reference": "bf07f60326f8389f378ddf6fcde86217e5cfe18c",
"url": "https://api.github.com/repos/utopia-php/domains/zipball/650463d2a1525273eb03223c48da9fb1a768bbf7",
"reference": "650463d2a1525273eb03223c48da9fb1a768bbf7",
"shasum": ""
},
"require": {
"php": ">=8.0",
"utopia-php/framework": "0.*.*"
"utopia-php/framework": "0.33.*"
},
"require-dev": {
"laravel/pint": "1.2.*",
"phpstan/phpstan": "1.9.x-dev",
"phpunit/phpunit": "^9.3"
},
"type": "library",
@@ -3654,9 +3655,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/domains/issues",
"source": "https://github.com/utopia-php/domains/tree/0.5.0"
"source": "https://github.com/utopia-php/domains/tree/0.8.0"
},
"time": "2024-01-03T22:04:27+00:00"
"time": "2025-05-16T10:03:59+00:00"
},
{
"name": "utopia-php/dsn",
@@ -3746,16 +3747,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.19",
"version": "0.33.20",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "64c7b7bb8a8595ffe875fa8d4b7705684dbf46c0"
"reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/64c7b7bb8a8595ffe875fa8d4b7705684dbf46c0",
"reference": "64c7b7bb8a8595ffe875fa8d4b7705684dbf46c0",
"url": "https://api.github.com/repos/utopia-php/http/zipball/e1c7ab4e0b5b0a9a70256b1e00912e101e76a131",
"reference": "e1c7ab4e0b5b0a9a70256b1e00912e101e76a131",
"shasum": ""
},
"require": {
@@ -3787,9 +3788,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.19"
"source": "https://github.com/utopia-php/http/tree/0.33.20"
},
"time": "2025-03-06T11:37:49+00:00"
"time": "2025-05-18T23:51:21+00:00"
},
{
"name": "utopia-php/image",
+2 -2
View File
@@ -213,7 +213,7 @@ services:
appwrite-console:
<<: *x-logging
container_name: appwrite-console
image: appwrite/console:6.0.1
image: appwrite/console:6.0.7
restart: unless-stopped
networks:
- appwrite
@@ -951,7 +951,7 @@ services:
hostname: exc1
<<: *x-logging
stop_signal: SIGINT
image: openruntimes/executor:0.7.14
image: openruntimes/executor:0.7.16
restart: unless-stopped
networks:
- appwrite
+2 -2
View File
@@ -6,9 +6,9 @@ use Utopia\Logger\Log;
interface Adapter
{
public function issueCertificate(string $certName, string $domain): ?string;
public function issueCertificate(string $certName, string $domain, ?string $domainType): ?string;
public function isRenewRequired(string $domain, Log $log): bool;
public function isRenewRequired(string $domain, ?string $domainType, Log $log): bool;
public function deleteCertificate(string $domain): void;
}
+2 -2
View File
@@ -18,7 +18,7 @@ class LetsEncrypt implements Adapter
}
public function issueCertificate(string $certName, string $domain): ?string
public function issueCertificate(string $certName, string $domain, ?string $domainType): ?string
{
$stdout = '';
$stderr = '';
@@ -84,7 +84,7 @@ class LetsEncrypt implements Adapter
return DateTime::addSeconds($dt, -60 * 60 * 24 * 30);
}
public function isRenewRequired(string $domain, Log $log): bool
public function isRenewRequired(string $domain, ?string $domainType, Log $log): bool
{
$certPath = APP_STORAGE_CERTIFICATES . '/' . $domain . '/cert.pem';
if (\file_exists($certPath)) {
@@ -90,7 +90,6 @@ class Base extends Action
'providerCommitUrl' => $commitDetails['commitUrl'] ?? '',
'providerBranch' => $providerBranch,
'providerRootDirectory' => $function->getAttribute('providerRootDirectory', ''),
'search' => implode(' ', [$deploymentId, $entrypoint]),
'activate' => $activate,
]));
@@ -190,7 +189,6 @@ class Base extends Action
'providerCommitUrl' => $commitDetails['commitUrl'] ?? '',
'providerBranch' => $providerBranch,
'providerRootDirectory' => $site->getAttribute('providerRootDirectory', ''),
'search' => implode(' ', [$deploymentId]),
'activate' => $activate,
]));
@@ -738,11 +738,12 @@ class Builds extends Action
$insideSeparation = true;
}
} else {
$logs = '';
$separator = \strpos($logs, '{APPWRITE_DETECTION_SEPARATOR_END}');
if ($separator !== false) {
$logs = \substr($logs, $separator + strlen('{APPWRITE_DETECTION_SEPARATOR_END}'));
$insideSeparation = false;
} else {
$logs = '';
}
}
@@ -173,7 +173,8 @@ class Create extends Action
if ($rule->getAttribute('status', '') === 'verifying') {
$queueForCertificates
->setDomain(new Document([
'domain' => $rule->getAttribute('domain')
'domain' => $rule->getAttribute('domain'),
'domainType' => 'api',
]))
->trigger();
}
@@ -191,7 +191,8 @@ class Create extends Action
if ($rule->getAttribute('status', '') === 'verifying') {
$queueForCertificates
->setDomain(new Document([
'domain' => $rule->getAttribute('domain')
'domain' => $rule->getAttribute('domain'),
'domainType' => 'function',
]))
->trigger();
}
@@ -179,7 +179,8 @@ class Create extends Action
if ($rule->getAttribute('status', '') === 'verifying') {
$queueForCertificates
->setDomain(new Document([
'domain' => $rule->getAttribute('domain')
'domain' => $rule->getAttribute('domain'),
'domainType' => 'redirect',
]))
->trigger();
}
@@ -191,7 +191,8 @@ class Create extends Action
if ($rule->getAttribute('status', '') === 'verifying') {
$queueForCertificates
->setDomain(new Document([
'domain' => $rule->getAttribute('domain')
'domain' => $rule->getAttribute('domain'),
'domainType' => 'site',
]))
->trigger();
}
@@ -55,7 +55,7 @@ class Certificates extends Action
->inject('log')
->inject('certificates')
->inject('plan')
->callback([$this, 'action']);
->callback($this->action(...));
}
/**
@@ -96,11 +96,14 @@ class Certificates extends Action
$log->addTag('domain', $domain->get());
$this->execute($domain, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan);
$domainType = $payload['domainType'] ?? null;
$this->execute($domain, $domainType, $dbForPlatform, $queueForMails, $queueForEvents, $queueForWebhooks, $queueForFunctions, $queueForRealtime, $log, $certificates, $skipRenewCheck, $plan);
}
/**
* @param Domain $domain
* @param ?string $domainType
* @param Database $dbForPlatform
* @param Mail $queueForMails
* @param Event $queueForEvents
@@ -115,6 +118,7 @@ class Certificates extends Action
*/
private function execute(
Domain $domain,
?string $domainType,
Database $dbForPlatform,
Mail $queueForMails,
Event $queueForEvents,
@@ -174,7 +178,7 @@ class Certificates extends Action
$this->validateDomain($domain, $isMainDomain, $log);
// If certificate exists already, double-check expiry date. Skip if job is forced
if (!$certificates->isRenewRequired($domain->get(), $log)) {
if (!$certificates->isRenewRequired($domain->get(), $domainType, $log)) {
Console::info("Skipping, renew isn't required");
return;
}
@@ -182,7 +186,7 @@ class Certificates extends Action
// Prepare unique cert name. Using this helps prevent miss-match in configuration when renewing certificates.
$certName = ID::unique();
$renewDate = $certificates->issueCertificate($certName, $domain->get());
$renewDate = $certificates->issueCertificate($certName, $domain->get(), $domainType);
// Command succeeded, store all data into document
$certificate->setAttribute('logs', 'Certificate successfully generated.');
+2 -1
View File
@@ -37,7 +37,8 @@ class Executor
$this->headers = [
'content-type' => 'application/json',
'authorization' => 'Bearer ' . System::getEnv('_APP_EXECUTOR_SECRET', ''),
'x-opr-addressing-method' => 'anycast-efficient'
'x-opr-addressing-method' => 'anycast-efficient',
'x-edge-bypass-gateway' => '1'
];
}