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
feat(auth): restrict sensitive data visibility for team members
Andras Bacsaic9246559994f
diff --git a/app/Http/Middleware/ApiAbility.php b/app/Http/Middleware/ApiAbility.phpindex d42e091360..874e638257 100644--- a/app/Http/Middleware/ApiAbility.php+++ b/app/Http/Middleware/ApiAbility.php@@ -21,9 +21,9 @@ class ApiAbility extends CheckForAnyAbility{try {$token = $request->user()->currentAccessToken();- $teamId = (int) data_get($token, 'team_id');+ $teamId = data_get($token, 'team_id');- if ($teamId && ! $request->user()->isAdminOfTeam($teamId)) {+ if ($teamId !== null && ! $request->user()->isAdminOfTeam((int) $teamId)) {$tokenAbilities = $token->abilities ?? [];$disallowed = array_intersect($tokenAbilities, self::MEMBER_DISALLOWED_ABILITIES);diff --git a/app/Livewire/Project/Application/Deployment/Show.php b/app/Livewire/Project/Application/Deployment/Show.phpindex 189dcca9bd..b8f5e891a1 100644--- a/app/Livewire/Project/Application/Deployment/Show.php+++ b/app/Livewire/Project/Application/Deployment/Show.php@@ -59,7 +59,9 @@ class Show extends Component$this->application_deployment_queue = $application_deployment_queue;$this->horizon_job_status = $this->application_deployment_queue->getHorizonJobStatus();$this->deployment_uuid = $deploymentUuid;- $this->is_debug_enabled = $this->application->settings->is_debug_enabled;+ $this->is_debug_enabled = auth()->user()->isMember()+ ? false+ : $this->application->settings->is_debug_enabled;$this->isKeepAliveOn();}diff --git a/app/Livewire/Project/Application/DeploymentNavbar.php b/app/Livewire/Project/Application/DeploymentNavbar.phpindex fcd0d4cf41..b60f543ba5 100644--- a/app/Livewire/Project/Application/DeploymentNavbar.php+++ b/app/Livewire/Project/Application/DeploymentNavbar.php@@ -28,7 +28,9 @@ class DeploymentNavbar extends Component{$this->application = Application::ownedByCurrentTeam()->find($this->application_deployment_queue->application_id);$this->server = $this->application->destination->server;- $this->is_debug_enabled = $this->application->settings->is_debug_enabled;+ $this->is_debug_enabled = auth()->user()->isMember()+ ? false+ : $this->application->settings->is_debug_enabled;}public function deploymentFinished()@@ -67,10 +69,15 @@ class DeploymentNavbar extends Componentreturn '';}+ $isMember = auth()->user()->isMember();+$markdown = "# Deployment Logs\n\n";$markdown .= "```\n";foreach ($logs as $log) {+ if ($isMember && ! empty($log['hidden'])) {+ continue;+ }if (isset($log['output'])) {$markdown .= $log['output']."\n";}diff --git a/app/Livewire/Project/Database/Clickhouse/General.php b/app/Livewire/Project/Database/Clickhouse/General.phpindex 7ad453fd58..e790f2a406 100644--- a/app/Livewire/Project/Database/Clickhouse/General.php+++ b/app/Livewire/Project/Database/Clickhouse/General.php@@ -44,6 +44,8 @@ class General extends Componentpublic bool $isLogDrainEnabled = false;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$teamId = Auth::user()->currentTeam()->id;@@ -67,6 +69,13 @@ class General extends Component} catch (\Throwable $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->clickhouseAdminPassword = '';+ $this->dbUrl = null;+ $this->dbUrlPublic = null;+ }}protected function rules(): arraydiff --git a/app/Livewire/Project/Database/Dragonfly/General.php b/app/Livewire/Project/Database/Dragonfly/General.phpindex 4e325b9eef..4d74dbe22a 100644--- a/app/Livewire/Project/Database/Dragonfly/General.php+++ b/app/Livewire/Project/Database/Dragonfly/General.php@@ -48,6 +48,8 @@ class General extends Componentpublic bool $enable_ssl = false;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -79,6 +81,13 @@ class General extends Component} catch (\Throwable $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->dragonflyPassword = '';+ $this->dbUrl = null;+ $this->dbUrlPublic = null;+ }}protected function rules(): arraydiff --git a/app/Livewire/Project/Database/Keydb/General.php b/app/Livewire/Project/Database/Keydb/General.phpindex f02aa6674b..1877f0cb83 100644--- a/app/Livewire/Project/Database/Keydb/General.php+++ b/app/Livewire/Project/Database/Keydb/General.php@@ -50,6 +50,8 @@ class General extends Componentpublic bool $enable_ssl = false;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -81,6 +83,13 @@ class General extends Component} catch (\Throwable $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->keydbPassword = '';+ $this->dbUrl = null;+ $this->dbUrlPublic = null;+ }}protected function rules(): arraydiff --git a/app/Livewire/Project/Database/Mariadb/General.php b/app/Livewire/Project/Database/Mariadb/General.phpindex 74658e2a4e..ccf7a440d6 100644--- a/app/Livewire/Project/Database/Mariadb/General.php+++ b/app/Livewire/Project/Database/Mariadb/General.php@@ -56,6 +56,8 @@ class General extends Componentpublic ?Carbon $certificateValidUntil = null;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -137,6 +139,14 @@ class General extends Component} catch (Exception $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->mariadbRootPassword = '';+ $this->mariadbPassword = '';+ $this->db_url = null;+ $this->db_url_public = null;+ }}public function syncData(bool $toModel = false)diff --git a/app/Livewire/Project/Database/Mongodb/General.php b/app/Livewire/Project/Database/Mongodb/General.phpindex 9f34b73d5b..20490c4e15 100644--- a/app/Livewire/Project/Database/Mongodb/General.php+++ b/app/Livewire/Project/Database/Mongodb/General.php@@ -56,6 +56,8 @@ class General extends Componentpublic ?Carbon $certificateValidUntil = null;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -137,6 +139,13 @@ class General extends Component} catch (Exception $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->mongoInitdbRootPassword = '';+ $this->db_url = null;+ $this->db_url_public = null;+ }}public function syncData(bool $toModel = false)diff --git a/app/Livewire/Project/Database/Mysql/General.php b/app/Livewire/Project/Database/Mysql/General.phpindex 86b1092514..3a82af5811 100644--- a/app/Livewire/Project/Database/Mysql/General.php+++ b/app/Livewire/Project/Database/Mysql/General.php@@ -58,6 +58,8 @@ class General extends Componentpublic ?Carbon $certificateValidUntil = null;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -142,6 +144,14 @@ class General extends Component} catch (Exception $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->mysqlRootPassword = '';+ $this->mysqlPassword = '';+ $this->db_url = null;+ $this->db_url_public = null;+ }}public function syncData(bool $toModel = false)diff --git a/app/Livewire/Project/Database/Postgresql/General.php b/app/Livewire/Project/Database/Postgresql/General.phpindex e246743151..fbea4506a9 100644--- a/app/Livewire/Project/Database/Postgresql/General.php+++ b/app/Livewire/Project/Database/Postgresql/General.php@@ -66,6 +66,8 @@ class General extends Componentpublic ?Carbon $certificateValidUntil = null;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -155,6 +157,13 @@ class General extends Component} catch (Exception $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->postgresPassword = '';+ $this->db_url = null;+ $this->db_url_public = null;+ }}public function syncData(bool $toModel = false)diff --git a/app/Livewire/Project/Database/Redis/General.php b/app/Livewire/Project/Database/Redis/General.phpindex 08bcdc3431..b777768ea5 100644--- a/app/Livewire/Project/Database/Redis/General.php+++ b/app/Livewire/Project/Database/Redis/General.php@@ -54,6 +54,8 @@ class General extends Componentpublic ?Carbon $certificateValidUntil = null;+ public bool $isPasswordHiddenForMember = false;+public function getListeners(){$userId = Auth::id();@@ -130,6 +132,13 @@ class General extends Component} catch (\Throwable $e) {return handleError($e, $this);}++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->redisPassword = '';+ $this->dbUrl = null;+ $this->dbUrlPublic = null;+ }}public function syncData(bool $toModel = false)diff --git a/app/Livewire/Project/Service/FileStorage.php b/app/Livewire/Project/Service/FileStorage.phpindex 079115bb6e..596a2646c7 100644--- a/app/Livewire/Project/Service/FileStorage.php+++ b/app/Livewire/Project/Service/FileStorage.php@@ -101,8 +101,7 @@ class FileStorage extends Componentpublic function loadStorageOnServer(){try {- // Loading content is a read operation, so we use 'view' permission- $this->authorize('view', $this->resource);+ $this->authorize('update', $this->resource);$this->fileStorage->loadStorageOnServer();$this->syncData();diff --git a/app/Livewire/Project/Service/StackForm.php b/app/Livewire/Project/Service/StackForm.phpindex 678db17e86..86d5a57c1c 100644--- a/app/Livewire/Project/Service/StackForm.php+++ b/app/Livewire/Project/Service/StackForm.php@@ -17,6 +17,8 @@ class StackForm extends Componentpublic Collection $fields;+ public bool $isPasswordHiddenForMember = false;+protected $listeners = ['saveCompose'];// Explicit properties@@ -121,6 +123,17 @@ class StackForm extends Component})->flatMap(function ($group) {return $group;});++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->fields = $this->fields->map(function ($field) {+ if (data_get($field, 'isPassword')) {+ $field['value'] = null;+ }++ return $field;+ });+ }}public function saveCompose($raw)diff --git a/app/Livewire/Storage/Form.php b/app/Livewire/Storage/Form.phpindex 4dc0b6ae23..bc1726f10c 100644--- a/app/Livewire/Storage/Form.php+++ b/app/Livewire/Storage/Form.php@@ -31,6 +31,8 @@ class Form extends Componentpublic ?bool $isUsable = null;+ public bool $isPasswordHiddenForMember = false;+protected function rules(): array{return [@@ -109,6 +111,12 @@ class Form extends Componentpublic function mount(){$this->syncData(false);++ $this->isPasswordHiddenForMember = auth()->user()?->isMember() ?? false;+ if ($this->isPasswordHiddenForMember) {+ $this->key = '';+ $this->secret = '';+ }}public function testConnection()diff --git a/bootstrap/helpers/remoteProcess.php b/bootstrap/helpers/remoteProcess.phpindex 217c829296..cb9f3bcabd 100644--- a/bootstrap/helpers/remoteProcess.php+++ b/bootstrap/helpers/remoteProcess.php@@ -183,6 +183,11 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d$application = Application::find(data_get($application_deployment_queue, 'application_id'));$is_debug_enabled = data_get($application, 'settings.is_debug_enabled');+ // Members should never see debug logs, even if an admin enabled debug mode+ if ($is_debug_enabled && auth()->check() && auth()->user()->isMember()) {+ $is_debug_enabled = false;+ }+$logs = data_get($application_deployment_queue, 'logs');if (empty($logs)) {return collect([]);diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.phpindex 5861cef30a..4ea4a65bc5 100644--- a/resources/views/livewire/project/application/deployment/show.blade.php+++ b/resources/views/livewire/project/application/deployment/show.blade.php@@ -290,6 +290,7 @@d="M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg></button>+ @can('update', $application)<button wire:click="toggleDebug"title="{{ $is_debug_enabled ? 'Hide Debug Logs' : 'Show Debug Logs' }}"class="p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 {{ $is_debug_enabled ? '!text-warning' : '' }}">@@ -299,6 +300,7 @@d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082" /></svg></button>+ @endcan<button title="Follow Logs" :class="alwaysScroll ? '!text-warning' : ''"x-on:click="toggleScroll"class="p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200">diff --git a/resources/views/livewire/project/database/clickhouse/general.blade.php b/resources/views/livewire/project/database/clickhouse/general.blade.phpindex 2010e0afcd..2ba7c59af6 100644--- a/resources/views/livewire/project/database/clickhouse/general.blade.php+++ b/resources/views/livewire/project/database/clickhouse/general.blade.php@@ -17,8 +17,12 @@<div class="flex gap-2"><x-forms.input label="Initial Username" id="clickhouseAdminUser" placeholder="If empty: clickhouse"readonly helper="You can only change this in the database." canGate="update" :canResource="$database" />- <x-forms.input label="Initial Password" id="clickhouseAdminPassword" type="password" required readonly- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Initial Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Initial Password" id="clickhouseAdminPassword" type="password" required readonly+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div>@else<div class=" dark:text-warning">Please verify these values. You can only modify them before the initial@@ -26,8 +30,12 @@</div><div class="flex gap-2"><x-forms.input label="Username" id="clickhouseAdminUser" required canGate="update" :canResource="$database" />- <x-forms.input label="Password" id="clickhouseAdminPassword" type="password" required canGate="update"- :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="clickhouseAdminPassword" type="password" required canGate="update"+ :canResource="$database" />+ @endif</div>@endif<x-forms.input@@ -41,17 +49,25 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="Clickhouse URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />- @if ($dbUrlPublic)- <x-forms.input label="Clickhouse URL (public)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Clickhouse URL (internal)" disabled value="Hidden (only admins can view)" />@else- <x-forms.input label="Clickhouse URL (public)"+ <x-forms.input label="Clickhouse URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Clickhouse URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($dbUrlPublic)+ <x-forms.input label="Clickhouse URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @else+ <x-forms.input label="Clickhouse URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ @endif@endif</div><div>diff --git a/resources/views/livewire/project/database/dragonfly/general.blade.php b/resources/views/livewire/project/database/dragonfly/general.blade.phpindex 2b2e5d3550..85f2a505ac 100644--- a/resources/views/livewire/project/database/dragonfly/general.blade.php+++ b/resources/views/livewire/project/database/dragonfly/general.blade.php@@ -18,16 +18,24 @@@if ($database->started_at)<div class="flex gap-2">- <x-forms.input label="Initial Password" id="dragonflyPassword" type="password" required readonly- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Initial Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Initial Password" id="dragonflyPassword" type="password" required readonly+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div>@else<div class=" dark:text-warning">Please verify these values. You can only modify them before the initialstart. After that, you need to modify it in the database.</div><div class="flex gap-2">- <x-forms.input label="Password" id="dragonflyPassword" type="password" required canGate="update"- :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="dragonflyPassword" type="password" required canGate="update"+ :canResource="$database" />+ @endif</div>@endif<div class="flex flex-col gap-2">@@ -37,18 +45,26 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="Dragonfly URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />-- @if ($dbUrlPublic)- <x-forms.input label="Dragonfly URL (public)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Dragonfly URL (internal)" disabled value="Hidden (only admins can view)" />@else- <x-forms.input label="Dragonfly URL (public)"+ <x-forms.input label="Dragonfly URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />+ @endif++ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Dragonfly URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($dbUrlPublic)+ <x-forms.input label="Dragonfly URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @else+ <x-forms.input label="Dragonfly URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ @endif@endif</div><div class="flex flex-col gap-2">diff --git a/resources/views/livewire/project/database/keydb/general.blade.php b/resources/views/livewire/project/database/keydb/general.blade.phpindex 00c30edffc..a0d60f6db4 100644--- a/resources/views/livewire/project/database/keydb/general.blade.php+++ b/resources/views/livewire/project/database/keydb/general.blade.php@@ -15,16 +15,24 @@@if ($database->started_at)<div class="flex gap-2">- <x-forms.input label="Initial Password" id="keydbPassword" type="password" required readonly- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Initial Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Initial Password" id="keydbPassword" type="password" required readonly+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div>@else<div class=" dark:text-warning">Please verify these values. You can only modify them before the initialstart. After that, you need to modify it in the database.</div><div class="flex gap-2">- <x-forms.input label="Password" id="keydbPassword" type="password" required canGate="update"- :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="keydbPassword" type="password" required canGate="update"+ :canResource="$database" />+ @endif</div>@endif<x-forms.input@@ -38,17 +46,25 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="KeyDB URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />- @if ($dbUrlPublic)- <x-forms.input label="KeyDB URL (public)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="KeyDB URL (internal)" disabled value="Hidden (only admins can view)" />@else- <x-forms.input label="KeyDB URL (public)"+ <x-forms.input label="KeyDB URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="KeyDB URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($dbUrlPublic)+ <x-forms.input label="KeyDB URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @else+ <x-forms.input label="KeyDB URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ readonly value="Starting the database will generate this." canGate="update" :canResource="$database" />+ @endif@endif</div><div class="flex flex-col gap-2">diff --git a/resources/views/livewire/project/database/mariadb/general.blade.php b/resources/views/livewire/project/database/mariadb/general.blade.phpindex f51f077c09..b9f6b0da5d 100644--- a/resources/views/livewire/project/database/mariadb/general.blade.php+++ b/resources/views/livewire/project/database/mariadb/general.blade.php@@ -17,15 +17,23 @@</div>@if ($database->started_at)<div class="flex xl:flex-row flex-col gap-2">- <x-forms.input label="Root Password" id="mariadbRootPassword" type="password" required- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."- canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Root Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Root Password" id="mariadbRootPassword" type="password" required+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."+ canGate="update" :canResource="$database" />+ @endif<x-forms.input label="Normal User" id="mariadbUser" requiredhelper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."canGate="update" :canResource="$database" />- <x-forms.input label="Normal User Password" id="mariadbPassword" type="password" required- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."- canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Normal User Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Normal User Password" id="mariadbPassword" type="password" required+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."+ canGate="update" :canResource="$database" />+ @endif</div><div class="flex flex-col gap-2"><x-forms.input label="Initial Database" id="mariadbDatabase"@@ -34,12 +42,20 @@</div>@else<div class="flex xl:flex-row flex-col gap-2 pb-2">- <x-forms.input label="Root Password" id="mariadbRootPassword" type="password"- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Root Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Root Password" id="mariadbRootPassword" type="password"+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif<x-forms.input label="Normal User" id="mariadbUser" requiredhelper="You can only change this in the database." canGate="update" :canResource="$database" />- <x-forms.input label="Normal User Password" id="mariadbPassword" type="password" required- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Normal User Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Normal User Password" id="mariadbPassword" type="password" required+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div><div class="flex flex-col gap-2"><x-forms.input label="Initial Database" id="mariadbDatabase"@@ -61,13 +77,21 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="MariaDB URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url" canGate="update" :canResource="$database" />- @if ($db_url_public)- <x-forms.input label="MariaDB URL (public)"+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="MariaDB URL (internal)" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="MariaDB URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url_public" canGate="update" :canResource="$database" />+ type="password" readonly wire:model="db_url" canGate="update" :canResource="$database" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="MariaDB URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($db_url_public)+ <x-forms.input label="MariaDB URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="db_url_public" canGate="update" :canResource="$database" />+ @endif@endif</div>diff --git a/resources/views/livewire/project/database/mongodb/general.blade.php b/resources/views/livewire/project/database/mongodb/general.blade.phpindex a474153f1f..1b6f98be2f 100644--- a/resources/views/livewire/project/database/mongodb/general.blade.php+++ b/resources/views/livewire/project/database/mongodb/general.blade.php@@ -21,10 +21,14 @@placeholder="If empty: postgres"helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."canGate="update" :canResource="$database" />- <x-forms.input label="Initial Password" id="mongoInitdbRootPassword" type="password"- required- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."- canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Initial Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Initial Password" id="mongoInitdbRootPassword" type="password"+ required+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work."+ canGate="update" :canResource="$database" />+ @endif<x-forms.input label="Initial Database" id="mongoInitdbDatabase"placeholder="If empty, it will be the same as Username." readonlyhelper="You can only change this in the database." canGate="update" :canResource="$database" />@@ -33,8 +37,12 @@<div class="flex xl:flex-row flex-col gap-2 pb-2"><x-forms.input required label="Username" id="mongoInitdbRootUsername"placeholder="If empty: postgres" canGate="update" :canResource="$database" />- <x-forms.input label="Password" id="mongoInitdbRootPassword" type="password" required- canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="mongoInitdbRootPassword" type="password" required+ canGate="update" :canResource="$database" />+ @endif<x-forms.input required label="Database" id="mongoInitdbDatabase"placeholder="If empty, it will be the same as Username." canGate="update" :canResource="$database" /></div>@@ -50,13 +58,21 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="Mongo URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url" canGate="update" :canResource="$database" />- @if ($db_url_public)- <x-forms.input label="Mongo URL (public)"+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Mongo URL (internal)" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Mongo URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url_public" canGate="update" :canResource="$database" />+ type="password" readonly wire:model="db_url" canGate="update" :canResource="$database" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Mongo URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($db_url_public)+ <x-forms.input label="Mongo URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="db_url_public" canGate="update" :canResource="$database" />+ @endif@endif</div>diff --git a/resources/views/livewire/project/database/mysql/general.blade.php b/resources/views/livewire/project/database/mysql/general.blade.phpindex 8187878e45..d065fccb09 100644--- a/resources/views/livewire/project/database/mysql/general.blade.php+++ b/resources/views/livewire/project/database/mysql/general.blade.php@@ -17,12 +17,20 @@</div>@if ($database->started_at)<div class="flex xl:flex-row flex-col gap-2">- <x-forms.input label="Root Password" id="mysqlRootPassword" type="password" required- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Root Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Root Password" id="mysqlRootPassword" type="password" required+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." canGate="update" :canResource="$database" />+ @endif<x-forms.input label="Normal User" id="mysqlUser" requiredhelper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." canGate="update" :canResource="$database" />- <x-forms.input label="Normal User Password" id="mysqlPassword" type="password" required- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Normal User Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Normal User Password" id="mysqlPassword" type="password" required+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." canGate="update" :canResource="$database" />+ @endif</div><div class="flex flex-col gap-2"><x-forms.input label="Initial Database" id="mysqlDatabase"@@ -31,12 +39,20 @@</div>@else<div class="flex xl:flex-row flex-col gap-4 pb-2">- <x-forms.input label="Root Password" id="mysqlRootPassword" type="password"- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Root Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Root Password" id="mysqlRootPassword" type="password"+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif<x-forms.input label="Normal User" id="mysqlUser" requiredhelper="You can only change this in the database." canGate="update" :canResource="$database" />- <x-forms.input label="Normal User Password" id="mysqlPassword" type="password" required- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Normal User Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Normal User Password" id="mysqlPassword" type="password" required+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div><div class="flex flex-col gap-2"><x-forms.input label="Initial Database" id="mysqlDatabase"@@ -56,13 +72,21 @@<x-forms.input placeholder="3000:5432" id="portsMappings" label="Ports Mappings"helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433" canGate="update" :canResource="$database" /></div>- <x-forms.input label="MySQL URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url" />- @if ($db_url_public)- <x-forms.input label="MySQL URL (public)"+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="MySQL URL (internal)" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="MySQL URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url_public" />+ type="password" readonly wire:model="db_url" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="MySQL URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($db_url_public)+ <x-forms.input label="MySQL URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="db_url_public" />+ @endif@endif</div>diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.phpindex 7300b913ab..b87ad7412a 100644--- a/resources/views/livewire/project/database/postgresql/general.blade.php+++ b/resources/views/livewire/project/database/postgresql/general.blade.php@@ -34,9 +34,13 @@<x-forms.input label="Username" id="postgresUser" placeholder="If empty: postgres" canGate="update":canResource="$database"helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />- <x-forms.input label="Password" id="postgresPassword" type="password" required canGate="update"- :canResource="$database"- helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="postgresPassword" type="password" required canGate="update"+ :canResource="$database"+ helper="If you change this in the database, please sync it here, otherwise automations (like backups) won't work." />+ @endif<x-forms.input label="Initial Database" id="postgresDb"placeholder="If empty, it will be the same as Username." readonlyhelper="You can only change this in the database." />@@ -45,8 +49,12 @@<div class="flex xl:flex-row flex-col gap-2 pb-2"><x-forms.input label="Username" id="postgresUser" placeholder="If empty: postgres" canGate="update":canResource="$database" />- <x-forms.input label="Password" id="postgresPassword" type="password" required canGate="update"- :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="postgresPassword" type="password" required canGate="update"+ :canResource="$database" />+ @endif<x-forms.input label="Initial Database" id="postgresDb"placeholder="If empty, it will be the same as Username." canGate="update" :canResource="$database" /></div>@@ -69,13 +77,21 @@canGate="update" :canResource="$database" /></div>- <x-forms.input label="Postgres URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url" />- @if ($db_url_public)- <x-forms.input label="Postgres URL (public)"+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Postgres URL (internal)" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Postgres URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="db_url_public" />+ type="password" readonly wire:model="db_url" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Postgres URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($db_url_public)+ <x-forms.input label="Postgres URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="db_url_public" />+ @endif@endif</div><div class="flex flex-col gap-2">diff --git a/resources/views/livewire/project/database/redis/general.blade.php b/resources/views/livewire/project/database/redis/general.blade.phpindex f37674186f..8b72ce934e 100644--- a/resources/views/livewire/project/database/redis/general.blade.php+++ b/resources/views/livewire/project/database/redis/general.blade.php@@ -23,8 +23,12 @@<x-forms.input label="Username" id="redisUsername"helper="You can only change this in the database." canGate="update" :canResource="$database" />@endif- <x-forms.input label="Password" id="redisPassword" type="password"- helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="redisPassword" type="password"+ helper="You can only change this in the database." canGate="update" :canResource="$database" />+ @endif</div>@else<div class="pt-2 dark:text-warning">You can only change the username and password in the database after@@ -39,13 +43,17 @@Note: If the environment variable REDIS_USERNAME is set as a shared variable (environment, project, or team-based), this input field will become read-only.":disabled="$this->isSharedVariable('REDIS_USERNAME')" canGate="update" :canResource="$database" />@endif- <x-forms.input label="Password" id="redisPassword" type="password" required- helper="You can change the Redis Password in the input field below or by editing the value of the REDIS_PASSWORD environment variable.+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Password" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Password" id="redisPassword" type="password" required+ helper="You can change the Redis Password in the input field below or by editing the value of the REDIS_PASSWORD environment variable.<br><br>If you change the Redis Password in the database, please sync it here, otherwise automations (like backups) won't work.<br><br>Note: If the environment variable REDIS_PASSWORD is set as a shared variable (environment, project, or team-based), this input field will become read-only."- :disabled="$this->isSharedVariable('REDIS_PASSWORD')" canGate="update" :canResource="$database" />+ :disabled="$this->isSharedVariable('REDIS_PASSWORD')" canGate="update" :canResource="$database" />+ @endif</div>@endif</div>@@ -60,13 +68,21 @@helper="A comma separated list of ports you would like to map to the host system.<br><span class='inline-block font-bold dark:text-warning'>Example</span>3000:5432,3002:5433"canGate="update" :canResource="$database" /></div>- <x-forms.input label="Redis URL (internal)"- helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />- @if ($dbUrlPublic)- <x-forms.input label="Redis URL (public)"+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Redis URL (internal)" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input label="Redis URL (internal)"helper="If you change the user/password/port, this could be different. This is with the default values."- type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ type="password" readonly wire:model="dbUrl" canGate="update" :canResource="$database" />+ @endif+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Redis URL (public)" disabled value="Hidden (only admins can view)" />+ @else+ @if ($dbUrlPublic)+ <x-forms.input label="Redis URL (public)"+ helper="If you change the user/password/port, this could be different. This is with the default values."+ type="password" readonly wire:model="dbUrlPublic" canGate="update" :canResource="$database" />+ @endif@endif</div><div class="flex flex-col gap-2">diff --git a/resources/views/livewire/project/service/file-storage.blade.php b/resources/views/livewire/project/service/file-storage.blade.phpindex 1dd58fe17d..472398db81 100644--- a/resources/views/livewire/project/service/file-storage.blade.php+++ b/resources/views/livewire/project/service/file-storage.blade.php@@ -87,7 +87,7 @@@else{{-- Read-only view --}}@if (!$fileStorage->is_directory)- @can('view', $resource)+ @can('update', $resource)<div class="flex gap-2"><x-forms.button type="button" wire:click="loadStorageOnServer">Load fromserver</x-forms.button>diff --git a/resources/views/livewire/project/service/stack-form.blade.php b/resources/views/livewire/project/service/stack-form.blade.phpindex 8972345bca..2cdf572666 100644--- a/resources/views/livewire/project/service/stack-form.blade.php+++ b/resources/views/livewire/project/service/stack-form.blade.php@@ -39,10 +39,14 @@<x-helper helper="Variable name: {{ $serviceName }}" />@endif</div>- <x-forms.input canGate="update" :canResource="$service"- type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}"- required="{{ str(data_get($field, 'rules'))?->contains('required') }}"- id="fields.{{ $serviceName }}.value"></x-forms.input>+ @if ($isPasswordHiddenForMember && data_get($field, 'isPassword'))+ <x-forms.input disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input canGate="update" :canResource="$service"+ type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}"+ required="{{ str(data_get($field, 'rules'))?->contains('required') }}"+ id="fields.{{ $serviceName }}.value"></x-forms.input>+ @endif@endforeach</div>@endifdiff --git a/resources/views/livewire/storage/form.blade.php b/resources/views/livewire/storage/form.blade.phpindex 850d7735fa..4321935934 100644--- a/resources/views/livewire/storage/form.blade.php+++ b/resources/views/livewire/storage/form.blade.php@@ -41,10 +41,15 @@<x-forms.input canGate="update" :canResource="$storage" required label="Region" id="region" /></div><div class="flex gap-2">- <x-forms.input canGate="update" :canResource="$storage" required type="password" label="Access Key"- id="key" />- <x-forms.input canGate="update" :canResource="$storage" required type="password" label="Secret Key"- id="secret" />+ @if ($isPasswordHiddenForMember)+ <x-forms.input label="Access Key" disabled value="Hidden (only admins can view)" />+ <x-forms.input label="Secret Key" disabled value="Hidden (only admins can view)" />+ @else+ <x-forms.input canGate="update" :canResource="$storage" required type="password" label="Access Key"+ id="key" />+ <x-forms.input canGate="update" :canResource="$storage" required type="password" label="Secret Key"+ id="secret" />+ @endif</div>@can('validateConnection', $storage)<x-forms.button class="mt-4" isHighlighted wire:click="testConnection">