Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat: add predefined network connection for pgAdmin and postgresus services

Andras Bacsaie5280fd3ad73
diff --git a/app/Http/Controllers/Api/ServicesController.php b/app/Http/Controllers/Api/ServicesController.php
index 469d8b5501..7440cc16a0 100644
--- a/app/Http/Controllers/Api/ServicesController.php
+++ b/app/Http/Controllers/Api/ServicesController.php
@@ -351,7 +351,7 @@ class ServicesController extends Controller
'destination_id' => $destination->id,
'destination_type' => $destination->getMorphClass(),
];
- if ($oneClickServiceName === 'pgadmin') {
+ if (in_array($oneClickServiceName, NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK)) {
data_set($servicePayload, 'connect_to_docker_network', true);
}
$service = Service::create($servicePayload);
diff --git a/app/Livewire/Project/Resource/Create.php b/app/Livewire/Project/Resource/Create.php
index 1550fd632c..0f869daf72 100644
--- a/app/Livewire/Project/Resource/Create.php
+++ b/app/Livewire/Project/Resource/Create.php
@@ -81,7 +81,7 @@ class Create extends Component
'destination_id' => $destination->id,
'destination_type' => $destination->getMorphClass(),
];
- if ($oneClickServiceName === 'pgadmin' || $oneClickServiceName === 'postgresus') {
+ if (in_array($oneClickServiceName, NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK)) {
data_set($service_payload, 'connect_to_docker_network', true);
}
$service = Service::create($service_payload);
diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.php
index f588b6c00f..6d9136b027 100644
--- a/bootstrap/helpers/constants.php
+++ b/bootstrap/helpers/constants.php
@@ -67,4 +67,8 @@ const SUPPORTED_OS = [
'alpine',
];
+const NEEDS_TO_CONNECT_TO_PREDEFINED_NETWORK = [
+ 'pgadmin',
+ 'postgresus',
+];
const SHARED_VARIABLE_TYPES = ['team', 'project', 'environment'];