Files
rengine/shared/config.py
T
Yogesh OjhaandClaude Fable 5.1 d4072b8efa perf: make the read path scale with the estate
Scan page froze on a duplicate each key; every tab body now sits in a
svelte:boundary. Composite discovered_at indexes on the five result
tables, leads counted in one FILTER pass, dashboard and scan-service
first-seen counts bounded to the scans in the window, ANALYZE at
finalize, shm_size on the db service, SQL_ECHO instead of DEBUG, an
entrypoint that serves with workers outside reload.

Settled-scope aggregates and search pages are cached by target
revision; triage, dismissal, interest evaluation, notes, certificate
rechecks and re-ranking bump it. Requests per page cut: single-flight
GETs, one schemas endpoint, batched whois correlations, a counts
endpoint for the dashboard, deduped store loads, trimmed coverage
payloads.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NWRq8utu7KXsVBVU3gYNi7
2026-09-12 08:49:41 +05:30

63 lines
1.7 KiB
Python

from pydantic_settings import BaseSettings
class BaseAppSettings(BaseSettings):
APP_NAME: str = "reNgine"
DEBUG: bool = False
SQL_ECHO: bool = False
APP_VERSION: str = "3.0.0"
LOG_LEVEL: str = "INFO"
POSTGRES_HOST: str = "db"
POSTGRES_PORT: int = 5432
POSTGRES_USER: str = "rengine"
POSTGRES_PASSWORD: str = "rengine" # noqa: S105
POSTGRES_DB: str = "rengine"
DB_POOL_SIZE: int = 10
DB_MAX_OVERFLOW: int = 20
DB_POOL_TIMEOUT: int = 10
DB_POOL_RECYCLE: int = 1800
DB_IDLE_TX_TIMEOUT: int = 120
WORKER_DB_POOL_SIZE: int = 2
WORKER_DB_MAX_OVERFLOW: int = 3
WORKER_DB_POOL_TIMEOUT: int = 30
CELERY_SCAN_CONCURRENCY: int = 12
@property
def database_url_async(self) -> str:
return (
f"postgresql+asyncpg://{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
f"@{self.POSTGRES_HOST}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}"
)
@property
def database_url_sync(self) -> str:
return (
f"postgresql://{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
f"@{self.POSTGRES_HOST}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}"
)
REDIS_HOST: str = "redis"
REDIS_PORT: int = 6379
REDIS_DB: int = 0
@property
def redis_url(self) -> str:
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}"
@property
def celery_broker_url(self) -> str:
return self.redis_url
@property
def celery_result_backend(self) -> str:
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB + 1}"
class Config:
env_file = ".env"
case_sensitive = True
extra = "ignore"