fix: public service database

This commit is contained in:
Andras Bacsai 2024-03-25 12:13:43 +01:00
parent 9ad6ce5851
commit 7c580f898c
6 changed files with 13 additions and 12 deletions

View File

@ -25,7 +25,8 @@ public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|St
$proxyContainerName = "{$database->uuid}-proxy";
if ($database->getMorphClass() === 'App\Models\ServiceDatabase') {
$databaseType = $database->databaseType();
$network = data_get($database, 'service.destination.network');
// $connectPredefined = data_get($database, 'service.connect_to_docker_network');
$network = $database->service->uuid;
$server = data_get($database, 'service.destination.server');
$proxyContainerName = "{$database->service->uuid}-proxy";
switch ($databaseType) {

View File

@ -79,7 +79,6 @@ public function refreshFileStorages()
public function submit()
{
try {
ray('asdf');
$this->validate();
$this->database->save();
updateCompose($this->database);

View File

@ -57,8 +57,7 @@ public function getServiceDatabaseUrl()
if ($this->service->server->isLocalhost() || isDev()) {
$realIp = base_ip();
}
$url = "{$realIp}:{$port}";
return $url;
return "{$realIp}:{$port}";
}
public function service()
{

View File

@ -27,7 +27,8 @@
'couchdb',
'neo4j',
'influxdb',
'clickhouse/clickhouse-server'
'clickhouse/clickhouse-server',
'supabase/postgres'
];
const SPECIFIC_SERVICES = [
'quay.io/minio/minio',

View File

@ -206,13 +206,13 @@ class="underline" href="https://coolify.io/docs/docker/registry"
know what are
you doing.</div>
<x-forms.input
helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='dark:text-white underline' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"
helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"
placeholder="--cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k"
id="application.custom_docker_run_options" label="Custom Docker Options" />
@endif
@else
<x-forms.input
helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='dark:text-white underline' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"
helper="You can add custom docker run options that will be used when your container is started.<br>Note: Not all options are supported, as they could mess up Coolify's automation and could cause bad experience for users.<br><br>Check the <a class='underline dark:text-white' href='https://coolify.io/docs/custom-docker-options'>docs.</a>"
placeholder="--cap-add SYS_ADMIN --device=/dev/fuse --security-opt apparmor:unconfined --ulimit nofile=1024:1024 --tmpfs /run:rw,noexec,nosuid,size=65536k"
id="application.custom_docker_run_options" label="Custom Docker Options" />
@endif

View File

@ -17,15 +17,16 @@
label="Image Tag" id="database.image"></x-forms.input>
</div>
<div class="flex items-end gap-2">
@if ($db_url_public)
<x-forms.input label="Database URL (public)"
helper="Your credentials are available in your environment variables." type="password" readonly
wire:model="db_url_public" />
@endif
<x-forms.input placeholder="5432" disabled="{{ $database->is_public }}" id="database.public_port"
label="Public Port" />
<x-forms.checkbox instantSave id="database.is_public" label="Accessible over the internet" />
</div>
@if ($db_url_public)
<x-forms.input label="Database URL (public)"
helper="Your credentials are available in your environment variables." type="password" readonly
wire:model="db_url_public" />
@endif
</div>
<h3 class="pt-2">Advanced</h3>
<div class="w-96">