Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SSL parameter support for redis #2389

Merged
merged 2 commits into from
Sep 12, 2024
Merged

add SSL parameter support for redis #2389

merged 2 commits into from
Sep 12, 2024

Conversation

rkuo-danswer
Copy link
Contributor

Description

Fixes DAN-597.

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Accepted Risk

[Any know risks or failure modes to point out to reviewers]

Related Issue(s)

[If applicable, link to the issue(s) this PR addresses]

Checklist:

  • All of the automated tests pass
  • All PR comments are addressed and marked resolved
  • If there are migrations, they have been rebased to latest main
  • If there are new dependencies, they are added to the requirements
  • If there are new environment variables, they are added to all of the deployment methods
  • If there are new APIs that don't require auth, they are added to PUBLIC_ENDPOINT_SPECS
  • Docker images build and basic functionalities work
  • Author has done a final read through of the PR right before merge

Copy link

vercel bot commented Sep 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 11, 2024 5:10pm

@rkuo-danswer
Copy link
Contributor Author

rkuo-danswer commented Sep 10, 2024

reference original PR at #2383

@ThomaciousD
Copy link
Contributor

Hi @rkuo-danswer ,

you might need to handle SSL config in the redis_pool as well.

https://github.com/danswer-ai/danswer/blob/0d749ebd469ed056430b7c71ee36ad10980adb80/backend/danswer/redis/redis_pool.py#L29

something like:

from danswer.configs.app_configs import (
    REDIS_HOST,
    REDIS_PASSWORD,
    REDIS_PORT,
    REDIS_SSL,
    REDIS_SSL_CA_CERTS,
    REDIS_SSL_CERT_REQS
)
#...
    def _init_pool(self) -> None:
        ssl_options = {}
        if REDIS_SSL:
            ssl_options = {
                'ssl': True,
                'ssl_ca_certs': REDIS_SSL_CA_CERTS,
                'ssl_cert_reqs': REDIS_SSL_CERT_REQS
            }

        # Create the connection pool with SSL support if needed
        self._pool = redis.ConnectionPool(
            host=REDIS_HOST,
            port=REDIS_PORT,
            db=0,  # You may need to define the DB number if using non-default
            password=REDIS_PASSWORD,
            max_connections=REDIS_POOL_MAX_CONNECTIONS,
            **ssl_options
        )

Copy link
Contributor

@hagen-danswer hagen-danswer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hagen-danswer hagen-danswer added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit 4bc4da2 Sep 12, 2024
7 checks passed
@rkuo-danswer rkuo-danswer deleted the feature/redis_ssl branch September 12, 2024 16:39
rajivml pushed a commit to UiPath/danswer that referenced this pull request Oct 2, 2024
* add SSL parameter support for redis

* add ssl support to redis pool
rajivml pushed a commit to UiPath/danswer that referenced this pull request Oct 2, 2024
* add SSL parameter support for redis

* add ssl support to redis pool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants