Merge branch 'next' into feat-service-neon

This commit is contained in:
Andras Bacsai
2025-03-10 18:24:36 +01:00
committed by GitHub
5 changed files with 26 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ use App\Models\Service;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Validation\Rule; use Illuminate\Validation\Rule;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
use Spatie\Url\Url;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Visus\Cuid2\Cuid2; use Visus\Cuid2\Cuid2;
@@ -811,6 +812,11 @@ class ApplicationsController extends Controller
'docker_compose_raw' => 'string|nullable', 'docker_compose_raw' => 'string|nullable',
'docker_compose_domains' => 'array|nullable', 'docker_compose_domains' => 'array|nullable',
]; ];
// ports_exposes is not required for dockercompose
if ($request->build_pack === 'dockercompose') {
$validationRules['ports_exposes'] = 'string';
$request->offsetSet('ports_exposes', '80');
}
$validationRules = array_merge(sharedDataApplications(), $validationRules); $validationRules = array_merge(sharedDataApplications(), $validationRules);
$validator = customApiValidator($request->all(), $validationRules); $validator = customApiValidator($request->all(), $validationRules);
if ($validator->fails()) { if ($validator->fails()) {
@@ -822,10 +828,6 @@ class ApplicationsController extends Controller
if (! $request->has('name')) { if (! $request->has('name')) {
$request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch)); $request->offsetSet('name', generate_application_name($request->git_repository, $request->git_branch));
} }
if ($request->build_pack === 'dockercompose') {
$request->offsetSet('ports_exposes', '80');
}
$return = $this->validateDataApplications($request, $server); $return = $this->validateDataApplications($request, $server);
if ($return instanceof \Illuminate\Http\JsonResponse) { if ($return instanceof \Illuminate\Http\JsonResponse) {
return $return; return $return;
@@ -848,7 +850,13 @@ class ApplicationsController extends Controller
if ($dockerComposeDomainsJson->count() > 0) { if ($dockerComposeDomainsJson->count() > 0) {
$application->docker_compose_domains = $dockerComposeDomainsJson; $application->docker_compose_domains = $dockerComposeDomainsJson;
} }
$repository_url_parsed = Url::fromString($request->git_repository);
$git_host = $repository_url_parsed->getHost();
if ($git_host === 'github.com') {
$application->source_type = GithubApp::class;
$application->source_id = GithubApp::find(0)->id;
}
$application->git_repository = $repository_url_parsed->getSegment(1).'/'.$repository_url_parsed->getSegment(2);
$application->fqdn = $fqdn; $application->fqdn = $fqdn;
$application->destination_id = $destination->id; $application->destination_id = $destination->id;
$application->destination_type = $destination->getMorphClass(); $application->destination_type = $destination->getMorphClass();

View File

@@ -78,11 +78,15 @@ class ServiceDatabase extends BaseModel
public function databaseType() public function databaseType()
{ {
$image = str($this->image)->before(':'); $image = str($this->image)->before(':');
if ($image->contains('postgres') || $image->contains('postgis')) { if ($image->contains('supabase/postgres')) {
$image = 'postgresql'; $finalImage = 'supabase/postgres';
} elseif ($image->contains('postgres') || $image->contains('postgis')) {
$finalImage = 'postgresql';
} else {
$finalImage = $image;
} }
return "standalone-$image"; return "standalone-$finalImage";
} }
public function getServiceDatabaseUrl() public function getServiceDatabaseUrl()

View File

@@ -2,7 +2,7 @@
return [ return [
'coolify' => [ 'coolify' => [
'version' => '4.0.0-beta.398', 'version' => '4.0.0-beta.399',
'helper_version' => '1.0.7', 'helper_version' => '1.0.7',
'realtime_version' => '1.0.6', 'realtime_version' => '1.0.6',
'self_hosted' => env('SELF_HOSTED', true), 'self_hosted' => env('SELF_HOSTED', true),

View File

@@ -336,13 +336,13 @@ if ! [ -x "$(command -v docker)" ]; then
exit 1 exit 1
fi fi
;; ;;
"fedora") "centos" | "fedora" | "rhel")
if [ -x "$(command -v dnf5)" ]; then if [ -x "$(command -v dnf5)" ]; then
# dnf5 is available # dnf5 is available
dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo --overwrite >/dev/null 2>&1 dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/$OS_TYPE/docker-ce.repo --overwrite >/dev/null 2>&1
else else
# dnf5 is not available, use dnf # dnf5 is not available, use dnf
dnf config-manager --add-repo=https://download.docker.com/linux/fedora/docker-ce.repo >/dev/null 2>&1 dnf config-manager --add-repo=https://download.docker.com/linux/$OS_TYPE/docker-ce.repo >/dev/null 2>&1
fi fi
dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null 2>&1 dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin >/dev/null 2>&1
if ! [ -x "$(command -v docker)" ]; then if ! [ -x "$(command -v docker)" ]; then

View File

@@ -1,10 +1,10 @@
{ {
"coolify": { "coolify": {
"v4": { "v4": {
"version": "4.0.0-beta.398" "version": "4.0.0-beta.399"
}, },
"nightly": { "nightly": {
"version": "4.0.0-beta.399" "version": "4.0.0-beta.400"
}, },
"helper": { "helper": {
"version": "1.0.7" "version": "1.0.7"