diff --git a/apps/remix/app/routes/api+/health.ts b/apps/remix/app/routes/api+/health.ts index 1ebdfbadb..c43ac1478 100644 --- a/apps/remix/app/routes/api+/health.ts +++ b/apps/remix/app/routes/api+/health.ts @@ -23,10 +23,12 @@ export const loader = async () => { try { const certStatus = getCertificateStatus(); + if (certStatus.isAvailable) { checks.certificate = { status: 'ok' }; } else { checks.certificate = { status: 'warning' }; + if (overallStatus === 'ok') { overallStatus = 'warning'; } diff --git a/apps/remix/package.json b/apps/remix/package.json index a97fff5f3..c902bd18a 100644 --- a/apps/remix/package.json +++ b/apps/remix/package.json @@ -101,5 +101,5 @@ "vite-plugin-babel-macros": "^1.0.6", "vite-tsconfig-paths": "^5.1.4" }, - "version": "1.12.2-rc.6" + "version": "1.12.4" } diff --git a/package-lock.json b/package-lock.json index 647e4c43c..b5fbc09c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@documenso/root", - "version": "1.12.2-rc.6", + "version": "1.12.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@documenso/root", - "version": "1.12.2-rc.6", + "version": "1.12.4", "workspaces": [ "apps/*", "packages/*" @@ -89,7 +89,7 @@ }, "apps/remix": { "name": "@documenso/remix", - "version": "1.12.2-rc.6", + "version": "1.12.4", "dependencies": { "@documenso/api": "*", "@documenso/assets": "*", diff --git a/package.json b/package.json index 9e6654c0e..f976fcda0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "1.12.2-rc.6", + "version": "1.12.4", "scripts": { "build": "turbo run build", "dev": "turbo run dev --filter=@documenso/remix", diff --git a/packages/lib/server-only/cert/cert-status.ts b/packages/lib/server-only/cert/cert-status.ts index cf5387dcd..ad0e336bd 100644 --- a/packages/lib/server-only/cert/cert-status.ts +++ b/packages/lib/server-only/cert/cert-status.ts @@ -2,18 +2,25 @@ import * as fs from 'node:fs'; import { env } from '@documenso/lib/utils/env'; -export type CertificateStatus = { - isAvailable: boolean; -}; +export const getCertificateStatus = () => { + if (env('NEXT_PRIVATE_SIGNING_TRANSPORT') !== 'local') { + return { isAvailable: true }; + } + + if (env('NEXT_PRIVATE_SIGNING_LOCAL_FILE_CONTENTS')) { + return { isAvailable: true }; + } -export const getCertificateStatus = (): CertificateStatus => { const defaultPath = env('NODE_ENV') === 'production' ? '/opt/documenso/cert.p12' : './example/cert.p12'; + const filePath = env('NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH') || defaultPath; try { fs.accessSync(filePath, fs.constants.F_OK | fs.constants.R_OK); + const stats = fs.statSync(filePath); + return { isAvailable: stats.size > 0 }; } catch { return { isAvailable: false };