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.

feat: rollback coolify

Andras Bacsaibd4ce3ac458e
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
index a96e36e91d..dfdde81d23 100644
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@ -17,7 +17,7 @@ import { day } from './dayjs';
import { saveBuildLog } from './buildPacks/common';
import { scheduler } from './scheduler';
-export const version = '3.11.4';
+export const version = '3.11.5';
export const isDev = process.env.NODE_ENV === 'development';
const algorithm = 'aes-256-ctr';
diff --git a/apps/ui/src/lib/components/UpdateAvailable.svelte b/apps/ui/src/lib/components/UpdateAvailable.svelte
index 9c4fda2be8..5eeacab8b2 100644
--- a/apps/ui/src/lib/components/UpdateAvailable.svelte
+++ b/apps/ui/src/lib/components/UpdateAvailable.svelte
@@ -16,9 +16,11 @@
updateStatus.loading = true;
try {
if (dev) {
- await asyncSleep(4000);
+ localStorage.setItem('lastVersion', $appSession.version);
+ await asyncSleep(1000);
return window.location.reload();
} else {
+ localStorage.setItem('lastVersion', $appSession.version);
await post(`/update`, { type: 'update', latestVersion });
addToast({
message: 'Update completed.<br><br>Waiting for the new version to start...',
diff --git a/apps/ui/src/routes/settings/coolify.svelte b/apps/ui/src/routes/settings/coolify.svelte
index cf3c21ddb2..2c421751bc 100644
--- a/apps/ui/src/routes/settings/coolify.svelte
+++ b/apps/ui/src/routes/settings/coolify.svelte
@@ -24,6 +24,7 @@
import { addToast, appSession, features } from '$lib/store';
import { asyncSleep, errorNotification, getDomain } from '$lib/common';
import Explainer from '$lib/components/Explainer.svelte';
+ import { dev } from '$app/env';
let isAPIDebuggingEnabled = settings.isAPIDebuggingEnabled;
let isRegistrationEnabled = settings.isRegistrationEnabled;
@@ -47,7 +48,50 @@
proxyMigration: false,
restart: false
};
+ let rollbackVersion = localStorage.getItem('lastVersion');
+ async function rollback() {
+ const sure = confirm(`Are you sure you want rollback Coolify to ${rollbackVersion}?`);
+ if (sure) {
+ try {
+ if (dev) {
+ console.log('rolling back to', rollbackVersion);
+ await asyncSleep(4000);
+ return window.location.reload();
+ } else {
+ await post(`/update`, { type: 'update', latestVersion: rollbackVersion });
+ addToast({
+ message: 'Update completed.<br><br>Waiting for the new version to start...',
+ type: 'success'
+ });
+
+ let reachable = false;
+ let tries = 0;
+ do {
+ await asyncSleep(4000);
+ try {
+ await get(`/undead`);
+ reachable = true;
+ } catch (error) {
+ reachable = false;
+ }
+ if (reachable) break;
+ tries++;
+ } while (!reachable || tries < 120);
+ addToast({
+ message: 'New version reachable. Reloading...',
+ type: 'success'
+ });
+ await asyncSleep(3000);
+ return window.location.reload();
+ }
+ } catch (error) {
+ return errorNotification(error);
+ } finally {
+ loading.remove = false;
+ }
+ }
+ }
async function removeFqdn() {
if (fqdn) {
loading.remove = true;
@@ -281,6 +325,17 @@
</div>
{/if}
</div>
+ <div class="grid grid-cols-2 items-center">
+ <Setting
+ id="dualCerts"
+ dataTooltip={$t('setting.must_remove_domain_before_changing')}
+ disabled={isFqdnSet}
+ bind:setting={dualCerts}
+ title={$t('application.ssl_www_and_non_www')}
+ description={$t('setting.generate_www_non_www_ssl')}
+ on:click={() => !isFqdnSet && changeSettings('dualCerts')}
+ />
+ </div>
<div class="grid grid-cols-2 items-center">
<div>
Default Redirect URL
@@ -300,16 +355,24 @@
placeholder="{$t('forms.eg')}: https://coolify.io"
/>
</div>
- <div class="grid grid-cols-2 items-center">
- <Setting
- id="dualCerts"
- dataTooltip={$t('setting.must_remove_domain_before_changing')}
- disabled={isFqdnSet}
- bind:setting={dualCerts}
- title={$t('application.ssl_www_and_non_www')}
- description={$t('setting.generate_www_non_www_ssl')}
- on:click={() => !isFqdnSet && changeSettings('dualCerts')}
+
+ <div class="grid grid-cols-4 items-center">
+ <div class="col-span-2">
+ Rollback to a specific version
+ <Explainer
+ position="dropdown-bottom"
+ explanation="You can rollback to a specific version of your application. This will not affect your current running resources. <a href='https://github.com/coollabsio/coolify/releases' target='_blank'>See available versions</a>"
+ />
+ </div>
+ <input
+ class="w-full"
+ bind:value={rollbackVersion}
+ readonly={!$appSession.isAdmin}
+ disabled={!$appSession.isAdmin}
+ name="lastVersion"
+ id="lastVersion"
/>
+ <button class="btn btn-primary ml-2" on:click|preventDefault|stopPropagation={rollback}>Rollback</button>
</div>
<div class="grid grid-cols-2 items-center">
<div>
diff --git a/package.json b/package.json
index 9aff5bc8a2..97e2f6861a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "coolify",
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
- "version": "3.11.4",
+ "version": "3.11.5",
"license": "Apache-2.0",
"repository": "github:coollabsio/coolify",
"scripts": {