mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
Merge branch 'main' of github.com:documenso/documenso
This commit is contained in:
@ -23,10 +23,12 @@ export const loader = async () => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const certStatus = getCertificateStatus();
|
const certStatus = getCertificateStatus();
|
||||||
|
|
||||||
if (certStatus.isAvailable) {
|
if (certStatus.isAvailable) {
|
||||||
checks.certificate = { status: 'ok' };
|
checks.certificate = { status: 'ok' };
|
||||||
} else {
|
} else {
|
||||||
checks.certificate = { status: 'warning' };
|
checks.certificate = { status: 'warning' };
|
||||||
|
|
||||||
if (overallStatus === 'ok') {
|
if (overallStatus === 'ok') {
|
||||||
overallStatus = 'warning';
|
overallStatus = 'warning';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,5 +101,5 @@
|
|||||||
"vite-plugin-babel-macros": "^1.0.6",
|
"vite-plugin-babel-macros": "^1.0.6",
|
||||||
"vite-tsconfig-paths": "^5.1.4"
|
"vite-tsconfig-paths": "^5.1.4"
|
||||||
},
|
},
|
||||||
"version": "1.12.2-rc.6"
|
"version": "1.12.4"
|
||||||
}
|
}
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "1.12.2-rc.6",
|
"version": "1.12.4",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@documenso/root",
|
"name": "@documenso/root",
|
||||||
"version": "1.12.2-rc.6",
|
"version": "1.12.4",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*",
|
"apps/*",
|
||||||
"packages/*"
|
"packages/*"
|
||||||
@ -89,7 +89,7 @@
|
|||||||
},
|
},
|
||||||
"apps/remix": {
|
"apps/remix": {
|
||||||
"name": "@documenso/remix",
|
"name": "@documenso/remix",
|
||||||
"version": "1.12.2-rc.6",
|
"version": "1.12.4",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@documenso/api": "*",
|
"@documenso/api": "*",
|
||||||
"@documenso/assets": "*",
|
"@documenso/assets": "*",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.12.2-rc.6",
|
"version": "1.12.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"dev": "turbo run dev --filter=@documenso/remix",
|
"dev": "turbo run dev --filter=@documenso/remix",
|
||||||
|
|||||||
@ -2,18 +2,25 @@ import * as fs from 'node:fs';
|
|||||||
|
|
||||||
import { env } from '@documenso/lib/utils/env';
|
import { env } from '@documenso/lib/utils/env';
|
||||||
|
|
||||||
export type CertificateStatus = {
|
export const getCertificateStatus = () => {
|
||||||
isAvailable: boolean;
|
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 =
|
const defaultPath =
|
||||||
env('NODE_ENV') === 'production' ? '/opt/documenso/cert.p12' : './example/cert.p12';
|
env('NODE_ENV') === 'production' ? '/opt/documenso/cert.p12' : './example/cert.p12';
|
||||||
|
|
||||||
const filePath = env('NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH') || defaultPath;
|
const filePath = env('NEXT_PRIVATE_SIGNING_LOCAL_FILE_PATH') || defaultPath;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.accessSync(filePath, fs.constants.F_OK | fs.constants.R_OK);
|
fs.accessSync(filePath, fs.constants.F_OK | fs.constants.R_OK);
|
||||||
|
|
||||||
const stats = fs.statSync(filePath);
|
const stats = fs.statSync(filePath);
|
||||||
|
|
||||||
return { isAvailable: stats.size > 0 };
|
return { isAvailable: stats.size > 0 };
|
||||||
} catch {
|
} catch {
|
||||||
return { isAvailable: false };
|
return { isAvailable: false };
|
||||||
|
|||||||
Reference in New Issue
Block a user