fix: public service database
This commit is contained in:
parent
9ad6ce5851
commit
7c580f898c
@ -25,7 +25,8 @@ class StartDatabaseProxy
|
|||||||
$proxyContainerName = "{$database->uuid}-proxy";
|
$proxyContainerName = "{$database->uuid}-proxy";
|
||||||
if ($database->getMorphClass() === 'App\Models\ServiceDatabase') {
|
if ($database->getMorphClass() === 'App\Models\ServiceDatabase') {
|
||||||
$databaseType = $database->databaseType();
|
$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');
|
$server = data_get($database, 'service.destination.server');
|
||||||
$proxyContainerName = "{$database->service->uuid}-proxy";
|
$proxyContainerName = "{$database->service->uuid}-proxy";
|
||||||
switch ($databaseType) {
|
switch ($databaseType) {
|
||||||
|
|||||||
@ -79,7 +79,6 @@ class Database extends Component
|
|||||||
public function submit()
|
public function submit()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ray('asdf');
|
|
||||||
$this->validate();
|
$this->validate();
|
||||||
$this->database->save();
|
$this->database->save();
|
||||||
updateCompose($this->database);
|
updateCompose($this->database);
|
||||||
|
|||||||
@ -57,8 +57,7 @@ class ServiceDatabase extends BaseModel
|
|||||||
if ($this->service->server->isLocalhost() || isDev()) {
|
if ($this->service->server->isLocalhost() || isDev()) {
|
||||||
$realIp = base_ip();
|
$realIp = base_ip();
|
||||||
}
|
}
|
||||||
$url = "{$realIp}:{$port}";
|
return "{$realIp}:{$port}";
|
||||||
return $url;
|
|
||||||
}
|
}
|
||||||
public function service()
|
public function service()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,8 @@ const DATABASE_DOCKER_IMAGES = [
|
|||||||
'couchdb',
|
'couchdb',
|
||||||
'neo4j',
|
'neo4j',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
'clickhouse/clickhouse-server'
|
'clickhouse/clickhouse-server',
|
||||||
|
'supabase/postgres'
|
||||||
];
|
];
|
||||||
const SPECIFIC_SERVICES = [
|
const SPECIFIC_SERVICES = [
|
||||||
'quay.io/minio/minio',
|
'quay.io/minio/minio',
|
||||||
|
|||||||
@ -206,13 +206,13 @@
|
|||||||
know what are
|
know what are
|
||||||
you doing.</div>
|
you doing.</div>
|
||||||
<x-forms.input
|
<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"
|
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" />
|
id="application.custom_docker_run_options" label="Custom Docker Options" />
|
||||||
@endif
|
@endif
|
||||||
@else
|
@else
|
||||||
<x-forms.input
|
<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"
|
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" />
|
id="application.custom_docker_run_options" label="Custom Docker Options" />
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@ -17,15 +17,16 @@
|
|||||||
label="Image Tag" id="database.image"></x-forms.input>
|
label="Image Tag" id="database.image"></x-forms.input>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-end gap-2">
|
<div class="flex items-end gap-2">
|
||||||
|
|
||||||
|
<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)
|
@if ($db_url_public)
|
||||||
<x-forms.input label="Database URL (public)"
|
<x-forms.input label="Database URL (public)"
|
||||||
helper="Your credentials are available in your environment variables." type="password" readonly
|
helper="Your credentials are available in your environment variables." type="password" readonly
|
||||||
wire:model="db_url_public" />
|
wire:model="db_url_public" />
|
||||||
@endif
|
@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>
|
|
||||||
</div>
|
</div>
|
||||||
<h3 class="pt-2">Advanced</h3>
|
<h3 class="pt-2">Advanced</h3>
|
||||||
<div class="w-96">
|
<div class="w-96">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user