Skip to content

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.

Add Tolgee authentication fields to Service.php

Andras Bacsai3656adf059ef
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 49939ee8b1..5de1a97454 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -150,6 +150,29 @@ class Service extends BaseModel
foreach ($applications as $application) {
$image = str($application->image)->before(':')->value();
switch ($image) {
+ case str($image)?->contains('tolgee'):
+ $data = collect([]);
+ $admin_password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_TOLGEE')->first();
+ $data = $data->merge([
+ 'Admin User' => [
+ 'key' => 'TOLGEE_AUTHENTICATION_INITIAL_USERNAME',
+ 'value' => 'admin',
+ 'readonly' => true,
+ 'rules' => 'required',
+ ],
+ ]);
+ if ($admin_password) {
+ $data = $data->merge([
+ 'Admin Password' => [
+ 'key' => 'SERVICE_PASSWORD_TOLGEE',
+ 'value' => data_get($admin_password, 'value'),
+ 'rules' => 'required',
+ 'isPassword' => true,
+ ],
+ ]);
+ }
+ $fields->put('Tolgee', $data);
+ break;
case str($image)?->contains('logto'):
$data = collect([]);
$logto_endpoint = $this->environment_variables()->where('key', 'LOGTO_ENDPOINT')->first();