From d39d859e2b7084c900524520bc3a90489bc75c54 Mon Sep 17 00:00:00 2001 From: Boris Arzentar Date: Wed, 25 Sep 2024 14:34:14 +0200 Subject: [PATCH] chore: enable all origins in cors settings --- bin/dockerize | 2 +- cognee/api/client.py | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/bin/dockerize b/bin/dockerize index 6302ee1e0..ab210e3ed 100755 --- a/bin/dockerize +++ b/bin/dockerize @@ -33,6 +33,6 @@ if [ "${PUBLISH}" = true ]; then echo "logging in" aws ecr get-login-password --region "${AWS_REGION}" | docker login --username AWS --password-stdin "${AWS_REPOSITORY}" fi - docker push "${FULL_IMAGE_NAME}" && + docker push "${FULL_IMAGE_NAME}:latest" && docker push "${FULL_IMAGE_NAME}:${VERSION}" && echo "Successfully pushed docker image ${FULL_IMAGE_NAME} to ECR repository" fi diff --git a/cognee/api/client.py b/cognee/api/client.py index 86a22fc44..5c015f6ce 100644 --- a/cognee/api/client.py +++ b/cognee/api/client.py @@ -21,7 +21,7 @@ logging.basicConfig( ) logger = logging.getLogger(__name__) -if os.getenv("ENV") == "prod": +if os.getenv("ENV", "prod") == "prod": sentry_sdk.init( dsn = os.getenv("SENTRY_REPORTING_URL"), traces_sample_rate = 1.0, @@ -40,20 +40,14 @@ async def lifespan(app: FastAPI): await get_default_user() yield -app = FastAPI(debug = os.getenv("ENV") != "prod", lifespan = lifespan) - -origins = [ - "http://127.0.0.1:3000", - "http://frontend:3000", - "http://localhost:3000", -] +app = FastAPI(debug = os.getenv("ENV", "prod") != "prod", lifespan = lifespan) app.add_middleware( CORSMiddleware, - allow_origins=origins, - allow_credentials=True, - allow_methods=["OPTIONS", "GET", "POST", "DELETE"], - allow_headers=["*"], + allow_origins = ["*"], + allow_credentials = True, + allow_methods = ["OPTIONS", "GET", "POST", "DELETE"], + allow_headers = ["*"], ) from cognee.api.v1.users.routers import get_auth_router, get_register_router,\