From 1d7286c4c68de903951d9819bcb58ae1300dab7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:08:16 +0000 Subject: [PATCH] fix(config): add SETTING_METADATA for db pool and upload rate limit settings Add missing SETTING_METADATA entries for db_pool_size, db_max_overflow, db_pool_timeout, db_pool_recycle, upload_rate_limit_per_user, and upload_rate_limit_window so the test_all_config_settings_have_metadata test passes. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> --- app/utils/settings_service.py | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/app/utils/settings_service.py b/app/utils/settings_service.py index 577fed6c..d146e0de 100644 --- a/app/utils/settings_service.py +++ b/app/utils/settings_service.py @@ -39,6 +39,50 @@ SETTING_METADATA = { "required": True, "restart_required": True, }, + "db_pool_size": { + "category": "Core", + "description": ( + "Number of persistent database connections kept in the pool per worker process. " + "Ignored for SQLite (which uses NullPool). Default: 10." + ), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": True, + }, + "db_max_overflow": { + "category": "Core", + "description": ( + "Additional database connections allowed beyond db_pool_size under burst load. " + "Ignored for SQLite. Default: 20." + ), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": True, + }, + "db_pool_timeout": { + "category": "Core", + "description": ( + "Seconds to wait for a database connection from the pool before raising a TimeoutError. " + "Ignored for SQLite. Default: 30." + ), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": True, + }, + "db_pool_recycle": { + "category": "Core", + "description": ( + "Recycle (close and reopen) database connections after this many seconds " + "to avoid stale connections. Ignored for SQLite. Default: 1800." + ), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": True, + }, "workdir": { "category": "Core", "description": "Working directory for file storage and processing", @@ -2525,6 +2569,26 @@ SETTING_METADATA = { "required": False, "restart_required": True, }, + "upload_rate_limit_per_user": { + "category": "Security", + "description": ( + "Maximum number of file uploads allowed per user within the sliding window. " + "The effective limit may be reduced dynamically when the system is under heavy load. " + "Set to 0 to disable per-user upload rate limiting. Default: 20." + ), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": False, + }, + "upload_rate_limit_window": { + "category": "Security", + "description": ("Sliding window size in seconds for per-user upload rate limiting. Default: 60."), + "type": "integer", + "sensitive": False, + "required": False, + "restart_required": False, + }, # CORS "cors_enabled": { "category": "Security",