From 48d93e96cba827230bfcc0f3f134a2e0fb1253d7 Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Wed, 8 May 2024 08:53:28 +0700 Subject: [PATCH] add `streamMaxSize` --- src/config/gIndex.config.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/config/gIndex.config.ts b/src/config/gIndex.config.ts index 860fafb..1a298ef 100644 --- a/src/config/gIndex.config.ts +++ b/src/config/gIndex.config.ts @@ -108,6 +108,21 @@ const config: z.input = { */ proxyThumbnail: true, + /** + * Only show preview for files that are smaller than this size + * If the file is larger than this size, it will show "can't preview" message instead + * + * Why? + * Since the stream endpoint are counted as a bandwidth usage + * I want to limit the preview to only small files + * It also to prevent abuse from the user + * + * You can also set this to 0 to disable the limit + * + * Default: 100MB + */ + streamMaxSize: 100 * 1024 * 1024, + /** * Special file name that will be used for certain purposes * These files will be ignored when searching for files