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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: settings db requests
Andras Bacsai9d7745cd9b33
diff --git a/apps/api/src/routes/api/v1/settings/handlers.ts b/apps/api/src/routes/api/v1/settings/handlers.tsindex ebd806cb72..f6364e91dc 100644--- a/apps/api/src/routes/api/v1/settings/handlers.ts+++ b/apps/api/src/routes/api/v1/settings/handlers.ts@@ -2,8 +2,8 @@ import { promises as dns } from 'dns';import { X509Certificate } from 'node:crypto';import type { FastifyReply, FastifyRequest } from 'fastify';-import { checkDomainsIsValidInDNS, decrypt, encrypt, errorHandler, getDomain, isDNSValid, isDomainConfigured, listSettings, prisma } from '../../../../lib/common';-import { CheckDNS, CheckDomain, DeleteDomain, DeleteSSHKey, OnlyIdInBody, SaveSettings, SaveSSHKey } from './types';+import { asyncExecShell, checkDomainsIsValidInDNS, decrypt, encrypt, errorHandler, isDNSValid, isDomainConfigured, listSettings, prisma } from '../../../../lib/common';+import { CheckDNS, CheckDomain, DeleteDomain, OnlyIdInBody, SaveSettings, SaveSSHKey } from './types';export async function listAllSettings(request: FastifyRequest) {@@ -17,7 +17,7 @@ export async function listAllSettings(request: FastifyRequest) {unencryptedKeys.push({ id: key.id, name: key.name, privateKey: decrypt(key.privateKey), createdAt: key.createdAt })}}- const certificates = await prisma.certificate.findMany({ where: { team: { every: { id: teamId } } } })+ const certificates = await prisma.certificate.findMany({ where: { team: { id: teamId } } })let cns = [];for (const certificate of certificates) {const x509 = new X509Certificate(certificate.cert);@@ -140,6 +140,7 @@ export async function deleteSSHKey(request: FastifyRequest<OnlyIdInBody>, reply:export async function deleteCertificates(request: FastifyRequest<OnlyIdInBody>, reply: FastifyReply) {try {const { id } = request.body;+ await asyncExecShell(`docker exec coolify-proxy sh -c 'rm -f /etc/traefik/acme/custom/${id}-key.pem /etc/traefik/acme/custom/${id}-cert.pem'`)await prisma.certificate.delete({ where: { id } })return reply.code(201).send()} catch ({ status, message }) {diff --git a/apps/api/src/routes/api/v1/settings/index.ts b/apps/api/src/routes/api/v1/settings/index.tsindex 2f5d5d4bcf..aa95558ad9 100644--- a/apps/api/src/routes/api/v1/settings/index.ts+++ b/apps/api/src/routes/api/v1/settings/index.ts@@ -2,8 +2,8 @@ import { FastifyPluginAsync } from 'fastify';import { X509Certificate } from 'node:crypto';import { encrypt, errorHandler, prisma } from '../../../../lib/common';-import { checkDNS, checkDomain, deleteCertificates, deleteDomain, deleteSSHKey, getCertificates, listAllSettings, saveSettings, saveSSHKey } from './handlers';-import { CheckDNS, CheckDomain, DeleteDomain, DeleteSSHKey, OnlyIdInBody, SaveSettings, SaveSSHKey } from './types';+import { checkDNS, checkDomain, deleteCertificates, deleteDomain, deleteSSHKey, listAllSettings, saveSettings, saveSSHKey } from './handlers';+import { CheckDNS, CheckDomain, DeleteDomain, OnlyIdInBody, SaveSettings, SaveSSHKey } from './types';const root: FastifyPluginAsync = async (fastify): Promise<void> => {