mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-11 05:06:39 +00:00
Remove postgres logs from private config file
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { drizzle as DrizzlePostgres } from "drizzle-orm/node-postgres";
|
import { drizzle as DrizzlePostgres } from "drizzle-orm/node-postgres";
|
||||||
import { Pool } from "pg";
|
import { Pool } from "pg";
|
||||||
import { readConfigFile } from "@server/lib/readConfigFile";
|
import { readConfigFile } from "@server/lib/readConfigFile";
|
||||||
import { readPrivateConfigFile } from "@server/private/lib/readConfigFile";
|
|
||||||
import { withReplicas } from "drizzle-orm/pg-core";
|
import { withReplicas } from "drizzle-orm/pg-core";
|
||||||
import { build } from "@server/build";
|
import { build } from "@server/build";
|
||||||
import { db as mainDb, primaryDb as mainPrimaryDb } from "./driver";
|
import { db as mainDb, primaryDb as mainPrimaryDb } from "./driver";
|
||||||
@@ -13,10 +12,9 @@ function createLogsDb() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const config = readConfigFile();
|
const config = readConfigFile();
|
||||||
const privateConfig = readPrivateConfigFile();
|
|
||||||
|
|
||||||
// Merge configs, prioritizing private config
|
// Merge configs, prioritizing private config
|
||||||
const logsConfig = privateConfig.postgres_logs || config.postgres_logs;
|
const logsConfig = config.postgres_logs;
|
||||||
|
|
||||||
// Check environment variable first
|
// Check environment variable first
|
||||||
let connectionString = process.env.POSTGRES_LOGS_CONNECTION_STRING;
|
let connectionString = process.env.POSTGRES_LOGS_CONNECTION_STRING;
|
||||||
@@ -86,4 +84,4 @@ function createLogsDb() {
|
|||||||
|
|
||||||
export const logsDb = createLogsDb();
|
export const logsDb = createLogsDb();
|
||||||
export default logsDb;
|
export default logsDb;
|
||||||
export const primaryLogsDb = logsDb.$primary;
|
export const primaryLogsDb = logsDb.$primary;
|
||||||
|
|||||||
@@ -83,46 +83,6 @@ export const privateConfigSchema = z.object({
|
|||||||
.optional()
|
.optional()
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
postgres_logs: z
|
|
||||||
.object({
|
|
||||||
connection_string: z
|
|
||||||
.string()
|
|
||||||
.optional()
|
|
||||||
.transform(getEnvOrYaml("POSTGRES_LOGS_CONNECTION_STRING")),
|
|
||||||
replicas: z
|
|
||||||
.array(
|
|
||||||
z.object({
|
|
||||||
connection_string: z.string()
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.optional(),
|
|
||||||
pool: z
|
|
||||||
.object({
|
|
||||||
max_connections: z
|
|
||||||
.number()
|
|
||||||
.positive()
|
|
||||||
.optional()
|
|
||||||
.default(20),
|
|
||||||
max_replica_connections: z
|
|
||||||
.number()
|
|
||||||
.positive()
|
|
||||||
.optional()
|
|
||||||
.default(10),
|
|
||||||
idle_timeout_ms: z
|
|
||||||
.number()
|
|
||||||
.positive()
|
|
||||||
.optional()
|
|
||||||
.default(30000),
|
|
||||||
connection_timeout_ms: z
|
|
||||||
.number()
|
|
||||||
.positive()
|
|
||||||
.optional()
|
|
||||||
.default(5000)
|
|
||||||
})
|
|
||||||
.optional()
|
|
||||||
.prefault({})
|
|
||||||
})
|
|
||||||
.optional(),
|
|
||||||
gerbil: z
|
gerbil: z
|
||||||
.object({
|
.object({
|
||||||
local_exit_node_reachable_at: z
|
local_exit_node_reachable_at: z
|
||||||
|
|||||||
Reference in New Issue
Block a user