Skip to content

[Bug]: Redis password exposed in plain text, documented settings unused #1817

@gregbrowndev

Description

@gregbrowndev

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. See
    redis = aioredis.from_url(config["redis"].get("uri", "redis://localhost"))
  • Setting the redis.uri option in config.yaml in 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⚙ DoneBug fix, enhancement, FR that's completed pending release🐞 BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions