wip: fix for comma in labels
This commit is contained in:
parent
20dc2b47fe
commit
d8b97e06cf
@ -874,11 +874,12 @@ 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')) {
|
||||||
$labels = collect(str($this->application->custom_labels)->explode(','));
|
ray(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.');
|
||||||
});
|
});
|
||||||
$this->application->custom_labels = $labels->implode(',');
|
$this->application->custom_labels = base64_encode($labels);
|
||||||
$this->application->save();
|
$this->application->save();
|
||||||
} else {
|
} else {
|
||||||
$labels = collect(generateLabelsApplication($this->application, $this->preview));
|
$labels = collect(generateLabelsApplication($this->application, $this->preview));
|
||||||
|
@ -95,7 +95,6 @@ class General extends Component
|
|||||||
'application.dockerfile_target_build' => 'Dockerfile target build',
|
'application.dockerfile_target_build' => 'Dockerfile target build',
|
||||||
'application.settings.is_static' => 'Is static',
|
'application.settings.is_static' => 'Is static',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -110,11 +109,17 @@ class General extends Component
|
|||||||
$this->application->isConfigurationChanged(true);
|
$this->application->isConfigurationChanged(true);
|
||||||
}
|
}
|
||||||
$this->isConfigurationChanged = $this->application->isConfigurationChanged();
|
$this->isConfigurationChanged = $this->application->isConfigurationChanged();
|
||||||
if (is_null(data_get($this->application, 'custom_labels'))) {
|
|
||||||
$this->customLabels = str(implode(",", generateLabelsApplication($this->application)))->replace(',', "\n");
|
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 {
|
} else {
|
||||||
$this->customLabels = str($this->application->custom_labels)->replace(',', "\n");
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$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();
|
||||||
}
|
}
|
||||||
@ -233,10 +238,11 @@ class General extends Component
|
|||||||
if ($this->application->publish_directory && $this->application->publish_directory !== '/') {
|
if ($this->application->publish_directory && $this->application->publish_directory !== '/') {
|
||||||
$this->application->publish_directory = rtrim($this->application->publish_directory, '/');
|
$this->application->publish_directory = rtrim($this->application->publish_directory, '/');
|
||||||
}
|
}
|
||||||
if (gettype($this->customLabels) === 'string') {
|
$this->application->custom_labels = base64_encode($this->customLabels);
|
||||||
$this->customLabels = str($this->customLabels)->replace(',', "\n");
|
// if (gettype($this->customLabels) === 'string') {
|
||||||
}
|
// $this->customLabels = str($this->customLabels)->replace(',', "\n");
|
||||||
$this->application->custom_labels = $this->customLabels->explode("\n")->implode(',');
|
// }
|
||||||
|
// $this->application->custom_labels = $this->customLabels->explode("\n")->implode(',');
|
||||||
if ($this->application->build_pack === 'dockercompose') {
|
if ($this->application->build_pack === 'dockercompose') {
|
||||||
$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();
|
||||||
|
@ -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.157',
|
'release' => '4.0.0-beta.158',
|
||||||
// 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'),
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.157';
|
return '4.0.0-beta.158';
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"version": "3.12.36"
|
"version": "3.12.36"
|
||||||
},
|
},
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.157"
|
"version": "4.0.0-beta.158"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user