From 70fa57d8c2bc985b06d3666c00602489662cea95 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 14 Jun 2023 09:05:13 +0200 Subject: [PATCH] fix --- bootstrap/helpers/shared.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index a8041da78..3001b24b1 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -87,10 +87,13 @@ function base_url() $settings = InstanceSettings::get(); if ($settings->fqdn) { return $settings->fqdn; - } else { - if (config('app.env') === 'local') { - return url('/') . ':8080'; - } - return url('/'); } + $port = config('app.port'); + if ($settings->public_ipv4) { + return "http://{$settings->public_ipv4}:{$port}"; + } + if ($settings->public_ipv6) { + return "http://{$settings->public_ipv6}:{$port}"; + } + return url('/'); }