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.

temporary fix for proxy

Andras Bacsaic287276d0edd
diff --git a/app/Actions/Proxy/CheckConfigurationSync.php b/app/Actions/Proxy/CheckConfigurationSync.php
index 4db45367a0..c1a261796b 100644
--- a/app/Actions/Proxy/CheckConfigurationSync.php
+++ b/app/Actions/Proxy/CheckConfigurationSync.php
@@ -16,10 +16,7 @@ class CheckConfigurationSync
if ($reset || is_null($proxy_configuration)) {
$proxy_configuration = Str::of(generate_default_proxy_configuration($server))->trim()->value;
- resolve(SaveConfigurationSync::class)($server, $proxy_configuration);
- return $proxy_configuration;
}
-
return $proxy_configuration;
}
}
diff --git a/app/Actions/Proxy/SaveConfigurationSync.php b/app/Actions/Proxy/SaveConfigurationSync.php
index 8be3ca9db4..d58dad0c79 100644
--- a/app/Actions/Proxy/SaveConfigurationSync.php
+++ b/app/Actions/Proxy/SaveConfigurationSync.php
@@ -7,11 +7,12 @@ use Illuminate\Support\Str;
class SaveConfigurationSync
{
- public function __invoke(Server $server, string $configuration)
+ public function __invoke(Server $server)
{
try {
+ $proxy_settings = resolve(CheckConfigurationSync::class)($server, true);
$proxy_path = get_proxy_path();
- $docker_compose_yml_base64 = base64_encode($configuration);
+ $docker_compose_yml_base64 = base64_encode($proxy_settings);
$server->proxy->last_saved_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;
$server->save();
diff --git a/app/Http/Livewire/Server/Proxy.php b/app/Http/Livewire/Server/Proxy.php
index 7f0a11f98d..174d426b58 100644
--- a/app/Http/Livewire/Server/Proxy.php
+++ b/app/Http/Livewire/Server/Proxy.php
@@ -48,7 +48,7 @@ class Proxy extends Component
public function submit()
{
try {
- resolve(SaveConfigurationSync::class)($this->server, $this->proxy_settings);
+ resolve(SaveConfigurationSync::class)($this->server);
$this->server->proxy->redirect_url = $this->redirect_url;
$this->server->save();
diff --git a/app/Http/Livewire/Server/Proxy/Deploy.php b/app/Http/Livewire/Server/Proxy/Deploy.php
index c6d804a15d..df369c49a4 100644
--- a/app/Http/Livewire/Server/Proxy/Deploy.php
+++ b/app/Http/Livewire/Server/Proxy/Deploy.php
@@ -22,7 +22,7 @@ class Deploy extends Component
$this->server->proxy->last_applied_settings &&
$this->server->proxy->last_saved_settings !== $this->server->proxy->last_applied_settings
) {
- resolve(SaveConfigurationSync::class)($this->server, $this->proxy_settings);
+ resolve(SaveConfigurationSync::class)($this->server);
}
$activity = resolve(StartProxy::class)($this->server);
diff --git a/app/Http/Livewire/Server/Proxy/Modal.php b/app/Http/Livewire/Server/Proxy/Modal.php
new file mode 100644
index 0000000000..2674abe3d1
--- /dev/null
+++ b/app/Http/Livewire/Server/Proxy/Modal.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Http\Livewire\Server\Proxy;
+
+use App\Models\Server;
+use Livewire\Component;
+
+class Modal extends Component
+{
+ public Server $server;
+
+ public function proxyStatusUpdated()
+ {
+ $this->emit('proxyStatusUpdated');
+ }
+}
diff --git a/resources/views/components/server/navbar.blade.php b/resources/views/components/server/navbar.blade.php
index 382e968c39..5aaafead1a 100644
--- a/resources/views/components/server/navbar.blade.php
+++ b/resources/views/components/server/navbar.blade.php
@@ -1,4 +1,5 @@
<div class="pb-6">
+ <livewire:server.proxy.modal :server="$server" />
<div class="flex items-center gap-2">
<h1>Server</h1>
@if ($server->settings->is_reachable)
diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php
index 0b38ad940b..59ce5bf4cc 100644
--- a/resources/views/livewire/server/proxy.blade.php
+++ b/resources/views/livewire/server/proxy.blade.php
@@ -1,16 +1,6 @@
<div>
@if ($server->isFunctional())
@if (data_get($server,'proxy.type'))
- <x-modal submitWireAction="proxyStatusUpdated" modalId="startProxy">
- <x-slot:modalBody>
- <livewire:activity-monitor header="Proxy Startup Logs" />
- </x-slot:modalBody>
- <x-slot:modalSubmit>
- <x-forms.button onclick="startProxy.close()" type="submit">
- Close
- </x-forms.button>
- </x-slot:modalSubmit>
- </x-modal>
<div x-init="$wire.loadProxyConfiguration">
@if ($selectedProxy === 'TRAEFIK_V2')
<form wire:submit.prevent='submit'>
diff --git a/resources/views/livewire/server/proxy/modal.blade.php b/resources/views/livewire/server/proxy/modal.blade.php
new file mode 100644
index 0000000000..3dfb2d31cb
--- /dev/null
+++ b/resources/views/livewire/server/proxy/modal.blade.php
@@ -0,0 +1,12 @@
+<div>
+ <x-modal submitWireAction="proxyStatusUpdated" modalId="startProxy">
+ <x-slot:modalBody>
+ <livewire:activity-monitor header="Proxy Startup Logs" />
+ </x-slot:modalBody>
+ <x-slot:modalSubmit>
+ <x-forms.button onclick="startProxy.close()" type="submit">
+ Close
+ </x-forms.button>
+ </x-slot:modalSubmit>
+ </x-modal>
+</div>
diff --git a/resources/views/livewire/server/proxy/status.blade.php b/resources/views/livewire/server/proxy/status.blade.php
index 3aec00746b..db496f561b 100644
--- a/resources/views/livewire/server/proxy/status.blade.php
+++ b/resources/views/livewire/server/proxy/status.blade.php
@@ -1,3 +1,4 @@
+
<div class="flex gap-2" x-init="$wire.getProxyStatus">
@if ($server->proxy->status === 'running')
<x-status.running text="Proxy Running" />