`CORS Missing Allow Origin` when deployed using docker
Description
There is a problem with verba when I deploy it on another machine (not on my local machine.
When I want to open Verba UI I I get stuck on Welcome to Verba Choose your deployment view.
Installation
- [ ] pip install goldenverba
- [ ] pip install from source
- [X] Docker installation
Weaviate Deployment
- [ ] Local Deployment
- [X] Docker Deployment
- [ ] Cloud Deployment
Configuration
Reader: Chunker: Embedder: Retriever: Generator:
Steps to Reproduce
You need 2 machines in your network:
- Your local dev machine with IP:
192.168.0.100 - Your strong server with IP
192.168.0.200
Steps:
- Deploy verba using docker compose from this repo
docker compose up -d --buildon your server machine - Open
http://192.168.0.200:8000on your dev machine - Press
Dockeroption - App is stuck
Additional context
Possible workaround is using ssh tunnels to access Verba ssh -L 8001:localhost:8000 [email protected], then website works under http://localhost:8001 on dev machine
Hey thanks for the issue! This is because of this @middleware section
https://github.com/weaviate/Verba/blob/30ae51ef66279fa2d001ccbfbc7f5659277c3467/goldenverba/server/api.py#L82
It checks if the requests have the same origin, since it's deployed on another machine it fails with the CORS error message. I'll think of a way to disable this, but for now the workaround would be to simply delete the whole custom middleware logic. Let me know if that works for you 🚀
@thomashacker
Thank you for fix. It helped me.
Hey thanks for the issue! This is because of this
@middlewaresectionVerba/goldenverba/server/api.py
Line 82 in 30ae51e @app.middleware("http")
It checks if the requests have the same origin, since it's deployed on another machine it fails with the CORS error message. I'll think of a way to disable this, but for now the workaround would be to simply delete the whole custom middleware logic. Let me know if that works for you 🚀
Thanks. This also helped me!