fix: 🔧 max post length 100000

Pleroma doesn't accept >100K (ref: https://blob.cat/objects/82f33d96-534f-45ee-902a-f77c2723db8b)
This commit is contained in:
ThatOneCalculator 2023-07-15 14:50:23 -07:00
parent 247c5ec760
commit 49b0a52f9f
No known key found for this signature in database
GPG key ID: 8703CACD01000000
3 changed files with 7 additions and 5 deletions

View file

@ -121,7 +121,7 @@ redis:
# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────
# Maximum length of a post (default 3000, max 250000000)
# Maximum length of a post (default 3000, max 100000)
#maxNoteLength: 3000
# Maximum length of an image caption (default 1500, max 8192)

View file

@ -1,7 +1,10 @@
import config from "@/config/index.js";
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
import { DB_MAX_NOTE_TEXT_LENGTH, DB_MAX_IMAGE_COMMENT_LENGTH } from "@/misc/hard-limits.js";
export const MAX_NOTE_TEXT_LENGTH = config.maxNoteLength ?? 3000;
export const MAX_NOTE_TEXT_LENGTH = Math.min(
config.maxNoteLength ?? 3000,
DB_MAX_NOTE_TEXT_LENGTH,
);
export const MAX_CAPTION_TEXT_LENGTH = Math.min(
config.maxCaptionLength ?? 1500,
DB_MAX_IMAGE_COMMENT_LENGTH,

View file

@ -3,9 +3,8 @@
/**
* Maximum note text length that can be stored in DB.
* Surrogate pairs count as one
* DEPRECARTED: use const/MAX_NOTE_TEXT_LENGTH instead
*/
// export const DB_MAX_NOTE_TEXT_LENGTH = 8192;
export const DB_MAX_NOTE_TEXT_LENGTH = 100000;
/**
* Maximum image description length that can be stored in DB.