-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Description
crawl4ai version
0.8.0
Expected Behavior
We expect to be able to point Crawl4AI's FastAPI server to a Redis instance for rate-limiting and caching.
Current Behavior
Currently:
- None of the documented Redis settings in config.yaml seem to be used.
- The code only reads an undocumented option,
redis.uri. Seecrawl4ai/deploy/docker/server.py
Line 207 in aa7b050
redis = aioredis.from_url(config["redis"].get("uri", "redis://localhost")) - Setting the
redis.urioption inconfig.yamlin text could expose the Redis password
There have been some recent discussions and efforts to externalise Redis, e.g. #1729, which I appreciate caused too large a change to the existing Dockerfile and tooling.
As mentioned for the reason that PR was closed, it is pretty easy to handle this ourselves, e.g. by overriding the Docker command to avoid supervisord and run FastAPI directly, with a separate Redis deployment elsewhere. E.g.
command: ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "11235", "--log-level", "info", "--timeout-keep-alive", "300"]However, allowing Redis to be configured more securely would make the image more production-ready. A much smaller change would be to allow redis.uri and rate_limiting.storage_uri to be set optionally via environment variables, REDIS_URI and RATE_LIMITIING_STORAGE_URI, respectively. The mentioned PR did this, so those smaller changes could be accepted without too much disruption elsewhere?
Is this reproducible?
Yes
OS
macOS
Python version
3.12