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.

Merge branch 'next' into andrasbacsai/livewire-model-binding

Andras Bacsai837a0f4545f4
diff --cc app/Livewire/MonacoEditor.php
index 53ca1d3866,54f0965a2c..f660f9c132
--- a/app/Livewire/MonacoEditor.php
+++ b/app/Livewire/MonacoEditor.php
@@@ -25,6 -25,7 +25,7 @@@ class MonacoEditor extends Componen
public bool $readonly,
public bool $allowTab,
public bool $spellcheck,
- public bool $autofocus = false,
++ public bool $autofocus,
public ?string $helper,
public bool $realtimeValidation,
public bool $allowToPeak,
diff --cc app/Livewire/Project/Database/Configuration.php
index 88ecccf995,513ba9f164..7c64a6eefa
--- a/app/Livewire/Project/Database/Configuration.php
+++ b/app/Livewire/Project/Database/Configuration.php
@@@ -7,6 -8,7 +8,8 @@@ use Livewire\Component
class Configuration extends Component
{
+ use AuthorizesRequests;
++
public $currentRoute;
public $database;
diff --cc app/Livewire/Project/Service/StackForm.php
index 9e119322a6,a0d2699baf..85cd21a7fe
--- a/app/Livewire/Project/Service/StackForm.php
+++ b/app/Livewire/Project/Service/StackForm.php
@@@ -138,7 -101,10 +138,11 @@@ class StackForm extends Componen
{
try {
$this->validate();
+ $this->syncData(true);
+
+ // Validate for command injection BEFORE saving to database
+ validateDockerComposeForInjection($this->service->docker_compose_raw);
+
$this->service->save();
$this->service->saveExtraFields($this->fields);
$this->service->parse();
diff --cc app/Livewire/Server/New/ByHetzner.php
index f3368b4eb7,a77c5df789..ca5c588f85
--- a/app/Livewire/Server/New/ByHetzner.php
+++ b/app/Livewire/Server/New/ByHetzner.php
@@@ -290,6 -290,23 +290,23 @@@ class ByHetzner extends Componen
}
}
- private function getCpuVendorInfo(array $serverType): string|null
++ private function getCpuVendorInfo(array $serverType): ?string
+ {
+ $name = strtolower($serverType['name'] ?? '');
+
+ if (str_starts_with($name, 'ccx')) {
+ return 'AMD Milan EPYC™';
+ } elseif (str_starts_with($name, 'cpx')) {
+ return 'AMD EPYC™';
+ } elseif (str_starts_with($name, 'cx')) {
+ return 'Intel® Xeon®';
+ } elseif (str_starts_with($name, 'cax')) {
+ return 'Ampere® Altra®';
+ }
+
+ return null;
+ }
+
public function getAvailableServerTypesProperty()
{
ray('Getting available server types', [
diff --cc resources/views/components/forms/input.blade.php
index 13cf1faf08,2840d65618..ecddc364b8
--- a/resources/views/components/forms/input.blade.php
+++ b/resources/views/components/forms/input.blade.php
@@@ -27,9 -27,9 +27,9 @@@
@endif
<input autocomplete="{{ $autocomplete }}" value="{{ $value }}"
{{ $attributes->merge(['class' => $defaultClass]) }} @required($required)
- @if ($id !== 'null') wire:model={{ $id }} @endif
+ @if ($modelBinding !== 'null') wire:model={{ $modelBinding }} @endif
- wire:dirty.class="dark:ring-warning ring-warning" wire:loading.attr="disabled"
+ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" wire:loading.attr="disabled"
- type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $id }}"
+ type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $htmlId }}"
name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"
aria-placeholder="{{ $attributes->get('placeholder') }}"
@if ($autofocus) x-ref="autofocusInput" @endif>
@@@ -38,8 -38,8 +38,8 @@@
@else
<input autocomplete="{{ $autocomplete }}" @if ($value) value="{{ $value }}" @endif
{{ $attributes->merge(['class' => $defaultClass]) }} @required($required) @readonly($readonly)
- @if ($id !== 'null') wire:model={{ $id }} @endif
+ @if ($modelBinding !== 'null') wire:model={{ $modelBinding }} @endif
- wire:dirty.class="dark:ring-warning ring-warning" wire:loading.attr="disabled"
+ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" wire:loading.attr="disabled"
type="{{ $type }}" @disabled($disabled) min="{{ $attributes->get('min') }}"
max="{{ $attributes->get('max') }}" minlength="{{ $attributes->get('minlength') }}"
maxlength="{{ $attributes->get('maxlength') }}"
diff --cc resources/views/components/forms/select.blade.php
index 4871bcc9d3,13d500bc9b..1f75ff9e0e
--- a/resources/views/components/forms/select.blade.php
+++ b/resources/views/components/forms/select.blade.php
@@@ -11,11 -11,11 +11,11 @@@
</label>
@endif
<select {{ $attributes->merge(['class' => $defaultClass]) }} @disabled($disabled) @required($required)
- wire:dirty.class="dark:ring-warning ring-warning" wire:loading.attr="disabled" name={{ $modelBinding }} id="{{ $htmlId }}"
- wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" wire:loading.attr="disabled" name={{ $id }}
- @if ($attributes->whereStartsWith('wire:model')->first()) {{ $attributes->whereStartsWith('wire:model')->first() }} @else wire:model={{ $id }} @endif>
++ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" wire:loading.attr="disabled" name={{ $modelBinding }} id="{{ $htmlId }}"
+ @if ($attributes->whereStartsWith('wire:model')->first()) {{ $attributes->whereStartsWith('wire:model')->first() }} @else wire:model={{ $modelBinding }} @endif>
{{ $slot }}
</select>
- @error($id)
+ @error($modelBinding)
<label class="label">
<span class="text-red-500 label-text-alt">{{ $message }}</span>
</label>
diff --cc resources/views/components/forms/textarea.blade.php
index b3c25a0e7f,1093a150df..9c4860da86
--- a/resources/views/components/forms/textarea.blade.php
+++ b/resources/views/components/forms/textarea.blade.php
@@@ -25,9 -25,9 +25,9 @@@
</label>
@endif
@if ($useMonacoEditor)
- <x-forms.monaco-editor id="{{ $id }}" language="{{ $monacoEditorLanguage }}" name="{{ $name }}"
- name="{{ $id }}" model="{{ $value ?? $id }}" wire:model="{{ $value ?? $id }}"
+ <x-forms.monaco-editor id="{{ $modelBinding }}" language="{{ $monacoEditorLanguage }}" name="{{ $name }}"
+ name="{{ $modelBinding }}" model="{{ $value ?? $modelBinding }}" wire:model="{{ $value ?? $modelBinding }}"
- readonly="{{ $readonly }}" label="dockerfile" />
+ readonly="{{ $readonly }}" label="dockerfile" autofocus="{{ $autofocus }}" />
@else
@if ($type === 'password')
<div class="relative" x-data="{ type: 'password' }">
@@@ -45,34 -45,36 +45,36 @@@
@endif
<input x-cloak x-show="type === 'password'" value="{{ $value }}"
{{ $attributes->merge(['class' => $defaultClassInput]) }} @required($required)
- @if ($id !== 'null') wire:model={{ $id }} @endif
+ @if ($modelBinding !== 'null') wire:model={{ $modelBinding }} @endif
- wire:dirty.class="dark:ring-warning ring-warning" wire:loading.attr="disabled"
+ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" wire:loading.attr="disabled"
- type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $id }}"
+ type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $htmlId }}"
name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"
aria-placeholder="{{ $attributes->get('placeholder') }}">
<textarea minlength="{{ $minlength }}" maxlength="{{ $maxlength }}" x-cloak x-show="type !== 'password'"
placeholder="{{ $placeholder }}" {{ $attributes->merge(['class' => $defaultClass]) }}
- @if ($realtimeValidation) wire:model.debounce.200ms="{{ $id }}"
+ @if ($realtimeValidation) wire:model.debounce.200ms="{{ $modelBinding }}"
@else
- wire:model={{ $value ?? $id }}
+ wire:model={{ $value ?? $modelBinding }}
- wire:dirty.class="dark:ring-warning ring-warning" @endif
+ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" @endif
- @disabled($disabled) @readonly($readonly) @required($required) id="{{ $id }}"
- name="{{ $name }}" name={{ $id }}
+ @disabled($disabled) @readonly($readonly) @required($required) id="{{ $htmlId }}"
- name="{{ $name }}" name={{ $modelBinding }}></textarea>
++ name="{{ $name }}" name={{ $modelBinding }}
+ @if ($autofocus) x-ref="autofocusInput" @endif></textarea>
</div>
@else
<textarea minlength="{{ $minlength }}" maxlength="{{ $maxlength }}"
{{ $allowTab ? '@keydown.tab=handleKeydown' : '' }} placeholder="{{ $placeholder }}"
{{ !$spellcheck ? 'spellcheck=false' : '' }} {{ $attributes->merge(['class' => $defaultClass]) }}
- @if ($realtimeValidation) wire:model.debounce.200ms="{{ $id }}"
+ @if ($realtimeValidation) wire:model.debounce.200ms="{{ $modelBinding }}"
@else
- wire:model={{ $value ?? $id }}
+ wire:model={{ $value ?? $modelBinding }}
- wire:dirty.class="dark:ring-warning ring-warning" @endif
+ wire:dirty.class="dark:border-l-warning border-l-coollabs border-l-4" @endif
- @disabled($disabled) @readonly($readonly) @required($required) id="{{ $id }}"
- name="{{ $name }}" name={{ $id }}
+ @disabled($disabled) @readonly($readonly) @required($required) id="{{ $htmlId }}"
- name="{{ $name }}" name={{ $modelBinding }}></textarea>
++ name="{{ $name }}" name={{ $modelBinding }}
+ @if ($autofocus) x-ref="autofocusInput" @endif></textarea>
@endif
@endif
- @error($id)
+ @error($modelBinding)
<label class="label">
<span class="text-red-500 label-text-alt">{{ $message }}</span>
</label>