Merge branch '1.6.x' into feat-new-session-alert
This commit is contained in:
commit
f72f9c7881
10 changed files with 13 additions and 3 deletions
2
.env
2
.env
|
@ -17,7 +17,7 @@ _APP_OPTIONS_ROUTER_PROTECTION=disabled
|
||||||
_APP_OPTIONS_FORCE_HTTPS=disabled
|
_APP_OPTIONS_FORCE_HTTPS=disabled
|
||||||
_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled
|
_APP_OPTIONS_FUNCTIONS_FORCE_HTTPS=disabled
|
||||||
_APP_OPENSSL_KEY_V1=your-secret-key
|
_APP_OPENSSL_KEY_V1=your-secret-key
|
||||||
_APP_DOMAIN=localhost
|
_APP_DOMAIN=traefik
|
||||||
_APP_DOMAIN_FUNCTIONS=functions.localhost
|
_APP_DOMAIN_FUNCTIONS=functions.localhost
|
||||||
_APP_DOMAIN_TARGET=localhost
|
_APP_DOMAIN_TARGET=localhost
|
||||||
_APP_REDIS_HOST=redis
|
_APP_REDIS_HOST=redis
|
||||||
|
|
|
@ -1793,6 +1793,7 @@ App::post('/v1/functions/:functionId/executions')
|
||||||
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Execute function */
|
/** Execute function */
|
||||||
|
|
|
@ -250,6 +250,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
|
||||||
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Execute function */
|
/** Execute function */
|
||||||
|
@ -901,7 +902,7 @@ App::get('/robots.txt')
|
||||||
$host = $request->getHostname() ?? '';
|
$host = $request->getHostname() ?? '';
|
||||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||||
|
|
||||||
if ($host === $mainDomain) {
|
if ($host === $mainDomain || $host === 'localhost') {
|
||||||
$template = new View(__DIR__ . '/../views/general/robots.phtml');
|
$template = new View(__DIR__ . '/../views/general/robots.phtml');
|
||||||
$response->text($template->render(false));
|
$response->text($template->render(false));
|
||||||
} else {
|
} else {
|
||||||
|
@ -926,7 +927,7 @@ App::get('/humans.txt')
|
||||||
$host = $request->getHostname() ?? '';
|
$host = $request->getHostname() ?? '';
|
||||||
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
$mainDomain = System::getEnv('_APP_DOMAIN', '');
|
||||||
|
|
||||||
if ($host === $mainDomain) {
|
if ($host === $mainDomain || $host === 'localhost') {
|
||||||
$template = new View(__DIR__ . '/../views/general/humans.phtml');
|
$template = new View(__DIR__ . '/../views/general/humans.phtml');
|
||||||
$response->text($template->render(false));
|
$response->text($template->render(false));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -400,6 +400,7 @@ class Builds extends Action
|
||||||
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$command = $deployment->getAttribute('commands', '');
|
$command = $deployment->getAttribute('commands', '');
|
||||||
|
|
|
@ -462,6 +462,7 @@ class Functions extends Action
|
||||||
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
'APPWRITE_FUNCTION_PROJECT_ID' => $project->getId(),
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => $runtime['name'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $runtime['version'] ?? '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Execute function */
|
/** Execute function */
|
||||||
|
|
|
@ -314,6 +314,7 @@ class FunctionsCustomClientTest extends Scope
|
||||||
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
||||||
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
||||||
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||||
|
$this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
||||||
|
@ -698,6 +699,7 @@ class FunctionsCustomClientTest extends Scope
|
||||||
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
||||||
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
$this->assertEquals('PHP', $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
||||||
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
$this->assertEquals('8.0', $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||||
|
$this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
||||||
|
|
|
@ -1265,6 +1265,7 @@ class FunctionsCustomServerTest extends Scope
|
||||||
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
$this->assertEquals('http', $output['APPWRITE_FUNCTION_TRIGGER']);
|
||||||
$this->assertEquals($runtimeName, $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
$this->assertEquals($runtimeName, $output['APPWRITE_FUNCTION_RUNTIME_NAME']);
|
||||||
$this->assertEquals($runtimeVersion, $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
$this->assertEquals($runtimeVersion, $output['APPWRITE_FUNCTION_RUNTIME_VERSION']);
|
||||||
|
$this->assertEquals(APP_VERSION_STABLE, $output['APPWRITE_VERSION']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_EVENT']);
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
$this->assertEquals('variable', $output['CUSTOM_VARIABLE']);
|
$this->assertEquals('variable', $output['CUSTOM_VARIABLE']);
|
||||||
|
|
|
@ -10,6 +10,7 @@ return function ($context) {
|
||||||
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE,
|
||||||
'APPWRITE_FUNCTION_EVENT' => $context->req->headers['x-appwrite-event'] ?? '',
|
'APPWRITE_FUNCTION_EVENT' => $context->req->headers['x-appwrite-event'] ?? '',
|
||||||
'APPWRITE_FUNCTION_EVENT_DATA' => $context->req->bodyRaw ?? '',
|
'APPWRITE_FUNCTION_EVENT_DATA' => $context->req->bodyRaw ?? '',
|
||||||
'APPWRITE_FUNCTION_DATA' => $context->req->bodyRaw ?? '',
|
'APPWRITE_FUNCTION_DATA' => $context->req->bodyRaw ?? '',
|
||||||
|
|
|
@ -8,6 +8,7 @@ return function ($context) {
|
||||||
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE,
|
||||||
'UNICODE_TEST' => "êä"
|
'UNICODE_TEST' => "êä"
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
|
@ -8,6 +8,7 @@ return function ($context) {
|
||||||
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
'APPWRITE_FUNCTION_TRIGGER' => $context->req->headers['x-appwrite-trigger'] ?? '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_NAME' => \getenv('APPWRITE_FUNCTION_RUNTIME_NAME') ?: '',
|
||||||
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
'APPWRITE_FUNCTION_RUNTIME_VERSION' => \getenv('APPWRITE_FUNCTION_RUNTIME_VERSION') ?: '',
|
||||||
|
'APPWRITE_VERSION' => APP_VERSION_STABLE,
|
||||||
'UNICODE_TEST' => "êä",
|
'UNICODE_TEST' => "êä",
|
||||||
'GLOBAL_VARIABLE' => \getenv('GLOBAL_VARIABLE') ?: ''
|
'GLOBAL_VARIABLE' => \getenv('GLOBAL_VARIABLE') ?: ''
|
||||||
]);
|
]);
|
||||||
|
|
Loading…
Reference in a new issue