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.

wip

Joao Patricio25815988d983
diff --git a/app/Actions/Proxy/CheckProxySettingsInSync.php b/app/Actions/Proxy/CheckProxySettingsInSync.php
new file mode 100644
index 0000000000..98225d4146
--- /dev/null
+++ b/app/Actions/Proxy/CheckProxySettingsInSync.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Actions\Proxy;
+
+use App\Enums\ActivityTypes;
+use App\Enums\ProxyTypes;
+use App\Models\Server;
+use Spatie\Activitylog\Models\Activity;
+use Symfony\Component\Yaml\Yaml;
+
+class CheckProxySettingsInSync
+{
+ public function __invoke(Server $server)
+ {
+ // @TODO What is the mechanism to make sure setting in sync?
+ $folder_name = match ($server->extra_attributes->proxy) {
+ ProxyTypes::TRAEFIK_V2->value => 'proxy',
+ };
+
+ return instantRemoteProcess([
+ 'if [ -d "projects/'.$folder_name.'" ]; then echo "true"; else echo "false"; fi',
+ ], $server);
+ }
+}
diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php
index a44bb9e6d6..40fe2e4ccb 100644
--- a/app/Http/Livewire/Server/Proxy.php
+++ b/app/Http/Livewire/Server/Proxy.php
@@ -2,6 +2,7 @@
namespace App\Http\Livewire\Server;
+use App\Actions\Proxy\CheckProxySettingsInSync;
use App\Actions\Proxy\InstallProxy;
use App\Enums\ActivityTypes;
use App\Models\Server;
@@ -32,10 +33,9 @@ class Proxy extends Component
public function checkProxySettingsInSync()
{
-
-
+ $status = resolve(CheckProxySettingsInSync::class)($this->server);
$this->is_check_proxy_complete = true;
- $this->is_proxy_settings_in_sync = true;
+ $this->is_proxy_settings_in_sync = $status === 'true';
}
public function render()
diff --git a/resources/views/livewire/server/_proxy/options.blade.php b/resources/views/livewire/server/_proxy/options.blade.php
index e6610bc272..5e6657c5f7 100644
--- a/resources/views/livewire/server/_proxy/options.blade.php
+++ b/resources/views/livewire/server/_proxy/options.blade.php
@@ -2,7 +2,7 @@
<div class="mt-4">
<label>
<div>Edit config file</div>
- <textarea cols="45" rows="25"></textarea>
+ <textarea cols="45" rows="6"></textarea>
</label>
</div>