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
Add extra fields for MinIO, Weblate, and Ghost services
Andras Bacsai10e5a58b9e2c
diff --git a/app/Http/Livewire/Project/Service/StackForm.php b/app/Http/Livewire/Project/Service/StackForm.phpindex ebdb2d4811..44caa29ffb 100644--- a/app/Http/Livewire/Project/Service/StackForm.php+++ b/app/Http/Livewire/Project/Service/StackForm.php@@ -31,6 +31,7 @@ class StackForm extends Component"name" => $fieldKey,"value" => $value,"isPassword" => $isPassword,+ "rules" => $rules];$this->rules["fields.$key.value"] = $rules;$this->validationAttributes["fields.$key.value"] = $fieldKey;diff --git a/app/Models/Service.php b/app/Models/Service.phpindex 2d3e17e984..a05c989b8e 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -52,7 +52,7 @@ class Service extends BaseModelforeach ($applications as $application) {$image = str($application->image)->before(':')->value();switch ($image) {- case str($image)->contains('minio'):+ case str($image)?->contains('minio'):$data = collect([]);$console_url = $this->environment_variables()->where('key', 'MINIO_BROWSER_REDIRECT_URL')->first();$s3_api_url = $this->environment_variables()->where('key', 'MINIO_SERVER_URL')->first();@@ -105,7 +105,7 @@ class Service extends BaseModel$fields->put('MinIO', $data->toArray());break;- case str($image)->contains('weblate'):+ case str($image)?->contains('weblate'):$data = collect([]);$admin_email = $this->environment_variables()->where('key', 'WEBLATE_ADMIN_EMAIL')->first();$admin_password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_WEBLATE')->first();@@ -130,6 +130,67 @@ class Service extends BaseModel]);}$fields->put('Weblate', $data);+ break;+ case str($image)?->contains('ghost'):+ $data = collect([]);+ $MAIL_OPTIONS_AUTH_PASS = $this->environment_variables()->where('key', 'MAIL_OPTIONS_AUTH_PASS')->first();+ $MAIL_OPTIONS_AUTH_USER = $this->environment_variables()->where('key', 'MAIL_OPTIONS_AUTH_USER')->first();+ $MAIL_OPTIONS_SECURE = $this->environment_variables()->where('key', 'MAIL_OPTIONS_SECURE')->first();+ $MAIL_OPTIONS_PORT = $this->environment_variables()->where('key', 'MAIL_OPTIONS_PORT')->first();+ $MAIL_OPTIONS_SERVICE = $this->environment_variables()->where('key', 'MAIL_OPTIONS_SERVICE')->first();+ $MAIL_OPTIONS_HOST = $this->environment_variables()->where('key', 'MAIL_OPTIONS_HOST')->first();+ if ($MAIL_OPTIONS_AUTH_PASS) {+ $data = $data->merge([+ 'Mail Password' => [+ 'key' => data_get($MAIL_OPTIONS_AUTH_PASS, 'key'),+ 'value' => data_get($MAIL_OPTIONS_AUTH_PASS, 'value'),+ 'isPassword' => true,+ ],+ ]);+ }+ if ($MAIL_OPTIONS_AUTH_USER) {+ $data = $data->merge([+ 'Mail User' => [+ 'key' => data_get($MAIL_OPTIONS_AUTH_USER, 'key'),+ 'value' => data_get($MAIL_OPTIONS_AUTH_USER, 'value'),+ ],+ ]);+ }+ if ($MAIL_OPTIONS_SECURE) {+ $data = $data->merge([+ 'Mail Secure' => [+ 'key' => data_get($MAIL_OPTIONS_SECURE, 'key'),+ 'value' => data_get($MAIL_OPTIONS_SECURE, 'value'),+ ],+ ]);+ }+ if ($MAIL_OPTIONS_PORT) {+ $data = $data->merge([+ 'Mail Port' => [+ 'key' => data_get($MAIL_OPTIONS_PORT, 'key'),+ 'value' => data_get($MAIL_OPTIONS_PORT, 'value'),+ ],+ ]);+ }+ if ($MAIL_OPTIONS_SERVICE) {+ $data = $data->merge([+ 'Mail Service' => [+ 'key' => data_get($MAIL_OPTIONS_SERVICE, 'key'),+ 'value' => data_get($MAIL_OPTIONS_SERVICE, 'value'),+ ],+ ]);+ }+ if ($MAIL_OPTIONS_HOST) {+ $data = $data->merge([+ 'Mail Host' => [+ 'key' => data_get($MAIL_OPTIONS_HOST, 'key'),+ 'value' => data_get($MAIL_OPTIONS_HOST, 'value'),+ ],+ ]);+ }++ $fields->put('Ghost', $data);+ break;}}$databases = $this->databases()->get();diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.phpindex fef40aed84..d6ef6f1ce2 100644--- a/bootstrap/helpers/docker.php+++ b/bootstrap/helpers/docker.php@@ -188,6 +188,7 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource,$MINIO_SERVER_URL->value,]);}+ break;}return $payload;}diff --git a/resources/views/livewire/project/service/stack-form.blade.php b/resources/views/livewire/project/service/stack-form.blade.phpindex c8a853b373..65ead1777f 100644--- a/resources/views/livewire/project/service/stack-form.blade.php+++ b/resources/views/livewire/project/service/stack-form.blade.php@@ -18,7 +18,8 @@</div><div class="grid grid-cols-2 gap-2">@foreach ($fields as $serviceName => $field)- <x-forms.input type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}" required+ <x-forms.input type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}"+ required="{{ str(data_get($field, 'rules'))?->contains('required') }}"helper="Variable name: {{ $serviceName }}"label="{{ data_get($field, 'serviceName') }} {{ data_get($field, 'name') }}"id="fields.{{ $serviceName }}.value"></x-forms.input>