From 4cf907c572832dd996fa371b7a80a69e4328aff9 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 27 Feb 2022 12:17:40 +0100 Subject: [PATCH 1/4] fix: do not remove coolify proxy --- src/lib/haproxy/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/haproxy/index.ts b/src/lib/haproxy/index.ts index 09d7badd7..0d1d14fd2 100644 --- a/src/lib/haproxy/index.ts +++ b/src/lib/haproxy/index.ts @@ -199,6 +199,13 @@ export async function checkProxyConfigurations() { backend_name: backendName, stats: { lastchg } } = stat; + const { fqdn } = await db.listSettings(); + if (fqdn) { + const domain = getDomain(fqdn); + if (backendName === domain) { + return; + } + } const application = await db.getApplicationById(name); if (!application) { const transactionId = await getNextTransactionId(); From 6c32f3b130677d1bfd381ea8cabc74e9831926fa Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 27 Feb 2022 12:22:04 +0100 Subject: [PATCH 2/4] fix: update version --- src/routes/__layout.svelte | 2 +- src/routes/update.json.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index eee6acc52..71d30b09f 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -62,7 +62,7 @@ if (overrideVersion || data?.isUpdateAvailable) { latestVersion = overrideVersion || data.latestVersion; isUpdateAvailable = overrideVersion ? true : data?.isUpdateAvailable; - await post(`/update.json`, { type: 'pull', latestVersion, overrideVersion }); + await post(`/update.json`, { type: 'pull', latestVersion }); } } catch (error) {} } diff --git a/src/routes/update.json.ts b/src/routes/update.json.ts index 68b3857d6..1cfdc5f50 100644 --- a/src/routes/update.json.ts +++ b/src/routes/update.json.ts @@ -26,12 +26,10 @@ export const get: RequestHandler = async () => { }; export const post: RequestHandler = async (event) => { - const { type, latestVersion, overrideVersion = false } = await event.request.json(); + const { type, latestVersion } = await event.request.json(); if (type === 'pull') { try { if (!dev) { - if (!overrideVersion) - await asyncExecShell(`docker image inspect coollabsio/coolify:${latestVersion}`); await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`); return { status: 200, From a414ce282d5bc06cad5091de7ed6b7238600e594 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 27 Feb 2022 12:31:39 +0100 Subject: [PATCH 3/4] revert old update sequence --- src/routes/__layout.svelte | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 71d30b09f..f6851cc22 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -39,10 +39,12 @@ import { asyncSleep } from '$lib/components/common'; import { del, get, post } from '$lib/api'; import { browser } from '$app/env'; + import { fade } from 'svelte/transition'; let isUpdateAvailable = false; let updateStatus = { loading: false, + checking: false, success: null }; let latestVersion = 'latest'; @@ -58,13 +60,17 @@ } if ($session.teamId === '0') { try { + updateStatus.checking = true; const data = await get(`/update.json`); if (overrideVersion || data?.isUpdateAvailable) { latestVersion = overrideVersion || data.latestVersion; isUpdateAvailable = overrideVersion ? true : data?.isUpdateAvailable; await post(`/update.json`, { type: 'pull', latestVersion }); } - } catch (error) {} + } catch (error) { + } finally { + updateStatus; + } } } }); @@ -305,7 +311,32 @@
{#if $session.teamId === '0'} - {#if isUpdateAvailable} + {#if updateStatus.checking} + + {:else if isUpdateAvailable}