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

chatbot-rag-app does not work for self-signed (local development) #138

Open
liu-xiao-guo opened this issue Dec 11, 2023 · 1 comment
Open
Labels
bug Something isn't working enhancement New feature or request

Comments

@liu-xiao-guo
Copy link

For self-signed environment, the code does not work. we need to set the certificate in order to establish a connection with Elasticsearch. There are two places to change:

  1. index_data.py
ELASTCSEARCH_CERT_PATH = "/usr/share/certs/http_ca.crt"

if ELASTICSEARCH_URL:
    elasticsearch_client = Elasticsearch(
        hosts=[ELASTICSEARCH_URL], 
        ca_certs = ELASTCSEARCH_CERT_PATH, 
        verify_certs = True
    )
This adds the certificate info into the connection.
  1. elasticsearch-client.py
ELASTCSEARCH_CERT_PATH = "/usr/share/certs/http_ca.crt"


if ELASTICSEARCH_URL:
    elasticsearch_client = Elasticsearch(
        hosts=[ELASTICSEARCH_URL], 
        ca_certs = ELASTCSEARCH_CERT_PATH, 
        verify_certs = True
    )

We can index the data using the command like:

docker run \
  --volume="$PWD/http_ca.crt:/usr/share/certs/http_ca.crt:ro" \
  --rm --env-file .env chatbot-rag-app flask create-index

and we can run the frondend like:

docker run \
  --volume="$PWD/http_ca.crt:/usr/share/certs/http_ca.crt:ro" \
  --rm -p 4000:4000 --env-file .env -d chatbot-rag-app
@joemcelroy
Copy link
Member

Thanks! For now we have focused on two scenarios: cloud + local instance with security turned off.

An incremental improvement will be to add a heading for when you need to use the self-signed cert and allow the developer to customise the code to accommodate it. Happy for you to add that heading to the readme in a PR.

Will keep this issue open in case there are more developers who want this support. If you do, please react / comment on the issue!

@serenachou serenachou added the bug Something isn't working label Feb 8, 2024
@serenachou serenachou added the enhancement New feature or request label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants