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.

fix: show ip address as host in public dbs

Andras Bacsai02ba277a86f9
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
index 322bb3bd8f..403d4fedb6 100644
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@ -15,11 +15,11 @@ import * as SSHConfig from 'ssh-config/src/ssh-config';
import jsonwebtoken from 'jsonwebtoken';
import { checkContainer, removeContainer } from './docker';
import { day } from './dayjs';
-import { saveBuildLog, saveDockerRegistryCredentials } from './buildPacks/common';
+import { saveBuildLog } from './buildPacks/common';
import { scheduler } from './scheduler';
import type { ExecaChildProcess } from 'execa';
-export const version = '3.12.26';
+export const version = '3.12.27';
export const isDev = process.env.NODE_ENV === 'development';
export const proxyPort = process.env.COOLIFY_PROXY_PORT;
export const proxySecurePort = process.env.COOLIFY_PROXY_SECURE_PORT;
diff --git a/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte b/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
index 02c98e1507..7e5f93c00c 100644
--- a/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
@@ -49,23 +49,23 @@
databaseDbUser = '';
}
}
- function generateUrl() {
- const ipAddress = () => {
- if ($status.database.isPublic) {
- if (database.destinationDocker.remoteEngine) {
- return database.destinationDocker.remoteIpAddress;
- }
- if ($appSession.ipv6) {
- return $appSession.ipv6;
- }
- if ($appSession.ipv4) {
- return $appSession.ipv4;
- }
- return '<Cannot determine public IP address>';
- } else {
- return database.id;
+ function ipAddress() {
+ if ($status.database.isPublic) {
+ if (database.destinationDocker.remoteEngine) {
+ return database.destinationDocker.remoteIpAddress;
}
- };
+ if ($appSession.ipv6) {
+ return $appSession.ipv6;
+ }
+ if ($appSession.ipv4) {
+ return $appSession.ipv4;
+ }
+ return '<Cannot determine public IP address>';
+ } else {
+ return database.id;
+ }
+ }
+ function generateUrl() {
const user = () => {
if (databaseDbUser) {
return databaseDbUser + ':';
@@ -183,16 +183,38 @@
class:cursor-pointer={!$status.database.isRunning}
/></a
>
- <label for="host">{$t('forms.host')}</label>
- <CopyPasswordField
- placeholder={$t('forms.generated_automatically_after_start')}
- isPasswordField={false}
- readonly
- disabled
- id="host"
- name="host"
- value={database.id}
- />
+ {#if $status.database.isPublic}
+ <label for="internalHost">Internal Host</label>
+ <CopyPasswordField
+ isPasswordField={false}
+ readonly
+ disabled
+ id="internalHost"
+ name="internalHost"
+ value={database.id}
+ />
+ <label for="host">Public Host</label>
+ <CopyPasswordField
+ placeholder={$t('forms.generated_automatically_after_start')}
+ isPasswordField={false}
+ readonly
+ disabled
+ id="host"
+ name="host"
+ value={loading.public ? 'Loading...' : ipAddress()}
+ />
+ {:else}
+ <label for="internalHost">Host</label>
+ <CopyPasswordField
+ isPasswordField={false}
+ readonly
+ disabled
+ id="internalHost"
+ name="internalHost"
+ value={database.id}
+ />
+ {/if}
+
<label for="publicPort">{$t('forms.port')}</label>
<CopyPasswordField
placeholder={$t('database.generated_automatically_after_set_to_public')}
diff --git a/package.json b/package.json
index e518e9dda3..40e105acbf 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
- "version": "3.12.26",
+ "version": "3.12.27",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {