Merge pull request #1539 from coollabsio/next

v4.0.0-beta.161
This commit is contained in:
Andras Bacsai 2023-12-12 16:47:56 +01:00 committed by GitHub
commit 6b751f965b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 14 deletions

View File

@ -267,7 +267,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
"ignore_errors" => true, "ignore_errors" => true,
] ]
); );
ApplicationStatusChanged::dispatch(data_get($this->application,'environment.project.team.id')); ApplicationStatusChanged::dispatch(data_get($this->application, 'environment.project.team.id'));
} }
} }
private function push_to_docker_registry() private function push_to_docker_registry()
@ -874,6 +874,20 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$environment_variables = $this->generate_environment_variables($ports); $environment_variables = $this->generate_environment_variables($ports);
if (data_get($this->application, 'custom_labels')) { if (data_get($this->application, 'custom_labels')) {
if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) {
ray('custom_labels is base64 encoded');
} else {
ray('custom_labels is not base64 encoded');
$this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n");
$this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels'));
$this->application->save();
}
if (mb_detect_encoding(base64_decode($this->application->custom_labels), 'ASCII', true) === false) {
ray('custom_labels contains non-ascii characters');
$this->application->custom_labels = base64_encode(str(implode(",", generateLabelsApplication($this->application, $this->preview)))->replace(',', "\n"));
$this->application->save();
}
$labels = collect(preg_split("/\r\n|\n|\r/", base64_decode($this->application->custom_labels))); $labels = collect(preg_split("/\r\n|\n|\r/", base64_decode($this->application->custom_labels)));
$labels = $labels->filter(function ($value, $key) { $labels = $labels->filter(function ($value, $key) {
return !Str::startsWith($value, 'coolify.'); return !Str::startsWith($value, 'coolify.');
@ -1247,7 +1261,8 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");
} }
} }
private function build_by_compose_file() { private function build_by_compose_file()
{
$this->application_deployment_queue->addLogEntry("Pulling & building required images."); $this->application_deployment_queue->addLogEntry("Pulling & building required images.");
if ($this->application->build_pack === 'dockerimage') { if ($this->application->build_pack === 'dockerimage') {
$this->application_deployment_queue->addLogEntry("Pulling latest images from the registry."); $this->application_deployment_queue->addLogEntry("Pulling latest images from the registry.");

View File

@ -110,16 +110,23 @@ class General extends Component
} }
$this->isConfigurationChanged = $this->application->isConfigurationChanged(); $this->isConfigurationChanged = $this->application->isConfigurationChanged();
if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) { if (data_get($this->application, 'custom_labels')) {
ray('custom_labels is base64 encoded'); if (base64_encode(base64_decode(data_get($this->application, 'custom_labels'), true)) === data_get($this->application, 'custom_labels')) {
} else { ray('custom_labels is base64 encoded');
ray('custom_labels is not base64 encoded'); } else {
$this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n"); ray('custom_labels is not base64 encoded');
$this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels')); $this->application->custom_labels = str($this->application->custom_labels)->replace(',', "\n");
$this->application->save(); $this->application->custom_labels = base64_encode(data_get($this->application, 'custom_labels'));
$this->application->save();
}
$this->customLabels = base64_decode(data_get($this->application, 'custom_labels'));
// // Fix for non-ascii characters
if (mb_detect_encoding($this->customLabels, 'ASCII', true) === false) {
ray('custom_labels contains non-ascii characters');
$this->resetDefaultLabels(false);
}
} }
$this->customLabels = base64_decode(data_get($this->application, 'custom_labels'));
$this->initialDockerComposeLocation = $this->application->docker_compose_location; $this->initialDockerComposeLocation = $this->application->docker_compose_location;
$this->checkLabelUpdates(); $this->checkLabelUpdates();
} }
@ -242,7 +249,6 @@ class General extends Component
$this->application->docker_compose_domains = json_encode($this->parsedServiceDomains); $this->application->docker_compose_domains = json_encode($this->parsedServiceDomains);
$this->parsedServices = $this->application->parseCompose(); $this->parsedServices = $this->application->parseCompose();
} }
$this->application->custom_labels = base64_encode($this->customLabels); $this->application->custom_labels = base64_encode($this->customLabels);
$this->application->save(); $this->application->save();
$showToaster && $this->dispatch('success', 'Application settings updated!'); $showToaster && $this->dispatch('success', 'Application settings updated!');

View File

@ -7,7 +7,7 @@ return [
// The release version of your application // The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
'release' => '4.0.0-beta.160', 'release' => '4.0.0-beta.161',
// When left empty or `null` the Laravel environment will be used // When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'), 'environment' => config('app.env'),

View File

@ -1,3 +1,3 @@
<?php <?php
return '4.0.0-beta.160'; return '4.0.0-beta.161';

View File

@ -4,7 +4,7 @@
"version": "3.12.36" "version": "3.12.36"
}, },
"v4": { "v4": {
"version": "4.0.0-beta.160" "version": "4.0.0-beta.161"
} }
} }
} }