upd: Note Length customization

note length is now configurable through the config file

Closes #281

falls back to 3000 (misskey default) if not used/included in config
This commit is contained in:
Marie 2023-12-31 18:22:02 +01:00
parent 031d748d0c
commit b1c26201ca
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
8 changed files with 43 additions and 12 deletions

View file

@ -7,8 +7,8 @@ import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import * as yaml from 'js-yaml';
import type { RedisOptions } from 'ioredis';
import { globSync } from 'glob';
import type { RedisOptions } from 'ioredis';
type RedisOptionsSource = Partial<RedisOptions> & {
host: string;
@ -65,6 +65,7 @@ type Source = {
allowedPrivateNetworks?: string[];
maxFileSize?: number;
maxNoteLength?: number;
clusterLimit?: number;
@ -133,6 +134,7 @@ export type Config = {
proxyBypassHosts: string[] | undefined;
allowedPrivateNetworks: string[] | undefined;
maxFileSize: number | undefined;
maxNoteLength: number;
clusterLimit: number | undefined;
id: string;
outgoingAddress: string | undefined;
@ -249,6 +251,7 @@ export function loadConfig(): Config {
proxyBypassHosts: config.proxyBypassHosts,
allowedPrivateNetworks: config.allowedPrivateNetworks,
maxFileSize: config.maxFileSize,
maxNoteLength: config.maxNoteLength ?? 3000,
clusterLimit: config.clusterLimit,
outgoingAddress: config.outgoingAddress,
outgoingAddressFamily: config.outgoingAddressFamily,