refactor(urls): replace generateFqdn with generateUrl for consistent URL generation across applications
This commit is contained in:
@@ -430,7 +430,7 @@ class General extends Component
|
|||||||
|
|
||||||
$server = data_get($this->application, 'destination.server');
|
$server = data_get($this->application, 'destination.server');
|
||||||
if ($server) {
|
if ($server) {
|
||||||
$fqdn = generateFqdn(server: $server, random: $this->application->uuid, parserVersion: $this->application->compose_parsing_version);
|
$fqdn = generateUrl(server: $server, random: $this->application->uuid);
|
||||||
$this->application->fqdn = $fqdn;
|
$this->application->fqdn = $fqdn;
|
||||||
$this->application->save();
|
$this->application->save();
|
||||||
$this->resetDefaultLabels();
|
$this->resetDefaultLabels();
|
||||||
|
@@ -60,7 +60,7 @@ class PreviewsCompose extends Component
|
|||||||
$random = new Cuid2;
|
$random = new Cuid2;
|
||||||
|
|
||||||
// Generate a unique domain like main app services do
|
// Generate a unique domain like main app services do
|
||||||
$generated_fqdn = generateFqdn(server: $server, random: $random, parserVersion: $this->preview->application->compose_parsing_version);
|
$generated_fqdn = generateUrl(server: $server, random: $random);
|
||||||
|
|
||||||
$preview_fqdn = str_replace('{{random}}', $random, $template);
|
$preview_fqdn = str_replace('{{random}}', $random, $template);
|
||||||
$preview_fqdn = str_replace('{{domain}}', str($generated_fqdn)->after('://'), $preview_fqdn);
|
$preview_fqdn = str_replace('{{domain}}', str($generated_fqdn)->after('://'), $preview_fqdn);
|
||||||
|
@@ -133,7 +133,7 @@ class CloneMe extends Component
|
|||||||
$uuid = (string) new Cuid2;
|
$uuid = (string) new Cuid2;
|
||||||
$url = $application->fqdn;
|
$url = $application->fqdn;
|
||||||
if ($this->server->proxyType() !== 'NONE' && $applicationSettings->is_container_label_readonly_enabled === true) {
|
if ($this->server->proxyType() !== 'NONE' && $applicationSettings->is_container_label_readonly_enabled === true) {
|
||||||
$url = generateFqdn(server: $this->server, random: $uuid, parserVersion: $application->compose_parsing_version);
|
$url = generateUrl(server: $this->server, random: $uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$newApplication = $application->replicate([
|
$newApplication = $application->replicate([
|
||||||
|
@@ -60,7 +60,7 @@ class DockerImage extends Component
|
|||||||
'health_check_enabled' => false,
|
'health_check_enabled' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$fqdn = generateFqdn($destination->server, $application->uuid);
|
$fqdn = generateUrl(server: $destination->server, random: $application->uuid);
|
||||||
$application->update([
|
$application->update([
|
||||||
'name' => 'docker-image-'.$application->uuid,
|
'name' => 'docker-image-'.$application->uuid,
|
||||||
'fqdn' => $fqdn,
|
'fqdn' => $fqdn,
|
||||||
|
@@ -208,7 +208,7 @@ class GithubPrivateRepository extends Component
|
|||||||
$application['docker_compose_location'] = $this->docker_compose_location;
|
$application['docker_compose_location'] = $this->docker_compose_location;
|
||||||
$application['base_directory'] = $this->base_directory;
|
$application['base_directory'] = $this->base_directory;
|
||||||
}
|
}
|
||||||
$fqdn = generateFqdn($destination->server, $application->uuid);
|
$fqdn = generateUrl(server: $destination->server, random: $application->uuid);
|
||||||
$application->fqdn = $fqdn;
|
$application->fqdn = $fqdn;
|
||||||
|
|
||||||
$application->name = generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name, $application->uuid);
|
$application->name = generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name, $application->uuid);
|
||||||
|
@@ -194,7 +194,7 @@ class GithubPrivateRepositoryDeployKey extends Component
|
|||||||
$application->settings->is_static = $this->is_static;
|
$application->settings->is_static = $this->is_static;
|
||||||
$application->settings->save();
|
$application->settings->save();
|
||||||
|
|
||||||
$fqdn = generateFqdn($destination->server, $application->uuid);
|
$fqdn = generateUrl(server: $destination->server, random: $application->uuid);
|
||||||
$application->fqdn = $fqdn;
|
$application->fqdn = $fqdn;
|
||||||
$application->name = generate_random_name($application->uuid);
|
$application->name = generate_random_name($application->uuid);
|
||||||
$application->save();
|
$application->save();
|
||||||
|
@@ -373,7 +373,7 @@ class PublicGitRepository extends Component
|
|||||||
|
|
||||||
$application->settings->is_static = $this->isStatic;
|
$application->settings->is_static = $this->isStatic;
|
||||||
$application->settings->save();
|
$application->settings->save();
|
||||||
$fqdn = generateFqdn($destination->server, $application->uuid);
|
$fqdn = generateUrl(server: $destination->server, random: $application->uuid);
|
||||||
$application->fqdn = $fqdn;
|
$application->fqdn = $fqdn;
|
||||||
$application->save();
|
$application->save();
|
||||||
if ($this->checkCoolifyConfig) {
|
if ($this->checkCoolifyConfig) {
|
||||||
|
@@ -68,7 +68,7 @@ CMD ["nginx", "-g", "daemon off;"]
|
|||||||
'source_type' => GithubApp::class,
|
'source_type' => GithubApp::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$fqdn = generateFqdn($destination->server, $application->uuid);
|
$fqdn = generateUrl(server: $destination->server, random: $application->uuid);
|
||||||
$application->update([
|
$application->update([
|
||||||
'name' => 'dockerfile-'.$application->uuid,
|
'name' => 'dockerfile-'.$application->uuid,
|
||||||
'fqdn' => $fqdn,
|
'fqdn' => $fqdn,
|
||||||
|
@@ -66,7 +66,7 @@ class ResourceOperations extends Component
|
|||||||
$url = $this->resource->fqdn;
|
$url = $this->resource->fqdn;
|
||||||
|
|
||||||
if ($server->proxyType() !== 'NONE' && $applicationSettings->is_container_label_readonly_enabled === true) {
|
if ($server->proxyType() !== 'NONE' && $applicationSettings->is_container_label_readonly_enabled === true) {
|
||||||
$url = generateFqdn(server: $server, random: $uuid, parserVersion: $this->resource->compose_parsing_version);
|
$url = generateUrl(server: $server, random: $uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
$new_resource = $this->resource->replicate([
|
$new_resource = $this->resource->replicate([
|
||||||
|
@@ -256,12 +256,12 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource)
|
|||||||
|
|
||||||
if (str($MINIO_BROWSER_REDIRECT_URL->value ?? '')->isEmpty()) {
|
if (str($MINIO_BROWSER_REDIRECT_URL->value ?? '')->isEmpty()) {
|
||||||
$MINIO_BROWSER_REDIRECT_URL->update([
|
$MINIO_BROWSER_REDIRECT_URL->update([
|
||||||
'value' => generateFqdn(server: $server, random: 'console-'.$uuid, parserVersion: $resource->service->compose_parsing_version, forceHttps: true),
|
'value' => generateUrl(server: $server, random: 'console-'.$uuid, forceHttps: true),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (str($MINIO_SERVER_URL->value ?? '')->isEmpty()) {
|
if (str($MINIO_SERVER_URL->value ?? '')->isEmpty()) {
|
||||||
$MINIO_SERVER_URL->update([
|
$MINIO_SERVER_URL->update([
|
||||||
'value' => generateFqdn(server: $server, random: 'minio-'.$uuid, parserVersion: $resource->service->compose_parsing_version, forceHttps: true),
|
'value' => generateUrl(server: $server, random: 'minio-'.$uuid, forceHttps: true),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$payload = collect([
|
$payload = collect([
|
||||||
@@ -279,12 +279,12 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource)
|
|||||||
|
|
||||||
if (str($LOGTO_ENDPOINT->value ?? '')->isEmpty()) {
|
if (str($LOGTO_ENDPOINT->value ?? '')->isEmpty()) {
|
||||||
$LOGTO_ENDPOINT->update([
|
$LOGTO_ENDPOINT->update([
|
||||||
'value' => generateFqdn(server: $server, random: 'logto-'.$uuid, parserVersion: $resource->service->compose_parsing_version),
|
'value' => generateUrl(server: $server, random: 'logto-'.$uuid),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (str($LOGTO_ADMIN_ENDPOINT->value ?? '')->isEmpty()) {
|
if (str($LOGTO_ADMIN_ENDPOINT->value ?? '')->isEmpty()) {
|
||||||
$LOGTO_ADMIN_ENDPOINT->update([
|
$LOGTO_ADMIN_ENDPOINT->update([
|
||||||
'value' => generateFqdn(server: $server, random: 'logto-admin-'.$uuid, parserVersion: $resource->service->compose_parsing_version),
|
'value' => generateUrl(server: $server, random: 'logto-admin-'.$uuid),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$payload = collect([
|
$payload = collect([
|
||||||
|
Reference in New Issue
Block a user