-
Notifications
You must be signed in to change notification settings - Fork 28
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
How to configure CORS in docker environment variables #608
Comments
The env vars STH supports are described in https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/running.md. It seems there isn't any one related with CORS. However, it shouldn't be difficult to add them, looking how others env vars have been implemented and do a similar thing. It would be great if you could provide a pull request with the improvement, pls ;) Having said that, we don't use to enable CORS in backend services. But if you need it and want to implement it in STH, ok with us. |
I changed the sthConfiguration.js file in the lib/configuration folder (I used ENV.CORS_ENABLED var and I added an if/else clause before of 226 line) as follow:
I tried a test locally (on my Win PC); Please let me know if it should be updated docs and tests |
I'd suggest to create a PR with the proposed fix, so we can provide feedback on it, please. |
I created locally a task/cors_conf_docker branch but I cannot push it in the repo because I'm not authorized. |
You can do it using a fork (eg: PR #605) |
PR #620 |
I'm using STH-Comet in a docker-compose yaml file and have CORS issues. Here is an extract of yaml file (I'm using .env file too):
I want to enable CORS using environment variables like STH_HOST or DB_PREFIX.
I couldn't find the env var to set it from the documentation. Is it possible?
At the moment, I'm fixing the problem by simply copying the config.js file (within
enabled: 'true'
in config.cors) into the container in this way:docker cp config.js <CONTAINER_ID>:/opt/sth
The text was updated successfully, but these errors were encountered: