ddev / ddev-elasticsearch

Elasticsearch add-on for DDEV
Apache License 2.0
9 stars 15 forks source link

Feature/add cors headers #19

Open ben-hamelin opened 1 year ago

ben-hamelin commented 1 year ago

The Issue

https://github.com/ddev/ddev-elasticsearch/issues/17

How This PR Solves The Issue

Adds http.cors configuration to the compose file

Manual Testing Instructions

Make a Javascript "fetch()" request from either a decoupled localhost environment, or from any other locally hosted webpage, could even be static HTML.

Automated Testing Overview

I am reviewing the tests now to see if there are any that require an update, or if it is appropriate to create a new one

Related Issue Link(s)

Release/Deployment Notes

rfay commented 1 year ago

Since you're a new contributor, the tests have to be allowed manually on this first PR to this repo. Ping me when you push new things and I'll allow again.

rfay commented 1 year ago

Yes...

This is the simplest option. Enable CORS on Elasticsearch by adding the following to your elasticsearch.yml file:

They aren't environment variables, they have to be added to elasticsearch.yml. I'll bet they could also be added as command-line arguments to the elasticsearch daemon.

ben-hamelin commented 6 months ago

@rfay Following up on this. I can confirm the changes here work locally to resolve CORS errors. Would you prefer an updated approach that adds a "volumes" mapping to https://github.com/ddev/ddev-elasticsearch/blob/main/docker-compose.elasticsearch.yaml#L21 and a new elasticsearch7.yml file? I would review and apply the same settings for 8.

rfay commented 6 months ago

@AronNovak is the maintainer here, hopefully we can raise him :)