fix(deployment): update COOLIFY_URL and COOLIFY_FQDN generation to use Spatie URL library for improved accuracy
This commit is contained in:
parent
94f9c54256
commit
b9ba04c4e1
1 changed files with 6 additions and 6 deletions
|
|
@ -1387,16 +1387,16 @@ private function set_coolify_variables()
|
||||||
$fqdn = $this->preview->fqdn;
|
$fqdn = $this->preview->fqdn;
|
||||||
}
|
}
|
||||||
if (isset($fqdn)) {
|
if (isset($fqdn)) {
|
||||||
$fqdnWithoutPort = str($fqdn)->after('://')->before(':')->prepend(str($fqdn)->before('://')->append('://'));
|
$url = Url::fromString($fqdn);
|
||||||
$url = str($fqdn)->replace('http://', '')->replace('https://', '')->before(':');
|
$fqdn = $url->getHost();
|
||||||
|
$url = $url->withHost($fqdn)->withPort(null)->__toString();
|
||||||
if ((int) $this->application->compose_parsing_version >= 3) {
|
if ((int) $this->application->compose_parsing_version >= 3) {
|
||||||
$this->coolify_variables .= "COOLIFY_URL={$fqdnWithoutPort} ";
|
$this->coolify_variables .= "COOLIFY_URL={$url} ";
|
||||||
$this->coolify_variables .= "COOLIFY_FQDN={$url} ";
|
$this->coolify_variables .= "COOLIFY_FQDN={$fqdn} ";
|
||||||
} else {
|
} else {
|
||||||
$this->coolify_variables .= "COOLIFY_URL={$fqdnWithoutPort} ";
|
$this->coolify_variables .= "COOLIFY_URL={$fqdn} ";
|
||||||
$this->coolify_variables .= "COOLIFY_FQDN={$url} ";
|
$this->coolify_variables .= "COOLIFY_FQDN={$url} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (isset($this->application->git_branch)) {
|
if (isset($this->application->git_branch)) {
|
||||||
$this->coolify_variables .= "COOLIFY_BRANCH={$this->application->git_branch} ";
|
$this->coolify_variables .= "COOLIFY_BRANCH={$this->application->git_branch} ";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue