feat: new unified data folder

This commit is contained in:
Huskydog9988
2025-05-10 16:18:28 -04:00
parent 60d22ea280
commit fc74738643
6 changed files with 37 additions and 17 deletions

View File

@ -2,6 +2,7 @@ import path from "path";
import fs from "fs";
import type { CertificateBundle } from "./ca";
import prisma from "../db/database";
import { systemConfig } from "../config/sys-conf";
export type CertificateStore = {
store(name: string, data: CertificateBundle): Promise<void>;
@ -10,7 +11,8 @@ export type CertificateStore = {
checkBlacklistCertificate(name: string): Promise<boolean>;
};
export const fsCertificateStore = (base: string) => {
export const fsCertificateStore = () => {
const base = path.join(systemConfig.getDataFolder(), "certs");
const blacklist = path.join(base, ".blacklist");
fs.mkdirSync(blacklist, { recursive: true });
const store: CertificateStore = {