mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-14 01:59:05 +03:00
refactor: migrate bot/ to a sensible logging solution
This commit is contained in:
@@ -95,6 +95,7 @@
|
||||
"node-html-parser": "catalog:",
|
||||
"nodemailer": "catalog:",
|
||||
"pg": "catalog:",
|
||||
"pino": "catalog:",
|
||||
"prudence": "catalog:",
|
||||
"rate-limit-redis": "catalog:",
|
||||
"redis": "catalog:",
|
||||
@@ -107,10 +108,10 @@
|
||||
"ts-node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"uuidv7": "catalog:",
|
||||
"zod": "catalog:",
|
||||
"winston": "catalog:",
|
||||
"winston-loki": "catalog:",
|
||||
"winston-transport": "catalog:"
|
||||
"winston-transport": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"nyc": {
|
||||
"reporter": [
|
||||
|
||||
@@ -23,7 +23,7 @@ async function CloseEverythingElse() {
|
||||
logger.info("Closing Mongo Database.", { shutdownInfo: true });
|
||||
await monkDB.close();
|
||||
|
||||
logger.info("Closing database...", {shutdownInfo: true});
|
||||
logger.info("Closing database...", { shutdownInfo: true });
|
||||
await ClosePgConnection();
|
||||
|
||||
logger.info("Closing Redis Connection.", { shutdownInfo: true });
|
||||
|
||||
@@ -120,7 +120,6 @@ const tports: Array<winston.transport> = [
|
||||
}),
|
||||
];
|
||||
|
||||
|
||||
export const rootLogger = winston.createLogger({
|
||||
levels: {
|
||||
// entire process termination is necessary
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import JSON5 from "json5";
|
||||
import { allSupportedGameGroups, type GameGroup , type ImportTypes } from "tachi-common";
|
||||
import { allSupportedGameGroups, type GameGroup, type ImportTypes } from "tachi-common";
|
||||
import { allImportTypes } from "tachi-common/constants/import-types";
|
||||
import { z } from "zod";
|
||||
|
||||
@@ -198,7 +198,6 @@ if (!["crit", "debug", "error", "info", "severe", "verbose", "warn"].includes(lo
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
const POSTGRES_URL = process.env.POSTGRES_URL ?? "";
|
||||
|
||||
if (!POSTGRES_URL) {
|
||||
|
||||
@@ -51,10 +51,7 @@ const userSessionMiddleware = expressSession({
|
||||
ServerConfig.ENABLE_SERVER_HTTPS,
|
||||
|
||||
// Very important. Without this, we're vulnerable to CSRF!
|
||||
sameSite:
|
||||
Env.NODE_ENV === "production" || Env.NODE_ENV === "staging"
|
||||
? "strict"
|
||||
: "none",
|
||||
sameSite: Env.NODE_ENV === "production" || Env.NODE_ENV === "staging" ? "strict" : "none",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user