fix: generate https for minio
This commit is contained in:
@@ -229,12 +229,12 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource)
|
||||
}
|
||||
if (is_null($MINIO_BROWSER_REDIRECT_URL?->value)) {
|
||||
$MINIO_BROWSER_REDIRECT_URL?->update([
|
||||
'value' => generateFqdn($server, 'console-'.$uuid),
|
||||
'value' => generateFqdn($server, 'console-'.$uuid, true),
|
||||
]);
|
||||
}
|
||||
if (is_null($MINIO_SERVER_URL?->value)) {
|
||||
$MINIO_SERVER_URL?->update([
|
||||
'value' => generateFqdn($server, 'minio-'.$uuid),
|
||||
'value' => generateFqdn($server, 'minio-'.$uuid, true),
|
||||
]);
|
||||
}
|
||||
$payload = collect([
|
||||
|
||||
@@ -478,7 +478,7 @@ function data_get_str($data, $key, $default = null): Stringable
|
||||
return str($str);
|
||||
}
|
||||
|
||||
function generateFqdn(Server $server, string $random): string
|
||||
function generateFqdn(Server $server, string $random, bool $forceHttps = false): string
|
||||
{
|
||||
$wildcard = data_get($server, 'settings.wildcard_domain');
|
||||
if (is_null($wildcard) || $wildcard === '') {
|
||||
@@ -488,6 +488,9 @@ function generateFqdn(Server $server, string $random): string
|
||||
$host = $url->getHost();
|
||||
$path = $url->getPath() === '/' ? '' : $url->getPath();
|
||||
$scheme = $url->getScheme();
|
||||
if ($forceHttps) {
|
||||
$scheme = 'https';
|
||||
}
|
||||
$finalFqdn = "$scheme://{$random}.$host$path";
|
||||
|
||||
return $finalFqdn;
|
||||
|
||||
Reference in New Issue
Block a user