mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-15 22:14:53 +00:00
Merge remote-tracking branch 'origin/next' into fix/docker-compose-domains-api-9211
This commit is contained in:
commit
b5ba40b049
1162 files changed
+65679
-17490
No files matched your search
@@ -14,7 +14,6 @@ use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Str;
|
||||
use Spatie\Url\Url;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Visus\Cuid2\Cuid2;
|
||||
|
||||
/**
|
||||
* Validates a Docker Compose YAML string for command injection vulnerabilities.
|
||||
@@ -371,8 +370,6 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int
|
||||
$pullRequestId = $pull_request_id;
|
||||
$isPullRequest = $pullRequestId == 0 ? false : true;
|
||||
$server = data_get($resource, 'destination.server');
|
||||
$fileStorages = $resource->fileStorages();
|
||||
|
||||
try {
|
||||
$yaml = Yaml::parse($compose);
|
||||
} catch (Exception) {
|
||||
@@ -726,14 +723,11 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int
|
||||
$source = $parsed['source'];
|
||||
$target = $parsed['target'];
|
||||
// Mode is available in $parsed['mode'] if needed
|
||||
$foundConfig = $fileStorages->whereMountPath($target)->first();
|
||||
$foundConfig = $originalResource->fileStorages()->whereMountPath($target)->first();
|
||||
if (sourceIsLocal($source)) {
|
||||
$type = str('bind');
|
||||
if ($foundConfig) {
|
||||
$contentNotNull_temp = data_get($foundConfig, 'content');
|
||||
if ($contentNotNull_temp) {
|
||||
$content = $contentNotNull_temp;
|
||||
}
|
||||
$content = data_get($foundConfig, 'content');
|
||||
$isDirectory = data_get($foundConfig, 'is_directory');
|
||||
} else {
|
||||
// By default, we cannot determine if the bind is a directory or not, so we set it to directory
|
||||
@@ -779,12 +773,9 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int
|
||||
}
|
||||
}
|
||||
|
||||
$foundConfig = $fileStorages->whereMountPath($target)->first();
|
||||
$foundConfig = $originalResource->fileStorages()->whereMountPath($target)->first();
|
||||
if ($foundConfig) {
|
||||
$contentNotNull_temp = data_get($foundConfig, 'content');
|
||||
if ($contentNotNull_temp) {
|
||||
$content = $contentNotNull_temp;
|
||||
}
|
||||
$content = data_get($foundConfig, 'content');
|
||||
$isDirectory = data_get($foundConfig, 'is_directory');
|
||||
} else {
|
||||
// if isDirectory is not set (or false) & content is also not set, we assume it is a directory
|
||||
@@ -1262,7 +1253,7 @@ function applicationParser(Application $resource, int $pull_request_id = 0, ?int
|
||||
$schema = $url->getScheme();
|
||||
$portInt = $url->getPort();
|
||||
$port = $portInt !== null ? ':'.$portInt : '';
|
||||
$random = new Cuid2;
|
||||
$random = new_public_id();
|
||||
$preview_fqdn = str_replace('{{random}}', $random, $template);
|
||||
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
|
||||
$preview_fqdn = str_replace('{{pr_id}}', $pullRequestId, $preview_fqdn);
|
||||
@@ -1619,7 +1610,7 @@ function serviceParser(Service $resource): Collection
|
||||
if ($databaseFound) {
|
||||
$savedService = $databaseFound;
|
||||
} else {
|
||||
$savedService = ServiceDatabase::forceCreate([
|
||||
$savedService = ServiceDatabase::create([
|
||||
'name' => $serviceName,
|
||||
'service_id' => $resource->id,
|
||||
]);
|
||||
@@ -1629,7 +1620,7 @@ function serviceParser(Service $resource): Collection
|
||||
if ($applicationFound) {
|
||||
$savedService = $applicationFound;
|
||||
} else {
|
||||
$savedService = ServiceApplication::forceCreate([
|
||||
$savedService = ServiceApplication::create([
|
||||
'name' => $serviceName,
|
||||
'service_id' => $resource->id,
|
||||
]);
|
||||
@@ -2093,7 +2084,6 @@ function serviceParser(Service $resource): Collection
|
||||
'service_id' => $resource->id,
|
||||
]);
|
||||
}
|
||||
$fileStorages = $savedService->fileStorages();
|
||||
if ($savedService->image !== $image) {
|
||||
$savedService->image = $image;
|
||||
$savedService->save();
|
||||
@@ -2113,14 +2103,11 @@ function serviceParser(Service $resource): Collection
|
||||
$source = $parsed['source'];
|
||||
$target = $parsed['target'];
|
||||
// Mode is available in $parsed['mode'] if needed
|
||||
$foundConfig = $fileStorages->whereMountPath($target)->first();
|
||||
$foundConfig = $originalResource->fileStorages()->whereMountPath($target)->first();
|
||||
if (sourceIsLocal($source)) {
|
||||
$type = str('bind');
|
||||
if ($foundConfig) {
|
||||
$contentNotNull_temp = data_get($foundConfig, 'content');
|
||||
if ($contentNotNull_temp) {
|
||||
$content = $contentNotNull_temp;
|
||||
}
|
||||
$content = data_get($foundConfig, 'content');
|
||||
$isDirectory = data_get($foundConfig, 'is_directory');
|
||||
} else {
|
||||
// By default, we cannot determine if the bind is a directory or not, so we set it to directory
|
||||
@@ -2166,12 +2153,9 @@ function serviceParser(Service $resource): Collection
|
||||
}
|
||||
}
|
||||
|
||||
$foundConfig = $fileStorages->whereMountPath($target)->first();
|
||||
$foundConfig = $originalResource->fileStorages()->whereMountPath($target)->first();
|
||||
if ($foundConfig) {
|
||||
$contentNotNull_temp = data_get($foundConfig, 'content');
|
||||
if ($contentNotNull_temp) {
|
||||
$content = $contentNotNull_temp;
|
||||
}
|
||||
$content = data_get($foundConfig, 'content');
|
||||
$isDirectory = data_get($foundConfig, 'is_directory');
|
||||
} else {
|
||||
// if isDirectory is not set (or false) & content is also not set, we assume it is a directory
|
||||
|
||||
Reference in new issue
Block a user