This commit is contained in:
Andras Bacsai
2023-06-16 11:01:27 +02:00
parent 2b8467e6a1
commit 2c3ddfd363
14 changed files with 35 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ if (!function_exists('getProxyConfiguration')) {
function getProxyConfiguration(Server $server)
{
$proxy_path = config('coolify.proxy_config_path');
if (config('app.env') === 'local') {
if (isDev()) {
$proxy_path = $proxy_path . '/testing-host-1/';
}
$networks = collect($server->standaloneDockers)->map(function ($docker) {
@@ -77,7 +77,7 @@ if (!function_exists('getProxyConfiguration')) {
],
],
];
if (config('app.env') === 'local') {
if (isDev()) {
$config['services']['traefik']['command'][] = "--log.level=debug";
}
return Yaml::dump($config, 4, 2);

View File

@@ -82,7 +82,7 @@ function set_transanctional_email_settings()
]);
}
function base_url()
function base_url(bool $withPort = true)
{
$settings = InstanceSettings::get();
if ($settings->fqdn) {
@@ -90,10 +90,27 @@ function base_url()
}
$port = config('app.port');
if ($settings->public_ipv4) {
return "http://{$settings->public_ipv4}:{$port}";
if ($withPort) {
if (isDev()) {
return "http://localhost:{$port}";
}
return "http://{$settings->public_ipv4}:{$port}";
}
if (isDev()) {
return "http://localhost";
}
return "http://{$settings->public_ipv4}";
}
if ($settings->public_ipv6) {
return "http://{$settings->public_ipv6}:{$port}";
if ($withPort) {
return "http://{$settings->public_ipv6}:{$port}";
}
return "http://{$settings->public_ipv6}";
}
return url('/');
}
function isDev()
{
return config('app.env') === 'local';
}