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:
parent
247c5ec760
commit
49b0a52f9f
3 changed files with 7 additions and 5 deletions
|
@ -121,7 +121,7 @@ redis:
|
||||||
# ┌─────────────────────┐
|
# ┌─────────────────────┐
|
||||||
#───┘ Other configuration └─────────────────────────────────────
|
#───┘ Other configuration └─────────────────────────────────────
|
||||||
|
|
||||||
# Maximum length of a post (default 3000, max 250000000)
|
# Maximum length of a post (default 3000, max 100000)
|
||||||
#maxNoteLength: 3000
|
#maxNoteLength: 3000
|
||||||
|
|
||||||
# Maximum length of an image caption (default 1500, max 8192)
|
# Maximum length of an image caption (default 1500, max 8192)
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
import config from "@/config/index.js";
|
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(
|
export const MAX_CAPTION_TEXT_LENGTH = Math.min(
|
||||||
config.maxCaptionLength ?? 1500,
|
config.maxCaptionLength ?? 1500,
|
||||||
DB_MAX_IMAGE_COMMENT_LENGTH,
|
DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||||
|
|
|
@ -3,9 +3,8 @@
|
||||||
/**
|
/**
|
||||||
* Maximum note text length that can be stored in DB.
|
* Maximum note text length that can be stored in DB.
|
||||||
* Surrogate pairs count as one
|
* 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.
|
* Maximum image description length that can be stored in DB.
|
||||||
|
|
Loading…
Reference in a new issue