Skip to content

Commit 783774d

Browse files
fix(den): trust 0.0.0.0 local auth origin (anomalyco#1192)
1 parent 57d0362 commit 783774d

5 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎packaging/docker/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Optional env vars (via `.env` or `export`):
7979
- `DEN_PUBLIC_HOST` — host name/IP used for default auth URL + printed LAN/public URLs (defaults to your machine hostname)
8080
- `DEN_BETTER_AUTH_URL` — browser-facing auth base URL (defaults to `http://$DEN_PUBLIC_HOST:<DEN_WEB_PORT>`)
8181
- `DEN_BETTER_AUTH_TRUSTED_ORIGINS` — trusted origins for Better Auth (defaults to `DEN_CORS_ORIGINS`)
82-
- `DEN_CORS_ORIGINS` — trusted origins for Express CORS (defaults include hostname, localhost, loopback, and detected LAN IPv4)
82+
- `DEN_CORS_ORIGINS` — trusted origins for Express CORS (defaults include hostname, localhost, `127.0.0.1`, `0.0.0.0`, and detected LAN IPv4)
8383
- `DEN_PROVISIONER_MODE` — `stub` or `render` (defaults to `stub`)
8484
- `DEN_WORKER_URL_TEMPLATE` — stub worker URL template with `{workerId}` placeholder
8585

‎packaging/docker/den-dev-up.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ DEN_BETTER_AUTH_URL="${DEN_BETTER_AUTH_URL:-http://$PUBLIC_HOST:$DEN_WEB_PORT}"
140140
DEN_PROVISIONER_MODE="${DEN_PROVISIONER_MODE:-stub}"
141141
DEN_WORKER_URL_TEMPLATE="${DEN_WORKER_URL_TEMPLATE:-https://workers.local/{workerId}}"
142142
DEN_DAYTONA_WORKER_PROXY_BASE_URL="${DEN_DAYTONA_WORKER_PROXY_BASE_URL:-http://$PUBLIC_HOST:$DEN_WORKER_PROXY_PORT}"
143-
DEN_CORS_ORIGINS="${DEN_CORS_ORIGINS:-http://localhost:$DEN_WEB_PORT,http://127.0.0.1:$DEN_WEB_PORT,http://localhost:$DEN_API_PORT,http://127.0.0.1:$DEN_API_PORT}"
143+
DEN_CORS_ORIGINS="${DEN_CORS_ORIGINS:-http://localhost:$DEN_WEB_PORT,http://127.0.0.1:$DEN_WEB_PORT,http://0.0.0.0:$DEN_WEB_PORT,http://localhost:$DEN_API_PORT,http://127.0.0.1:$DEN_API_PORT}"
144144
append_origin "http://$PUBLIC_HOST:$DEN_WEB_PORT"
145145
append_origin "http://$PUBLIC_HOST:$DEN_API_PORT"
146146
append_origin "http://$PUBLIC_HOST:$DEN_WORKER_PROXY_PORT"

‎packaging/docker/docker-compose.den-dev.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ services:
7070
BETTER_AUTH_URL: ${DEN_BETTER_AUTH_URL:-http://localhost:3005}
7171
DEN_BETTER_AUTH_TRUSTED_ORIGINS: ${DEN_BETTER_AUTH_TRUSTED_ORIGINS:-}
7272
PORT: "8788"
73-
CORS_ORIGINS: ${DEN_CORS_ORIGINS:-http://localhost:3005,http://127.0.0.1:3005,http://localhost:8788,http://127.0.0.1:8788}
73+
CORS_ORIGINS: ${DEN_CORS_ORIGINS:-http://localhost:3005,http://127.0.0.1:3005,http://0.0.0.0:3005,http://localhost:8788,http://127.0.0.1:8788}
7474
PROVISIONER_MODE: ${DEN_PROVISIONER_MODE:-stub}
7575
WORKER_URL_TEMPLATE: ${DEN_WORKER_URL_TEMPLATE:-}
7676
POLAR_FEATURE_GATE_ENABLED: "false"

‎scripts/dev-local.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function detectWebOrigins() {
1919
const origins = new Set([
2020
`http://localhost:${webPort}`,
2121
`http://127.0.0.1:${webPort}`,
22+
`http://0.0.0.0:${webPort}`,
2223
])
2324

2425
for (const entries of Object.values(os.networkInterfaces())) {

‎scripts/dev-web-local.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const port = process.env.WEB_PORT;
4545
const origins = new Set([
4646
`http://localhost:${port}`,
4747
`http://127.0.0.1:${port}`,
48+
`http://0.0.0.0:${port}`,
4849
]);
4950
5051
for (const entries of Object.values(os.networkInterfaces())) {

0 commit comments

Comments
 (0)