chore: enable all origins in cors settings

This commit is contained in:
Boris Arzentar 2024-09-25 14:34:14 +02:00
parent ee2698a41c
commit d39d859e2b
2 changed files with 7 additions and 13 deletions

View file

@ -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

View file

@ -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,\