fix(settings): проверять резервные копии и исключить секреты из журнала

This commit is contained in:
Denozordec committed 2026-10-03 14:36:12 +07:00
1 parent e5842b415b
commit ff8b04bddf
7 files changed
+78 -47

No files matched your search

-3
View File
@@ -2,7 +2,6 @@ import type { FastifyPluginAsync } from "fastify"
import { appendEvent } from "../modules/events/service/events-service.js"
import {
exportSystemDatabaseBackup,
getSystemDatabasePath,
restoreSystemDatabaseBackup,
} from "../services/system-database-backup.js"
@@ -29,7 +28,6 @@ const systemDatabaseRoutes: FastifyPluginAsync = async (app) => {
payload: {
filename,
sizeBytes: buffer.length,
databasePath: getSystemDatabasePath(),
},
})
reply.header("Content-Type", "application/octet-stream")
@@ -58,7 +56,6 @@ const systemDatabaseRoutes: FastifyPluginAsync = async (app) => {
entityId: "restore",
payload: {
sizeBytes: body.length,
databasePath: getSystemDatabasePath(),
},
})
return reply.send({ ok: true })
@@ -1,6 +1,6 @@
import { randomUUID } from "node:crypto"
import { spawn } from "node:child_process"
import { mkdir, readFile, rm, writeFile } from "node:fs/promises"
import { mkdir, rm, writeFile } from "node:fs/promises"
import os from "node:os"
import path from "node:path"
import { env } from "../config.js"
@@ -95,7 +95,3 @@ export async function restoreSystemDatabaseBackup(buffer: Buffer): Promise<void>
}
})
}
export function getSystemDatabasePath(): string {
return env.DATABASE_URL
}