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 branch 'main' into ui

Andras Bacsaif957008c1c02
diff --cc apps/api/src/lib/common.ts
index dbec9dafb7,cb2b10e170..05c55e1604
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@@ -38,16 -38,14 +38,14 @@@ export const defaultProxyImageHttp = `c
export const defaultTraefikImage = `traefik:v2.8`;
export function getAPIUrl() {
if (process.env.GITPOD_WORKSPACE_URL) {
- const { href } = new URL(process.env.GITPOD_WORKSPACE_URL)
- const newURL = href.replace('https://', 'https://3001-').replace(/\/$/, '')
- return newURL
+ const { href } = new URL(process.env.GITPOD_WORKSPACE_URL);
+ const newURL = href.replace('https://', 'https://3001-').replace(/\/$/, '');
+ return newURL;
}
if (process.env.CODESANDBOX_HOST) {
- return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`
+ return `https://${process.env.CODESANDBOX_HOST.replace(/\$PORT/, '3001')}`;
}
- return isDev
- ? 'http://localhost:3001'
- : 'http://localhost:3000';
+ return isDev ? 'http://host.docker.internal:3001' : 'http://localhost:3000';
}
export function getUIUrl() {
diff --cc apps/ui/src/routes/__layout.svelte
index 9ba0b1f8a9,e1a1b5a4da..e1d716b2de
--- a/apps/ui/src/routes/__layout.svelte
+++ b/apps/ui/src/routes/__layout.svelte
@@@ -120,210 -120,27 +120,212 @@@
<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 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>
+ {#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')}
+ >
+ <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
- class="no-underline"
- id="dashboard"
++ class="no-underline icons hover:text-white"
sveltekit:prefetch
href="/"
- class:bg-primary={$page.url.pathname === '/'}
- class="icons hover:text-white"
+ class:text-pink-500={$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"
@@@ -394,15 -218,17 +396,16 @@@
<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>
+ IAM
</a>
+ <Tooltip triggeredBy="#iam" placement="right" color="bg-iam">IAM</Tooltip>
-
+ </li>
+ <li>
<a
- id="settings"
- sveltekit:prefetch
+ class="no-underline"
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 === '/settings'}
- class:bg-coolgray-200={!($page.url.pathname === '/settings')}
+ class:bg-settings={$page.url.pathname.startsWith('/settings')}
+ class:text-black={$page.url.pathname.startsWith('/settings')}
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@@ -420,11 -246,12 +423,14 @@@
/>
<circle cx="12" cy="12" r="3" />
</svg>
+ Settings
</a>
- <Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black"
++ <Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black"
+ >Settings</Tooltip
+ >
-
- <div id="logout" class="icons bg-coolgray-200 hover:text-error" on:click={logout}>
+ </li>
+ <li>
+ <div class="no-underline hover:bg-error" on:click={logout}>
<svg
xmlns="http://www.w3.org/2000/svg"
class="ml-1 h-8 w-8"
@@@ -441,14 -268,29 +447,10 @@@
/>
<path d="M7 12h14l-3 -3m0 6l3 -3" />
</svg>
+ Logout
</div>
+ <Tooltip triggeredBy="#logout" placement="right" color="bg-red-600">Logout</Tooltip>
-
- <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:pl-20' : null}>
- <slot />
+ </li>
+ </ul>
</div>
-</main>
+</div>
-
- <Tooltip triggeredBy="#iam" placement="right" color="bg-iam">IAM</Tooltip>
- <Tooltip triggeredBy="#settings" placement="right" color="bg-settings text-black">Settings</Tooltip
- >
- <Tooltip triggeredBy="#logout" placement="right" color="bg-red-600">Logout</Tooltip>
diff --cc apps/ui/src/routes/applications/[id]/_Secret.svelte
index 60244426ae,a35b953a40..134e898923
--- a/apps/ui/src/routes/applications/[id]/_Secret.svelte
+++ b/apps/ui/src/routes/applications/[id]/_Secret.svelte
@@@ -109,9 -115,7 +116,8 @@@
name={isNewSecret ? 'secretValue' : 'secretValueNew'}
isPasswordField={true}
bind:value
- required
placeholder="J$#@UIO%HO#$U%H"
+ inputStyle="min-width: 350px; !important"
/>
</td>
<td class="text-center">
diff --cc apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
index 894eecfaa4,5cee0a49af..c2d8bd0f93
--- a/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
+++ b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte
@@@ -154,9 -160,16 +160,13 @@@
{/if}
</div>
{#if logs.length > 0}
- <div
- class="font-mono leading-6 text-left text-md tracking-tighter rounded bg-coolgray-200 py-5 px-6 whitespace-pre-wrap break-words overflow-auto max-h-[80vh] -mt-12 overflow-y-scroll scrollbar-w-1 scrollbar-thumb-coollabs scrollbar-track-coolgray-200"
- bind:this={logsEl}
- >
+ <div class="font-mono w-full rounder bg-coolgray-200 p-5 overflow-x-auto overflox-y-auto max-h-[80vh] rounded-md mb-20 flex flex-col whitespace-nowrap -mt-12 scrollbar-thumb-coollabs scrollbar-track-coolgray-200 scrollbar-w-1">
{#each logs as log}
- <p>{log.line + '\n'}</p>
+ {#if fromDb}
+ <div>{log.line + '\n'}</div>
+ {:else}
+ <div>[{day.unix(log.time).format('HH:mm:ss.SSS')}] {log.line + '\n'}</div>
+ {/if}
{/each}
</div>
{:else}
diff --cc apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
index 5237dc9842,fee1d80626..b6e5d51b23
--- a/apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
+++ b/apps/ui/src/routes/services/[id]/_Services/_PlausibleAnalytics.svelte
@@@ -27,13 -28,14 +29,15 @@@
required
/>
</div>
-<div class="grid grid-cols-2 items-center px-10">
- <label for="email">{$t('forms.email')}</label>
- <input
+<div class="grid grid-cols-2 items-center lg:px-10">
+ <label class="text-base font-bold text-stone-100" for="email">{$t('forms.email')}</label>
+ <input
+ class="w-full"
name="email"
id="email"
- disabled={readOnly}
+ disabled={!$appSession.isAdmin ||
+ $status.service.isRunning ||
+ $status.service.initialLoading}
readonly={readOnly}
placeholder={$t('forms.email')}
bind:value={service.plausibleAnalytics.email}