diff --git a/package.json b/package.json index 1cffb1afb..7c28949bd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "2.6.0", + "version": "2.6.1", "license": "AGPL-3.0", "scripts": { "dev": "docker-compose -f docker-compose-dev.yaml up -d && cross-env NODE_ENV=development & svelte-kit dev --host 0.0.0.0", diff --git a/src/routes/update.json.ts b/src/routes/update.json.ts index 42f4dd6ee..19845b90e 100644 --- a/src/routes/update.json.ts +++ b/src/routes/update.json.ts @@ -2,6 +2,7 @@ import { dev } from '$app/env'; import { asyncExecShell, version } from '$lib/common'; import { asyncSleep } from '$lib/components/common'; import { ErrorHandler } from '$lib/database'; +import * as db from '$lib/database'; import type { RequestHandler } from '@sveltejs/kit'; import compare from 'compare-versions'; import got from 'got'; @@ -36,8 +37,12 @@ export const post: RequestHandler = async (event) => { if (type === 'update') { try { if (!dev) { + const { isAutoUpdateEnabled } = await db.prisma.setting.findFirst(); await asyncExecShell(`docker pull coollabsio/coolify:${latestVersion}`); await asyncExecShell(`env | grep COOLIFY > .env`); + await asyncExecShell( + `sed -i '/COOLIFY_AUTO_UPDATE=/c\COOLIFY_AUTO_UPDATE=${isAutoUpdateEnabled}' .env` + ); await asyncExecShell( `docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify coolify-redis && docker rm coolify coolify-redis && docker compose up -d --force-recreate"` );