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.

fix: server ip could be hostname in self-hosted

Andras Bacsaib196c138d95d
diff --git a/app/Http/Livewire/Server/Form.php b/app/Http/Livewire/Server/Form.php
index f773155d5c..62668d6ba5 100644
--- a/app/Http/Livewire/Server/Form.php
+++ b/app/Http/Livewire/Server/Form.php
@@ -21,7 +21,7 @@ class Form extends Component
protected $rules = [
'server.name' => 'required|min:6',
'server.description' => 'nullable',
- 'server.ip' => 'required|ip',
+ 'server.ip' => 'required',
'server.user' => 'required',
'server.port' => 'required',
'server.settings.is_cloudflare_tunnel' => 'required',
@@ -45,7 +45,8 @@ class Form extends Component
$this->wildcard_domain = $this->server->settings->wildcard_domain;
$this->cleanup_after_percentage = $this->server->settings->cleanup_after_percentage;
}
- public function serverRefresh() {
+ public function serverRefresh()
+ {
$this->validateServer();
}
public function instantSave()
@@ -61,7 +62,8 @@ class Form extends Component
$activity = InstallDocker::run($this->server);
$this->emit('newMonitorActivity', $activity->id);
}
- public function checkLocalhostConnection() {
+ public function checkLocalhostConnection()
+ {
$uptime = $this->server->validateConnection();
if ($uptime) {
$this->emit('success', 'Server is reachable.');
@@ -80,7 +82,7 @@ class Form extends Component
if ($uptime) {
$install && $this->emit('success', 'Server is reachable.');
} else {
- $install &&$this->emit('error', 'Server is not reachable. Please check your connection and configuration.');
+ $install && $this->emit('error', 'Server is not reachable. Please check your connection and configuration.');
return;
}
$dockerInstalled = $this->server->validateDockerEngine();
@@ -120,7 +122,15 @@ class Form extends Component
}
public function submit()
{
- $this->validate();
+ $validDomainsForServers = collect(['host.docker.internal', 'coolify-testing-host']);
+ if ($validDomainsForServers->contains($this->server->ip)) {
+ $this->validate();
+ } else {
+ $this->validate();
+ $this->validate([
+ 'server.ip' => 'required|ip',
+ ]);
+ }
$uniqueIPs = Server::all()->reject(function (Server $server) {
return $server->id === $this->server->id;
})->pluck('ip')->toArray();