mirror of https://github.com/kortix-ai/suna.git
Merge branch 'main' into minor-fixes
This commit is contained in:
commit
0db9c47023
|
@ -105,19 +105,18 @@ async def log_requests_middleware(request: Request, call_next):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# Define allowed origins based on environment
|
# Define allowed origins based on environment
|
||||||
allowed_origins = ["https://www.suna.so", "https://suna.so", "https://staging.suna.so", "http://localhost:3000"]
|
allowed_origins = ["https://www.suna.so", "https://suna.so", "http://localhost:3000"]
|
||||||
|
allow_origin_regex = None
|
||||||
|
|
||||||
# Add staging-specific origins
|
# Add staging-specific origins
|
||||||
if config.ENV_MODE == EnvMode.STAGING:
|
if config.ENV_MODE == EnvMode.STAGING:
|
||||||
allowed_origins.append("http://localhost:3000")
|
allowed_origins.append("https://staging.suna.so")
|
||||||
|
allow_origin_regex = r"https://suna-.*-prjcts\.vercel\.app"
|
||||||
# Add local-specific origins
|
|
||||||
if config.ENV_MODE == EnvMode.LOCAL:
|
|
||||||
allowed_origins.append("http://localhost:3000")
|
|
||||||
|
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=allowed_origins,
|
allow_origins=allowed_origins,
|
||||||
|
allow_origin_regex=allow_origin_regex,
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
||||||
allow_headers=["Content-Type", "Authorization"],
|
allow_headers=["Content-Type", "Authorization"],
|
||||||
|
|
|
@ -36,8 +36,9 @@ services:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend/.env:/app/.env:ro
|
- ./backend/.env:/app/.env:ro
|
||||||
|
env_file:
|
||||||
|
- ./backend/.env
|
||||||
environment:
|
environment:
|
||||||
- ENV_MODE=local
|
|
||||||
- REDIS_HOST=redis
|
- REDIS_HOST=redis
|
||||||
- REDIS_PORT=6379
|
- REDIS_PORT=6379
|
||||||
- REDIS_PASSWORD=
|
- REDIS_PASSWORD=
|
||||||
|
@ -59,8 +60,9 @@ services:
|
||||||
command: python -m dramatiq run_agent_background
|
command: python -m dramatiq run_agent_background
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend/.env:/app/.env:ro
|
- ./backend/.env:/app/.env:ro
|
||||||
|
env_file:
|
||||||
|
- ./backend/.env
|
||||||
environment:
|
environment:
|
||||||
- ENV_MODE=local
|
|
||||||
- REDIS_HOST=redis
|
- REDIS_HOST=redis
|
||||||
- REDIS_PORT=6379
|
- REDIS_PORT=6379
|
||||||
- REDIS_PASSWORD=
|
- REDIS_PASSWORD=
|
||||||
|
|
Loading…
Reference in New Issue