feat: rename environment variable
This commit is contained in:
parent
86e8470784
commit
da16c0159b
4
.env
4
.env
|
@ -23,8 +23,8 @@ _APP_DB_SCHEMA=appwrite
|
|||
_APP_DB_USER=user
|
||||
_APP_DB_PASS=password
|
||||
_APP_DB_ROOT_PASS=rootsecretpassword
|
||||
_APP_PROJECT_DB=db_fra1_02=mysql://user:password@mariadb:3306/appwrite
|
||||
_APP_CONSOLE_DB=db_fra1_01=mysql://user:password@mariadb:3306/appwrite
|
||||
_APP_DB_PROJECT=db_fra1_02=mysql://user:password@mariadb:3306/appwrite
|
||||
_APP_DB_CONSOLE=db_fra1_01=mysql://user:password@mariadb:3306/appwrite
|
||||
_APP_STORAGE_DEVICE=Local
|
||||
_APP_STORAGE_S3_ACCESS_KEY=
|
||||
_APP_STORAGE_S3_SECRET=
|
||||
|
|
|
@ -289,7 +289,7 @@ return [
|
|||
'filter' => 'password'
|
||||
],
|
||||
[
|
||||
'name' => '_APP_PROJECT_DB',
|
||||
'name' => '_APP_DB_PROJECT',
|
||||
'description' => 'A list of comma separated key value pairs for Project DBs where key is the database name and value is the DSN connection string. Example: db_fra1_01=mysql://user:password@112.145.123.1:3306/appwrite, db_fra1_02=mysql://user:password@112.145.123.5:3306/appwrite',
|
||||
'introduction' => '0.16.0',
|
||||
'default' => 'db_fra1_02=mysql://user:password@mariadb:3306/appwrite',
|
||||
|
@ -298,7 +298,7 @@ return [
|
|||
'filter' => ''
|
||||
],
|
||||
[
|
||||
'name' => '_APP_CONSOLE_DB',
|
||||
'name' => '_APP_DB_CONSOLE',
|
||||
'introduction' => '0.16.0',
|
||||
'description' => 'A key value pair representing the console DB where key is the database name and value is the DSN connection string. Example: db_fra1_01=mysql://user:password@112.145.123.1:3306/appwrite',
|
||||
'default' => 'db_fra1_01=mysql://user:password@mariadb:3306/appwrite',
|
||||
|
|
|
@ -454,7 +454,7 @@ $register->set('logger', function () {
|
|||
|
||||
$register->set('dbPool', function () {
|
||||
/** Parse the console databases */
|
||||
$consoleDB = App::getEnv('_APP_CONSOLE_DB', '');
|
||||
$consoleDB = App::getEnv('_APP_DB_CONSOLE', '');
|
||||
$consoleDB = explode(',', $consoleDB)[0];
|
||||
$consoleDB = explode('=', $consoleDB);
|
||||
$name = $consoleDB[0];
|
||||
|
@ -463,7 +463,7 @@ $register->set('dbPool', function () {
|
|||
|
||||
/** Parse the project databases */
|
||||
$projectDBs = [];
|
||||
$projectDB = App::getEnv('_APP_PROJECT_DB', '');
|
||||
$projectDB = App::getEnv('_APP_DB_PROJECT', '');
|
||||
$projectDB = explode(',', $projectDB);
|
||||
foreach ($projectDB as $db) {
|
||||
$db = explode('=', $db);
|
||||
|
|
|
@ -138,8 +138,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_SMTP_HOST
|
||||
- _APP_SMTP_PORT
|
||||
- _APP_SMTP_SECURE
|
||||
|
@ -215,8 +215,8 @@ services:
|
|||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_REDIS_HOST
|
||||
- _APP_REDIS_PORT
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_USAGE_STATS
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
@ -242,8 +242,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
||||
|
@ -299,8 +299,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- *x-env-storage
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
@ -329,8 +329,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
||||
|
@ -357,8 +357,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
||||
|
@ -388,8 +388,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_LOGGING_PROVIDER
|
||||
- _APP_LOGGING_CONFIG
|
||||
|
||||
|
@ -415,8 +415,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_FUNCTIONS_TIMEOUT
|
||||
- _APP_EXECUTOR_SECRET
|
||||
- _APP_EXECUTOR_HOST
|
||||
|
@ -548,8 +548,8 @@ services:
|
|||
- _APP_REDIS_PORT
|
||||
- _APP_REDIS_USER
|
||||
- _APP_REDIS_PASS
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_MAINTENANCE_INTERVAL
|
||||
- _APP_MAINTENANCE_RETENTION_EXECUTION
|
||||
- _APP_MAINTENANCE_RETENTION_ABUSE
|
||||
|
@ -575,8 +575,8 @@ services:
|
|||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
- _APP_CONSOLE_DB
|
||||
- _APP_PROJECT_DB
|
||||
- _APP_DB_CONSOLE
|
||||
- _APP_DB_PROJECT
|
||||
- _APP_INFLUXDB_HOST
|
||||
- _APP_INFLUXDB_PORT
|
||||
- _APP_USAGE_AGGREGATION_INTERVAL
|
||||
|
|
|
@ -195,7 +195,7 @@ class DatabasePool
|
|||
{
|
||||
/** Get DB name from the console database */
|
||||
[$name, $internalID] = $this->getName($projectID, $redis);
|
||||
$pool = $this->pools[$name] ?? throw new Exception("Database pool with name : $name not found. Check the value of _APP_PROJECT_DB in .env", 500);
|
||||
$pool = $this->pools[$name] ?? throw new Exception("Database pool with name : $name not found. Check the value of _APP_DB_PROJECT in .env", 500);
|
||||
|
||||
$namespace = "_$internalID";
|
||||
$attempts = 0;
|
||||
|
@ -236,7 +236,7 @@ class DatabasePool
|
|||
public function getAnyFromPool(\Redis $redis): array
|
||||
{
|
||||
$name = array_rand($this->pools);
|
||||
$pool = $this->pools[$name] ?? throw new Exception("Database pool with name : $name not found. Check the value of _APP_PROJECT_DB in .env", 500);
|
||||
$pool = $this->pools[$name] ?? throw new Exception("Database pool with name : $name not found. Check the value of _APP_DB_PROJECT in .env", 500);
|
||||
|
||||
$attempts = 0;
|
||||
do {
|
||||
|
|
Loading…
Reference in a new issue