From 8b45a4f6cdea467c36d6f8ac18f404bce7eeaf82 Mon Sep 17 00:00:00 2001 From: Richard R Date: Sat, 30 May 2026 14:59:45 -0600 Subject: [PATCH] refactor(admin): group rate limit and upload settings in dedicated section move TTS and PDF parsing rate limit toggles and max upload size input into a new "Rate limiting" section in the admin panel for improved organization. update documentation to reflect the new grouping and clarify the relationship between these settings. --- docs-site/docs/configure/admin-panel.md | 23 +++++++----- src/components/admin/AdminFeaturesPanel.tsx | 39 ++++++++++++++------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/docs-site/docs/configure/admin-panel.md b/docs-site/docs/configure/admin-panel.md index bdb64ce..f8d32df 100644 --- a/docs-site/docs/configure/admin-panel.md +++ b/docs-site/docs/configure/admin-panel.md @@ -77,14 +77,6 @@ Runtime-editable settings, one row per key: | `enableAudiobookExport` | Show the audiobook export entry points on PDF/EPUB pages. | | `enableDocxConversion` | Accept .docx uploads (converted to PDF server-side). | | `enableDestructiveDeleteActions` | Show "Delete all data" buttons in the Documents tab (auth-disabled mode). | -| `disableTtsRateLimit` | Disable the per-user/IP daily TTS character limits. When `false`, the daily-limit fields below it apply. | -| `disableComputeRateLimit` | Disable per-user PDF parsing rate limiting. When `false`, the burst/sustained limit fields below it apply. | -| `maxUploadMb` | Maximum size (MB) accepted for a single document upload. Enforced server-side and signed into the presigned S3 PUT. | - -The **Disable TTS daily rate limiting** and **Disable PDF parsing rate limiting** toggles each reveal a collapsible group of numeric inputs when set to `false`: - -- TTS: anonymous/authenticated per-user daily limits and anonymous/authenticated IP daily backstops. -- PDF parsing: burst limit + window (seconds) and sustained limit + window (seconds). The sustained window doubles as a concurrency cap. Word-by-word highlighting and PDF layout parsing capability are controlled by compute-worker server env configuration, not an admin runtime flag. @@ -98,6 +90,21 @@ Each row shows a source badge: Turning `restrictUserApiKeys` off allows user-supplied API keys to flow through this server. Use this only for trusted/self-hosted deployments where that tradeoff is acceptable. ::: +## Rate limiting + +A dedicated **Rate limiting** group (within the same admin panel) collects the daily quotas, the PDF parsing throttle, and the upload size cap: + +| Key | What it controls | +| --- | --- | +| `disableTtsRateLimit` | Disable the per-user/IP daily TTS character limits. When `false`, the daily-limit fields below it apply. | +| `disableComputeRateLimit` | Disable per-user PDF parsing rate limiting. When `false`, the burst/sustained limit fields below it apply. | +| `maxUploadMb` | Maximum size (MB) accepted for a single document upload. Enforced server-side and signed into the presigned S3 PUT. | + +The **Disable TTS daily rate limiting** and **Disable PDF parsing rate limiting** toggles each reveal a collapsible group of numeric inputs when set to `false`: + +- TTS: anonymous/authenticated per-user daily limits and anonymous/authenticated IP daily backstops. +- PDF parsing: burst limit + window (seconds) and sustained limit + window (seconds). The sustained window doubles as a concurrency cap. + ## Migrating off env vars The future-direction goal is to remove `RUNTIME_SEED_*` / `API_KEY` / `API_BASE` from your `.env` entirely. To do that safely: diff --git a/src/components/admin/AdminFeaturesPanel.tsx b/src/components/admin/AdminFeaturesPanel.tsx index a450520..2facf72 100644 --- a/src/components/admin/AdminFeaturesPanel.tsx +++ b/src/components/admin/AdminFeaturesPanel.tsx @@ -280,6 +280,13 @@ export function AdminFeaturesPanel() { right={renderSource('showAllProviderModels')} variant="flat" /> + + +
Limits} + > ) : null} -
-
-
- - {renderSource('maxUploadMb')} +
+
+
+ Max upload size + Largest single document upload accepted. +
+
{renderSource('maxUploadMb')}
+
+ updatePositiveIntDraft('maxUploadMb', event.target.value)} + /> + MB
- updatePositiveIntDraft('maxUploadMb', event.target.value)} - />