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.

Merge remote-tracking branch 'origin' into some-tweaks

Kaname02a336a25d0c
diff --cc apps/api/src/lib/common.ts
index 7f271d900d,50a8dd4db0..be203edba2
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@@ -538,36 -490,40 +538,40 @@@ export async function createRemoteEngin
User: remoteUser,
IdentityFile: sshKeyFile,
StrictHostKeyChecking: 'no'
- })
+ });
}
try {
- await fs.stat(`${homedir}/.ssh/`)
+ await fs.stat(`${homedir}/.ssh/`);
} catch (error) {
- await fs.mkdir(`${homedir}/.ssh/`)
+ await fs.mkdir(`${homedir}/.ssh/`);
}
- return await fs.writeFile(`${homedir}/.ssh/config`, sshConfig.stringify(config))
+ return await fs.writeFile(`${homedir}/.ssh/config`, sshConfig.stringify(config));
}
- export async function executeDockerCmd({
- debug,
- buildId,
- applicationId,
- dockerId,
- command
- }: {
- debug?: boolean;
- buildId?: string;
- applicationId?: string;
- dockerId: string;
- command: string;
- }): Promise<any> {
- let { remoteEngine, remoteIpAddress, engine } = await prisma.destinationDocker.findUnique({
- where: { id: dockerId }
- });
+ export async function executeSSHCmd({ dockerId, command }) {
+ const { execaCommand } = await import('execa')
+ let { remoteEngine, remoteIpAddress, engine, remoteUser } = await prisma.destinationDocker.findUnique({ where: { id: dockerId } })
+ if (remoteEngine) {
+ await createRemoteEngineConfiguration(dockerId)
+ engine = `ssh://${remoteIpAddress}`
+ } else {
+ engine = 'unix:///var/run/docker.sock'
+ }
+ if (process.env.CODESANDBOX_HOST) {
+ if (command.startsWith('docker compose')) {
+ command = command.replace(/docker compose/gi, 'docker-compose')
+ }
+ }
+ command = `ssh ${remoteIpAddress} ${command}`
+ return await execaCommand(command)
+ }
+ export async function executeDockerCmd({ debug, buildId, applicationId, dockerId, command }: { debug?: boolean, buildId?: string, applicationId?: string, dockerId: string, command: string }): Promise<any> {
+ const { execaCommand } = await import('execa')
+ let { remoteEngine, remoteIpAddress, engine, remoteUser } = await prisma.destinationDocker.findUnique({ where: { id: dockerId } })
if (remoteEngine) {
- await createRemoteEngineConfiguration(dockerId)
- engine = `ssh://${remoteIpAddress}`
+ await createRemoteEngineConfiguration(dockerId);
+ engine = `ssh://${remoteIpAddress}`;
} else {
- engine = 'unix:///var/run/docker.sock'
+ engine = 'unix:///var/run/docker.sock';
}
if (process.env.CODESANDBOX_HOST) {
if (command.startsWith('docker compose')) {
@@@ -577,11 -533,10 +581,11 @@@
if (command.startsWith(`docker build --progress plain`)) {
return await asyncExecShellStream({ debug, buildId, applicationId, command, engine });
}
- return await asyncExecShell(`DOCKER_BUILDKIT=1 DOCKER_HOST="${engine}" ${command}`);
+ return await execaCommand(command, { env: { DOCKER_BUILDKIT: "1", DOCKER_HOST: engine }, shell: true })
}
export async function startTraefikProxy(id: string): Promise<void> {
- const { engine, network, remoteEngine, remoteIpAddress } = await prisma.destinationDocker.findUnique({ where: { id } })
+ const { engine, network, remoteEngine, remoteIpAddress } =
+ await prisma.destinationDocker.findUnique({ where: { id } });
const found = await checkContainer({ dockerId: id, container: 'coolify-proxy', remove: true });
const { id: settingsId, ipv4, ipv6 } = await listSettings();
@@@ -899,10 -841,11 +902,11 @@@ export function generateDatabaseConfigu
POSTGRES_PASSWORD: dbUserPassword,
POSTGRES_USER: dbUser,
POSTGRES_DB: defaultDatabase
- }
+ };
}
- return configuration
+ return configuration;
} else if (type === 'redis') {
+ const { settings: { appendOnly } } = database;
const configuration: DatabaseConfiguration = {
privatePort: 6379,
command: undefined,
@@@ -1182,64 -1129,76 +1186,76 @@@ export async function updatePasswordInD
}
}
}
- export async function checkExposedPort({
- id,
- configuredPort,
- exposePort,
- dockerId,
- remoteIpAddress
- }: {
- id: string;
- configuredPort?: number;
- exposePort: number;
- dockerId: string;
- remoteIpAddress?: string;
- }) {
+ export async function checkExposedPort({ id, configuredPort, exposePort, engine, remoteEngine, remoteIpAddress }: { id: string, configuredPort?: number, exposePort: number, engine: string, remoteEngine: boolean, remoteIpAddress?: string }) {
if (exposePort < 1024 || exposePort > 65535) {
- throw { status: 500, message: `Exposed Port needs to be between 1024 and 65535.` }
+ throw { status: 500, message: `Exposed Port needs to be between 1024 and 65535.` };
}
if (configuredPort) {
if (configuredPort !== exposePort) {
- const availablePort = await getFreeExposedPort(id, exposePort, dockerId, remoteIpAddress);
+ const availablePort = await getFreeExposedPort(id, exposePort, engine, remoteEngine, remoteIpAddress);
if (availablePort.toString() !== exposePort.toString()) {
- throw { status: 500, message: `Port ${exposePort} is already in use.` }
+ throw { status: 500, message: `Port ${exposePort} is already in use.` };
}
}
} else {
- const availablePort = await getFreeExposedPort(id, exposePort, dockerId, remoteIpAddress);
+ const availablePort = await getFreeExposedPort(id, exposePort, engine, remoteEngine, remoteIpAddress);
if (availablePort.toString() !== exposePort.toString()) {
- throw { status: 500, message: `Port ${exposePort} is already in use.` }
+ throw { status: 500, message: `Port ${exposePort} is already in use.` };
}
}
}
- export async function getFreeExposedPort(id, exposePort, dockerId, remoteIpAddress) {
+ export async function getFreeExposedPort(id, exposePort, engine, remoteEngine, remoteIpAddress) {
const { default: checkPort } = await import('is-port-reachable');
- const applicationUsed = await (
- await prisma.application.findMany({
- where: { exposePort: { not: null }, id: { not: id }, destinationDockerId: dockerId },
- select: { exposePort: true }
- })
- ).map((a) => a.exposePort);
- const serviceUsed = await (
- await prisma.service.findMany({
- where: { exposePort: { not: null }, id: { not: id }, destinationDockerId: dockerId },
- select: { exposePort: true }
- })
- ).map((a) => a.exposePort);
- const usedPorts = [...applicationUsed, ...serviceUsed];
- if (usedPorts.includes(exposePort)) {
- return false;
- }
- const found = await checkPort(exposePort, { host: remoteIpAddress || 'localhost' });
- if (!found) {
- return exposePort;
+ if (remoteEngine) {
+ const applicationUsed = await (
+ await prisma.application.findMany({
+ where: { exposePort: { not: null }, id: { not: id }, destinationDocker: { remoteIpAddress } },
+ select: { exposePort: true }
+ })
+ ).map((a) => a.exposePort);
+ const serviceUsed = await (
+ await prisma.service.findMany({
+ where: { exposePort: { not: null }, id: { not: id }, destinationDocker: { remoteIpAddress } },
+ select: { exposePort: true }
+ })
+ ).map((a) => a.exposePort);
+ const usedPorts = [...applicationUsed, ...serviceUsed];
+ if (usedPorts.includes(exposePort)) {
+ return false
+ }
+ const found = await checkPort(exposePort, { host: remoteIpAddress });
+ if (!found) {
+ return exposePort
+ }
+ return false
+ } else {
+ const applicationUsed = await (
+ await prisma.application.findMany({
+ where: { exposePort: { not: null }, id: { not: id }, destinationDocker: { engine } },
+ select: { exposePort: true }
+ })
+ ).map((a) => a.exposePort);
+ const serviceUsed = await (
+ await prisma.service.findMany({
+ where: { exposePort: { not: null }, id: { not: id }, destinationDocker: { engine } },
+ select: { exposePort: true }
+ })
+ ).map((a) => a.exposePort);
+ const usedPorts = [...applicationUsed, ...serviceUsed];
+ if (usedPorts.includes(exposePort)) {
+ return false
+ }
+ const found = await checkPort(exposePort, { host: 'localhost' });
+ if (!found) {
+ return exposePort
+ }
+ return false
}
- return false;
}
export function generateRangeArray(start, end) {
- return Array.from({ length: (end - start) }, (v, k) => k + start);
+ return Array.from({ length: end - start }, (v, k) => k + start);
}
- export async function getFreePublicPort(id, dockerId) {
+ export async function getFreePublicPort({ id, remoteEngine, engine, remoteIpAddress }) {
const { default: isReachable } = await import('is-port-reachable');
const data = await prisma.setting.findFirst();
const { minPort, maxPort } = data;
diff --cc apps/ui/src/routes/__layout.svelte
index 10a6b1de4f,8694dfe45d..2084743bea
--- a/apps/ui/src/routes/__layout.svelte
+++ b/apps/ui/src/routes/__layout.svelte
@@@ -120,329 -120,27 +120,210 @@@
<PageLoader />
</div>
{/if}
-{#if $appSession.userId}
- <nav class="nav-main">
- <div class="flex h-screen w-full flex-col items-center transition-all duration-100">
- {#if !$appSession.whiteLabeled}
- <div class="mb-2 mt-4 h-10 w-10">
- <img src="/favicon.png" alt="coolLabs logo" />
- </div>
- {:else if $appSession.whiteLabeledDetails.icon}
- <div class="mb-2 mt-4 h-10 w-10">
- <img src={$appSession.whiteLabeledDetails.icon} alt="White labeled logo" />
+<div class="drawer">
+ <input id="main-drawer" type="checkbox" class="drawer-toggle" />
+ <div class="drawer-content">
+ {#if $appSession.userId}
+ <nav class="nav-main hidden lg:block z-20">
+ <div class="flex h-screen w-full flex-col items-center transition-all duration-100">
+ {#if !$appSession.whiteLabeled}
+ <div class="mb-2 mt-4 h-10 w-10">
+ <img src="/favicon.png" alt="coolLabs logo" />
+ </div>
+ {:else if $appSession.whiteLabeledDetails.icon}
+ <div class="mb-2 mt-4 h-10 w-10">
+ <img src={$appSession.whiteLabeledDetails.icon} alt="White labeled logo" />
+ </div>
+ {/if}
+ <div class="flex flex-col space-y-2 py-2" class:mt-2={$appSession.whiteLabeled}>
+ <a
+ id="dashboard"
+ sveltekit:prefetch
+ href="/"
- class="icons bg-coolgray-200 hover:text-white"
++ class="icons hover:text-white"
+ class:text-white={$page.url.pathname === '/'}
+ class:bg-coolgray-500={$page.url.pathname === '/'}
++ class:bg-coolgray-200={!($page.url.pathname === '/')}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="h-9 w-9"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M19 8.71l-5.333 -4.148a2.666 2.666 0 0 0 -3.274 0l-5.334 4.148a2.665 2.665 0 0 0 -1.029 2.105v7.2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-7.2c0 -.823 -.38 -1.6 -1.03 -2.105"
+ />
+ <path d="M16 15c-2.21 1.333 -5.792 1.333 -8 0" />
+ </svg>
+ </a>
-
- <div class="border-t border-stone-700" />
- <a
- id="applications"
- sveltekit:prefetch
- href="/applications"
- class="icons bg-coolgray-200"
- class:text-applications={$page.url.pathname.startsWith('/applications') ||
- $page.url.pathname.startsWith('/new/application')}
- class:bg-coolgray-500={$page.url.pathname.startsWith('/applications') ||
- $page.url.pathname.startsWith('/new/application')}
- data-tip="Applications"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-9"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentcolor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <rect x="4" y="4" width="6" height="6" rx="1" />
- <rect x="4" y="14" width="6" height="6" rx="1" />
- <rect x="14" y="14" width="6" height="6" rx="1" />
- <line x1="14" y1="7" x2="20" y2="7" />
- <line x1="17" y1="4" x2="17" y2="10" />
- </svg>
- </a>
-
- <a
- id="sources"
- sveltekit:prefetch
- href="/sources"
- class="icons bg-coolgray-200"
- class:text-sources={$page.url.pathname.startsWith('/sources') ||
- $page.url.pathname.startsWith('/new/source')}
- class:bg-coolgray-500={$page.url.pathname.startsWith('/sources') ||
- $page.url.pathname.startsWith('/new/source')}
- data-tip="Git Sources"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-9"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <circle cx="6" cy="6" r="2" />
- <circle cx="18" cy="18" r="2" />
- <path d="M11 6h5a2 2 0 0 1 2 2v8" />
- <polyline points="14 9 11 6 14 3" />
- <path d="M13 18h-5a2 2 0 0 1 -2 -2v-8" />
- <polyline points="10 15 13 18 10 21" />
- </svg>
- </a>
- <a
- id="destinations"
- sveltekit:prefetch
- href="/destinations"
- class="icons bg-coolgray-200"
- class:text-destinations={$page.url.pathname.startsWith('/destinations') ||
- $page.url.pathname.startsWith('/new/destination')}
- class:bg-coolgray-500={$page.url.pathname.startsWith('/destinations') ||
- $page.url.pathname.startsWith('/new/destination')}
- data-tip="Destinations"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-9"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path
- d="M22 12.54c-1.804 -.345 -2.701 -1.08 -3.523 -2.94c-.487 .696 -1.102 1.568 -.92 2.4c.028 .238 -.32 1.002 -.557 1h-14c0 5.208 3.164 7 6.196 7c4.124 .022 7.828 -1.376 9.854 -5c1.146 -.101 2.296 -1.505 2.95 -2.46z"
- />
- <path d="M5 10h3v3h-3z" />
- <path d="M8 10h3v3h-3z" />
- <path d="M11 10h3v3h-3z" />
- <path d="M8 7h3v3h-3z" />
- <path d="M11 7h3v3h-3z" />
- <path d="M11 4h3v3h-3z" />
- <path d="M4.571 18c1.5 0 2.047 -.074 2.958 -.78" />
- <line x1="10" y1="16" x2="10" y2="16.01" />
- </svg>
- </a>
- <div class="border-t border-stone-700" />
- <a
- id="databases"
- sveltekit:prefetch
- href="/databases"
- class="icons bg-coolgray-200"
- class:text-databases={$page.url.pathname.startsWith('/databases') ||
- $page.url.pathname.startsWith('/new/database')}
- class:bg-coolgray-500={$page.url.pathname.startsWith('/databases') ||
- $page.url.pathname.startsWith('/new/database')}
- data-tip="Databases"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-9"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <ellipse cx="12" cy="6" rx="8" ry="3" />
- <path d="M4 6v6a8 3 0 0 0 16 0v-6" />
- <path d="M4 12v6a8 3 0 0 0 16 0v-6" />
- </svg>
- </a>
- <a
- id="services"
- sveltekit:prefetch
- href="/services"
- class="icons bg-coolgray-200"
- class:text-services={$page.url.pathname.startsWith('/services') ||
- $page.url.pathname.startsWith('/new/service')}
- class:bg-coolgray-500={$page.url.pathname.startsWith('/services') ||
- $page.url.pathname.startsWith('/new/service')}
- data-tip="Services"
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- class="h-9 w-9"
- viewBox="0 0 24 24"
- stroke-width="1.5"
- stroke="currentColor"
- fill="none"
- stroke-linecap="round"
- stroke-linejoin="round"
++ {#if $appSession.teamId === '0'}
++ <a
++ id="servers"
++ sveltekit:prefetch
++ href="/servers"
++ class="icons hover:text-white"
++ class:text-white={$page.url.pathname === '/servers'}
++ class:bg-coolgray-500={$page.url.pathname === '/servers'}
++ class:bg-coolgray-200={!($page.url.pathname === '/servers')}
+ >
- <path stroke="none" d="M0 0h24v24H0z" fill="none" />
- <path d="M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-12" />
- </svg>
- </a>
++ <svg
++ xmlns="http://www.w3.org/2000/svg"
++ class="w-8 h-8 mx-auto"
++ viewBox="0 0 24 24"
++ stroke-width="1.5"
++ stroke="currentColor"
++ fill="none"
++ stroke-linecap="round"
++ stroke-linejoin="round"
++ >
++ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
++ <rect x="3" y="4" width="18" height="8" rx="3" />
++ <rect x="3" y="12" width="18" height="8" rx="3" />
++ <line x1="7" y1="8" x2="7" y2="8.01" />
++ <line x1="7" y1="16" x2="7" y2="16.01" />
++ </svg>
++ </a>
++ {/if}
+ </div>
++ <Tooltip triggeredBy="#dashboard" placement="right">Dashboard</Tooltip>
++ <Tooltip triggeredBy="#servers" placement="right">Servers</Tooltip>
+ <div class="flex-1" />
+
+ <UpdateAvailable />
+ <div class="flex flex-col space-y-2 py-2">
+ <a
+ id="iam"
+ sveltekit:prefetch
+ href="/iam"
+ class="icons bg-coolgray-200"
+ class:text-iam={$page.url.pathname.startsWith('/iam')}
+ class:bg-coolgray-500={$page.url.pathname.startsWith('/iam')}
+ ><svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ class="h-9 w-9"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <circle cx="9" cy="7" r="4" />
+ <path d="M3 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2" />
+ <path d="M16 3.13a4 4 0 0 1 0 7.75" />
+ <path d="M21 21v-2a4 4 0 0 0 -3 -3.85" />
+ </svg>
+ </a>
+ <a
+ id="settings"
+ sveltekit:prefetch
+ href={$appSession.teamId === '0' ? '/settings/global' : '/settings/ssh-keys'}
+ class="icons bg-coolgray-200"
+ class:text-settings={$page.url.pathname.startsWith('/settings')}
+ class:bg-coolgray-500={$page.url.pathname.startsWith('/settings')}
+ >
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 24 24"
+ class="h-9 w-9"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"
+ />
+ <circle cx="12" cy="12" r="3" />
+ </svg>
+ </a>
+
+ <div id="logout" class="icons bg-coolgray-200 hover:text-error" on:click={logout}>
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ class="ml-1 h-8 w-8"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ fill="none"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ >
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
+ <path
+ d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"
+ />
+ <path d="M7 12h14l-3 -3m0 6l3 -3" />
+ </svg>
+ </div>
+ <div
+ class="w-full text-center font-bold text-stone-400 hover:bg-coolgray-200 hover:text-white"
+ >
+ <a
+ class="text-[10px] no-underline"
+ href={`https://github.com/coollabsio/coolify/releases/tag/v${$appSession.version}`}
+ target="_blank">v{$appSession.version}</a
+ >
+ </div>
+ </div>
</div>
+ </nav>
+ {#if $appSession.whiteLabeled}
+ <span class="fixed bottom-0 left-[50px] z-50 m-2 px-4 text-xs text-stone-700"
+ >Powered by <a href="https://coolify.io" target="_blank">Coolify</a></span
+ >
{/if}
- <div class="flex flex-col space-y-2 py-2" class:mt-2={$appSession.whiteLabeled}>
+ {/if}
+ <div
+ class="navbar bg-neutral-focus lg:hidden space-x-2 flex flex-row items-center"
+ class:hidden={!$appSession.userId}
+ >
+ <label for="main-drawer" class="drawer-button btn btn-square btn-ghost">
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ class="inline-block w-5 h-5 stroke-current"
+ ><path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ d="M4 6h16M4 12h16M4 18h16"
+ /></svg
+ >
+ </label>
+ <div class="prose flex flex-row justify-between space-x-1 w-full items-center pr-3">
+ <h3 class="mb-0">Coolify</h3>
+ <UpdateAvailable />
+ </div>
+ </div>
+ <main>
+ <div class={$appSession.userId ? 'lg:pl-16' : null}>
+ <slot />
+ </div>
+ </main>
+ </div>
+ <div class="drawer-side">
+ <label for="main-drawer" class="drawer-overlay w-full" />
+ <ul class="menu bg-base-100 w-80 p-2 rounded-r-lg space-y-3">
+ <li class="menu-title">
+ <span>Main</span>
+ </li>
+ <li>
<a
- id="dashboard"
+ class="no-underline"
sveltekit:prefetch
href="/"
- class="icons hover:text-white"
- class:text-white={$page.url.pathname === '/'}
- class:bg-coolgray-500={$page.url.pathname === '/'}
- class:bg-coolgray-200={!($page.url.pathname === '/')}
+ class:bg-primary={$page.url.pathname === '/'}
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@@ -677,21 -263,31 +558,13 @@@
/>
<path d="M7 12h14l-3 -3m0 6l3 -3" />
</svg>
+ Logout
</div>
- <div
- class="w-full text-center font-bold text-stone-400 hover:bg-coolgray-200 hover:text-white"
- >
- <a
- class="text-[10px] no-underline"
- href={`https://github.com/coollabsio/coolify/releases/tag/v${$appSession.version}`}
- target="_blank">v{$appSession.version}</a
- >
- </div>
- </div>
- </div>
- </nav>
- {#if $appSession.whiteLabeled}
- <span class="fixed bottom-0 left-[50px] z-50 m-2 px-4 text-xs text-stone-700"
- >Powered by <a href="https://coolify.io" target="_blank">Coolify</a></span
- >
- {/if}
-{/if}
-<main>
- <div class={$appSession.userId ? 'pl-14 lg:px-20' : null}>
- <slot />
+ </li>
+ </ul>
</div>
-</main>
+</div>
- <Tooltip triggeredBy="#dashboard" placement="right">Dashboard</Tooltip>
- <Tooltip triggeredBy="#applications" placement="right" color="bg-applications">Applications</Tooltip
- >
- <Tooltip triggeredBy="#sources" placement="right" color="bg-sources">Git Sources</Tooltip>
- <Tooltip triggeredBy="#destinations" placement="right" color="bg-destinations">Destinations</Tooltip
- >
- <Tooltip triggeredBy="#databases" placement="right" color="bg-databases">Databases</Tooltip>
- <Tooltip triggeredBy="#services" placement="right" color="bg-services">Services</Tooltip>
<Tooltip triggeredBy="#iam" placement="right" color="bg-iam">IAM</Tooltip>
<Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black">Settings</Tooltip
>
diff --cc apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
index 826ac08214,14a88b00b3..95bf9b012f
--- a/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
+++ b/apps/ui/src/routes/databases/[id]/_Databases/_Databases.svelte
@@@ -222,27 -235,31 +221,27 @@@
</div>
</form>
<div class="flex space-x-1 pb-5 font-bold">
- <div class="title">{$t('application.features')}</div>
+ <h1 class="title">{$t('application.features')}</h1>
</div>
- <div class="px-10 pb-10">
- <div class="grid grid-cols-2 items-center">
+ <div class="grid gap-4 grid-cols-2 auto-rows-max lg:px-10">
+ <Setting
+ id="isPublic"
+ loading={publicLoading}
- bind:setting={isPublic}
++ bind:setting={$status.database.isPublic}
+ on:click={() => changeSettings('isPublic')}
+ title={$t('database.set_public')}
+ description={$t('database.warning_database_public')}
+ disabled={!$status.database.isRunning}
+ />
+ {#if database.type === 'redis'}
<Setting
- id="isPublic"
+ id="appendOnly"
loading={publicLoading}
- bind:setting={$status.database.isPublic}
- on:click={() => changeSettings('isPublic')}
- title={$t('database.set_public')}
- description={$t('database.warning_database_public')}
- disabled={!$status.database.isRunning}
+ bind:setting={appendOnly}
+ on:click={() => changeSettings('appendOnly')}
+ title={$t('database.change_append_only_mode')}
+ description={$t('database.warning_append_only')}
/>
- </div>
- {#if database.type === 'redis'}
- <div class="grid grid-cols-2 items-center">
- <Setting
- id="appendOnly"
- loading={publicLoading}
- bind:setting={appendOnly}
- on:click={() => changeSettings('appendOnly')}
- title={$t('database.change_append_only_mode')}
- description={$t('database.warning_append_only')}
- />
- </div>
{/if}
</div>
</div>
diff --cc apps/ui/src/routes/databases/[id]/__layout.svelte
index 5699295164,034e2c0a98..b3f9c17742
--- a/apps/ui/src/routes/databases/[id]/__layout.svelte
+++ b/apps/ui/src/routes/databases/[id]/__layout.svelte
@@@ -62,9 -62,9 +62,10 @@@
import DeleteIcon from '$lib/components/DeleteIcon.svelte';
import { onDestroy, onMount } from 'svelte';
import Tooltip from '$lib/components/Tooltip.svelte';
+import DatabaseLinks from './_DatabaseLinks.svelte';
const { id } = $page.params;
+ $status.database.isPublic = database.settings.isPublic || false;
let statusInterval: any = false;
let forceDelete = false;