An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: if $SERVICE found in the service specific configuration, then search for it in the db
Andras Bacsai9b55a2fb43dd
diff --git a/app/Models/Service.php b/app/Models/Service.phpindex 1df579802d..25e6b92ea5 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -1050,10 +1050,11 @@ class Service extends BaseModel$fields->put('MySQL', $data->toArray());break;case $image->contains('mariadb'):- $userVariables = ['SERVICE_USER_MARIADB', 'SERVICE_USER_WORDPRESS', '_APP_DB_USER', 'SERVICE_USER_MYSQL', 'MYSQL_USER'];+ $userVariables = ['SERVICE_USER_MARIADB', 'SERVICE_USER_WORDPRESS', 'SERVICE_USER_MYSQL', 'MYSQL_USER'];$passwordVariables = ['SERVICE_PASSWORD_MARIADB', 'SERVICE_PASSWORD_WORDPRESS', '_APP_DB_PASS', 'MYSQL_PASSWORD'];$rootPasswordVariables = ['SERVICE_PASSWORD_MARIADBROOT', 'SERVICE_PASSWORD_ROOT', '_APP_DB_ROOT_PASS', 'MYSQL_ROOT_PASSWORD'];$dbNameVariables = ['SERVICE_DATABASE_MARIADB', 'SERVICE_DATABASE_WORDPRESS', '_APP_DB_SCHEMA', 'MYSQL_DATABASE'];+$mariadb_user = $this->environment_variables()->whereIn('key', $userVariables)->first();$mariadb_password = $this->environment_variables()->whereIn('key', $passwordVariables)->first();$mariadb_root_password = $this->environment_variables()->whereIn('key', $rootPasswordVariables)->first();@@ -1102,6 +1103,23 @@ class Service extends BaseModelbreak;}}+ $fields = collect($fields)->map(function ($extraFields) {+ if (is_array($extraFields)) {+ $extraFields = collect($extraFields)->map(function ($field) {+ if (filled($field['value']) && str($field['value'])->startsWith('$SERVICE_')) {+ $searchValue = str($field['value'])->after('$')->value;+ $newValue = $this->environment_variables()->where('key', $searchValue)->first();+ if ($newValue) {+ $field['value'] = $newValue->value;+ }+ }++ return $field;+ });+ }++ return $extraFields;+ });return $fields;}