summaryrefslogtreecommitdiff
path: root/packages/backend/src/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/config.ts')
-rw-r--r--packages/backend/src/config.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts
index 1a3a916624..d35befdc2b 100644
--- a/packages/backend/src/config.ts
+++ b/packages/backend/src/config.ts
@@ -53,6 +53,9 @@ type Source = {
redisForJobQueue?: RedisOptionsSource;
redisForTimelines?: RedisOptionsSource;
redisForReactions?: RedisOptionsSource;
+ fulltextSearch?: {
+ provider?: FulltextSearchProvider;
+ };
meilisearch?: {
host: string;
port: string;
@@ -119,6 +122,13 @@ type Source = {
pidFile: string;
filePermissionBits?: string;
+
+ logging?: {
+ sql?: {
+ disableQueryTruncation? : boolean,
+ enableQueryParamLogging? : boolean,
+ }
+ }
};
export type Config = {
@@ -145,6 +155,9 @@ export type Config = {
user: string;
pass: string;
}[] | undefined;
+ fulltextSearch?: {
+ provider?: FulltextSearchProvider;
+ };
meilisearch: {
host: string;
port: string;
@@ -181,6 +194,12 @@ export type Config = {
signToActivityPubGet: boolean;
attachLdSignatureForRelays: boolean;
checkActivityPubGetSignature: boolean | undefined;
+ logging?: {
+ sql?: {
+ disableQueryTruncation? : boolean,
+ enableQueryParamLogging? : boolean,
+ }
+ }
version: string;
publishTarballInsteadOfProvideRepositoryUrl: boolean;
@@ -221,6 +240,8 @@ export type Config = {
filePermissionBits?: string;
};
+export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch';
+
const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
@@ -305,6 +326,7 @@ export function loadConfig(): Config {
db: { ...config.db, db: dbDb, user: dbUser, pass: dbPass },
dbReplications: config.dbReplications,
dbSlaves: config.dbSlaves,
+ fulltextSearch: config.fulltextSearch,
meilisearch: config.meilisearch,
redis,
redisForPubsub: config.redisForPubsub ? convertRedisOptions(config.redisForPubsub, host) : redis,
@@ -357,6 +379,7 @@ export function loadConfig(): Config {
import: config.import,
pidFile: config.pidFile,
filePermissionBits: config.filePermissionBits,
+ logging: config.logging,
};
}
@@ -498,6 +521,7 @@ function applyEnvOverrides(config: Source) {
['redis', 'redisForPubsub', 'redisForJobQueue', 'redisForTimelines', 'redisForReactions'],
['host', 'port', 'username', 'pass', 'db', 'prefix'],
]);
+ _apply_top(['fulltextSearch', 'provider']);
_apply_top(['meilisearch', ['host', 'port', 'apikey', 'ssl', 'index', 'scope']]);
_apply_top([['sentryForFrontend', 'sentryForBackend'], 'options', ['dsn', 'profileSampleRate', 'serverName', 'includeLocalVariables', 'proxy', 'keepAlive', 'caCerts']]);
_apply_top(['sentryForBackend', 'enableNodeProfiling']);
@@ -506,4 +530,5 @@ function applyEnvOverrides(config: Source) {
_apply_top([['maxFileSize', 'maxNoteLength', 'maxRemoteNoteLength', 'maxAltTextLength', 'maxRemoteAltTextLength', 'pidFile', 'filePermissionBits']]);
_apply_top(['import', ['downloadTimeout', 'maxFileSize']]);
_apply_top([['signToActivityPubGet', 'checkActivityPubGetSignature', 'setupPassword']]);
+ _apply_top(['logging', 'sql', ['disableQueryTruncation', 'enableQueryParamLogging']]);
}