fix: disable cloudflare tunnel on "localhost"
This commit is contained in:
@@ -17,6 +17,9 @@ class CloudflareTunnels extends Component
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();
|
$this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();
|
||||||
|
if ($this->server->isLocalhost()) {
|
||||||
|
return redirect()->route('server.show', ['server_uuid' => $server_uuid]);
|
||||||
|
}
|
||||||
$this->isCloudflareTunnelsEnabled = $this->server->settings->is_cloudflare_tunnel;
|
$this->isCloudflareTunnelsEnabled = $this->server->settings->is_cloudflare_tunnel;
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
|
|||||||
@@ -10,9 +10,11 @@
|
|||||||
href="{{ route('server.private-key', ['server_uuid' => $server->uuid]) }}">Private Key
|
href="{{ route('server.private-key', ['server_uuid' => $server->uuid]) }}">Private Key
|
||||||
</a>
|
</a>
|
||||||
@if ($server->isFunctional())
|
@if ($server->isFunctional())
|
||||||
|
@if (!$server->isLocalhost())
|
||||||
<a class="menu-item {{ $activeMenu === 'cloudflare-tunnels' ? 'menu-item-active' : '' }}"
|
<a class="menu-item {{ $activeMenu === 'cloudflare-tunnels' ? 'menu-item-active' : '' }}"
|
||||||
href="{{ route('server.cloudflare-tunnels', ['server_uuid' => $server->uuid]) }}">Cloudflare
|
href="{{ route('server.cloudflare-tunnels', ['server_uuid' => $server->uuid]) }}">Cloudflare
|
||||||
Tunnels</a>
|
Tunnels</a>
|
||||||
|
@endif
|
||||||
<a class="menu-item {{ $activeMenu === 'destinations' ? 'menu-item-active' : '' }}"
|
<a class="menu-item {{ $activeMenu === 'destinations' ? 'menu-item-active' : '' }}"
|
||||||
href="{{ route('server.destinations', ['server_uuid' => $server->uuid]) }}">Destinations
|
href="{{ route('server.destinations', ['server_uuid' => $server->uuid]) }}">Destinations
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -12,8 +12,7 @@
|
|||||||
<x-helper class="inline-flex"
|
<x-helper class="inline-flex"
|
||||||
helper="If you are using Cloudflare Tunnels, enable this. It will proxy all SSH requests to your server through Cloudflare.<br> You then can close your server's SSH port in the firewall of your hosting provider.<br><span class='dark:text-warning'>If you choose manual configuration, Coolify does not install or set up Cloudflare (cloudflared) on your server.</span>" />
|
helper="If you are using Cloudflare Tunnels, enable this. It will proxy all SSH requests to your server through Cloudflare.<br> You then can close your server's SSH port in the firewall of your hosting provider.<br><span class='dark:text-warning'>If you choose manual configuration, Coolify does not install or set up Cloudflare (cloudflared) on your server.</span>" />
|
||||||
</div>
|
</div>
|
||||||
<div>Secure your servers with Cloudflare Tunnels</div>
|
<div>Secure your servers with Cloudflare Tunnels.</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2 pt-6">
|
<div class="flex flex-col gap-2 pt-6">
|
||||||
@if ($isCloudflareTunnelsEnabled)
|
@if ($isCloudflareTunnelsEnabled)
|
||||||
|
|||||||
Reference in New Issue
Block a user