diff --git a/.config/example.yml b/.config/example.yml index 5cf984e9e..29f4a6229 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -93,6 +93,9 @@ id: 'aid' # ┌─────────────────────┐ #───┘ Other configuration └───────────────────────────────────── +# Max note length, should be < 8000. +#maxNoteLength: 3000 + # Whether disable HSTS #disableHsts: true diff --git a/CALCKEY.md b/CALCKEY.md index b164e5f31..f1a62548b 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -29,6 +29,7 @@ ## Work in progress - Weblate project +- Customizable max note length - Link verification - Better Messaging UI - Better API Documentation diff --git a/packages/backend/src/config/types.ts b/packages/backend/src/config/types.ts index aff67ffa6..9872b0eeb 100644 --- a/packages/backend/src/config/types.ts +++ b/packages/backend/src/config/types.ts @@ -67,6 +67,7 @@ export type Source = { // Managed hosting stuff maxUserSignups?: number; isManagedHosting?: boolean; + maxNoteLength?: number; deepl: { managed?: boolean; authKey?: string; diff --git a/packages/backend/src/const.ts b/packages/backend/src/const.ts index 17fdb45ec..172edca0d 100644 --- a/packages/backend/src/const.ts +++ b/packages/backend/src/const.ts @@ -1,4 +1,6 @@ -export const MAX_NOTE_TEXT_LENGTH = 3000; +import config from '@/config/index.js'; + +export const MAX_NOTE_TEXT_LENGTH = config.maxNoteLength != null ? config.maxNoteLength : 3000; export const SECOND = 1000; export const SEC = 1000;