diff --git a/app/controllers/api/console.php b/app/controllers/api/console.php index b00958a944..9286d6d35e 100644 --- a/app/controllers/api/console.php +++ b/app/controllers/api/console.php @@ -51,7 +51,8 @@ App::get('/v1/console/variables') '_APP_VCS_ENABLED' => $isVcsEnabled, '_APP_DOMAIN_ENABLED' => $isDomainEnabled, '_APP_ASSISTANT_ENABLED' => $isAssistantEnabled, - '_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES') + '_APP_DOMAIN_SITES' => System::getEnv('_APP_DOMAIN_SITES'), + '_APP_OPTIONS_FORCE_HTTPS' => System::getEnv('_APP_OPTIONS_FORCE_HTTPS') ]); $response->dynamic($variables, Response::MODEL_CONSOLE_VARIABLES); diff --git a/composer.json b/composer.json index a04ca51d43..6ed1db1530 100644 --- a/composer.json +++ b/composer.json @@ -96,6 +96,10 @@ "config": { "platform": { "php": "8.3" + }, + "allow-plugins": { + "php-http/discovery": true, + "tbachert/spi": true } } } diff --git a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php index cf40362fc3..59d22296d1 100644 --- a/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php +++ b/src/Appwrite/Utopia/Response/Model/ConsoleVariables.php @@ -57,7 +57,16 @@ class ConsoleVariables extends Model 'description' => 'A domain to use for site URLs.', 'default' => '', 'example' => 'sites.localhost', - ]); + ]) + ->addRule( + '_APP_OPTIONS_FORCE_HTTPS', + [ + 'type' => self::TYPE_STRING, + 'description' => 'Defines if HTTPS is enforced for all requests.', + 'default' => '', + 'example' => 'enabled', + ] + ); } /** diff --git a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php index 4720a6d2fb..fb65adc299 100644 --- a/tests/e2e/Services/Console/ConsoleConsoleClientTest.php +++ b/tests/e2e/Services/Console/ConsoleConsoleClientTest.php @@ -24,7 +24,7 @@ class ConsoleConsoleClientTest extends Scope ], $this->getHeaders())); $this->assertEquals(200, $response['headers']['status-code']); - $this->assertCount(8, $response['body']); + $this->assertCount(9, $response['body']); $this->assertIsString($response['body']['_APP_DOMAIN_TARGET']); $this->assertIsInt($response['body']['_APP_STORAGE_LIMIT']); $this->assertIsInt($response['body']['_APP_COMPUTE_SIZE_LIMIT']); @@ -33,5 +33,6 @@ class ConsoleConsoleClientTest extends Scope $this->assertIsBool($response['body']['_APP_VCS_ENABLED']); $this->assertIsBool($response['body']['_APP_ASSISTANT_ENABLED']); $this->assertIsString($response['body']['_APP_DOMAIN_SITES']); + $this->assertIsString($response['body']['_APP_OPTIONS_FORCE_HTTPS']); } }