diff --git a/app/Models/Server.php b/app/Models/Server.php index df136c72bd..c5b66d9c61 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -884,6 +884,35 @@ public function services() return $this->hasMany(Service::class); } + public function port(): Attribute + { + return Attribute::make( + get: function ($value) { + return preg_replace('/[^0-9]/', '', $value); + } + ); + } + + public function user(): Attribute + { + return Attribute::make( + get: function ($value) { + $sanitizedValue = preg_replace('/[^A-Za-z0-9\-_]/', '', $value); + + return $sanitizedValue; + } + ); + } + + public function ip(): Attribute + { + return Attribute::make( + get: function ($value) { + return preg_replace('/[^0-9a-zA-Z.-]/', '', $value); + } + ); + } + public function getIp(): Attribute { return Attribute::make( diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.php index 42fea49b15..75db25b29e 100644 --- a/resources/views/livewire/server/form.blade.php +++ b/resources/views/livewire/server/form.blade.php @@ -3,15 +3,10 @@

General

@if ($server->id === 0) - + @else Save @if ($server->isFunctional()) @@ -39,7 +34,7 @@ Validate Server & Install Docker Engine @@ -62,7 +57,7 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1 number of servers for which you have paid.
@endif
-
+
@if (!$server->settings->is_swarm_worker && !$server->settings->is_build_server) @@ -71,7 +66,7 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1 @endif
-
+
@@ -98,24 +93,24 @@ class="w-full mt-8 mb-4 font-bold box-without-bg bg-coollabs hover:bg-coollabs-1
-
+
-
+ class="overflow-auto overflow-x-hidden absolute z-50 mt-1 w-64 max-h-60 bg-white rounded-md border shadow-lg dark:bg-coolgray-100 dark:border-coolgray-200 scrollbar">
@@ -126,7 +121,7 @@ class="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-coolgray-300 tex @if (!$server->isLocalhost()) -
+

Cloudflare Tunnels

+

Cloudflare Tunnels

-
+

Sentinel

{{-- @if ($server->isSentinelEnabled()) --}} {{-- Restart --}}