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.

fix: do not allow service storage mount point modifications

Andras Bacsaiad5c1639e859
diff --git a/app/Livewire/Project/Shared/Storages/Show.php b/app/Livewire/Project/Shared/Storages/Show.php
index 5e35b796ae..2839301742 100644
--- a/app/Livewire/Project/Shared/Storages/Show.php
+++ b/app/Livewire/Project/Shared/Storages/Show.php
@@ -12,6 +12,8 @@ class Show extends Component
public bool $isReadOnly = false;
public ?string $modalId = null;
public bool $isFirst = true;
+ public bool $isService = false;
+ public ?string $startedAt = null;
protected $rules = [
'storage.name' => 'required|string',
diff --git a/resources/views/livewire/project/shared/storages/all.blade.php b/resources/views/livewire/project/shared/storages/all.blade.php
index 3647a8b9db..e357b4f94d 100644
--- a/resources/views/livewire/project/shared/storages/all.blade.php
+++ b/resources/views/livewire/project/shared/storages/all.blade.php
@@ -3,10 +3,11 @@
@foreach ($resource->persistentStorages as $storage)
@if ($resource->type() === 'service')
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
- :isFirst="$loop->first" isReadOnly='true' />
+ :isFirst="$loop->first" isReadOnly='true' isService='true' />
@else
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
- isReadOnly="{{ data_get($storage, 'is_readonly') }}" />
+ isReadOnly="{{ data_get($storage, 'is_readonly') }}"
+ startedAt="{{ data_get($resource, 'started_at') }}" />
@endif
@endforeach
</div>
diff --git a/resources/views/livewire/project/shared/storages/show.blade.php b/resources/views/livewire/project/shared/storages/show.blade.php
index c5c3959938..a0e02c92cf 100644
--- a/resources/views/livewire/project/shared/storages/show.blade.php
+++ b/resources/views/livewire/project/shared/storages/show.blade.php
@@ -4,23 +4,31 @@
@if ($isFirst)
<x-forms.input id="storage.name" label="Volume Name" required
helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." />
- <x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path"
- helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
- <x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container." required readonly />
+ @if ($isService || $startedAt)
+ <x-forms.input id="storage.host_path" readonly helper="Directory on the host system."
+ label="Source Path"
+ helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
+ @else
+ <x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path"
+ helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
+ @endif
+ <x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
+ required readonly />
<x-forms.button type="submit">
Update
</x-forms.button>
@else
<x-forms.input id="storage.name" required readonly
helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." />
- <x-forms.input id="storage.host_path" helper="Directory on the host system." readonly />
- <x-forms.input id="storage.mount_path" helper="Directory inside the container." required readonly />
+ <x-forms.input id="storage.host_path" helper="Directory on the host system." readonly />
+ <x-forms.input id="storage.mount_path" helper="Directory inside the container." required readonly />
@endif
@else
@if ($isFirst)
<x-forms.input id="storage.name" label="Volume Name" required />
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" />
- <x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container." required />
+ <x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
+ required />
@else
<x-forms.input id="storage.name" required />
<x-forms.input id="storage.host_path" helper="Directory on the host system." />