diff --git a/README.md b/README.md index acd724a..991b4ab 100644 --- a/README.md +++ b/README.md @@ -55,3 +55,14 @@ Migas is built with [FastAPI](https://fastapi.tiangolo.com/), [Strawberry](https | redis | MIGAS_REDIS_URI | n/a | Yes | postgres | DATABASE_URL | n/a | Yes | sqlalchemy | MIGAS_DEBUG | n/a | No + + +### Runtime Knobs + +Migas includes the following environmental variables to allow finer control when processing requests: + +| Environmental Variable | Description | Default | +| ---- | ---- | ---- | +| MIGAS_REQUEST_WINDOW | A sliding window for limiting number of queries (in seconds) | 60 | +| MIGAS_REQUESTS_PER_WINDOW | Maximum number of requests per `MIGAS_REQUEST_WINDOW` | 5 | +| MIGAS_MAX_REQUEST_SIZE | Maximum size of request body | 450 | diff --git a/migas_server/schema.py b/migas_server/schema.py index db9073f..22b2e77 100644 --- a/migas_server/schema.py +++ b/migas_server/schema.py @@ -119,7 +119,7 @@ class Watchdog(Extension): """ REQUEST_WINDOW = int(os.getenv("MIGAS_REQUEST_WINDOW", 60)) - MAX_REQUESTS_PER_WINDOW = int(os.getenv("MIGAS_REQUESTS_PER_WINDOW", 5)) + MAX_REQUESTS_PER_WINDOW = int(os.getenv("MIGAS_MAX_REQUESTS_PER_WINDOW", 5)) MAX_REQUEST_SIZE = int(os.getenv("MIGAS_MAX_REQUEST_SIZE", 450)) async def on_request_start(self):