Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
### =================================

### Domain for the E2B cluster.
### Resolves infra-api (`https://api.<domain>`) and dashboard-api
### (`https://dashboard-api.<domain>`) unless overridden below.
### Resolves infra-api (`https://api.<domain>`) unless overridden below.
PUBLIC_E2B_DOMAIN=e2b.dev

### =================================
Expand All @@ -16,10 +15,9 @@ PUBLIC_E2B_DOMAIN=e2b.dev
### and sign-out is hidden.
# E2B_API_KEY=e2b_your_team_api_key

### Runtime API base URLs (override the cluster domain resolution;
### Runtime API base URL (overrides the cluster domain resolution;
### useful for local infra development).
# E2B_INFRA_API_URL=http://127.0.0.1:3000
# E2B_DASHBOARD_API_URL=http://127.0.0.1:3010

### Base URL the BROWSER uses to reach sandboxes (terminal and filesystem
### inspector). Set this explicitly for local sandbox proxies. It must be
Expand Down
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

21 changes: 8 additions & 13 deletions .github/workflows/sync-infra-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,18 @@ jobs:
with:
token: ${{ steps.app-token.outputs.token }}

- name: Download latest infra OpenAPI specs
- name: Download latest infra OpenAPI spec
run: |
curl -f -L https://raw.githubusercontent.com/e2b-dev/infra/refs/heads/main/spec/openapi.yml -o spec/openapi.infra.yaml
curl -f -L https://raw.githubusercontent.com/e2b-dev/infra/refs/heads/main/spec/openapi-dashboard.yml -o spec/openapi.dashboard-api.yaml

- name: Check for spec changes
id: check-spec-changes
run: |
if [[ -z $(git status --porcelain spec/openapi.infra.yaml spec/openapi.dashboard-api.yaml) ]]; then
echo "No changes detected in infra specs."
if [[ -z $(git status --porcelain spec/openapi.infra.yaml) ]]; then
echo "No changes detected in infra spec."
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "Changes detected in infra specs."
echo "Changes detected in infra spec."
echo "has_changes=true" >> $GITHUB_OUTPUT
fi

Expand All @@ -66,14 +65,12 @@ jobs:

- name: Regenerate API types
if: steps.check-spec-changes.outputs.has_changes == 'true'
run: |
bun run generate:infra
bun run generate:dashboard-api
run: bun run generate:infra

- name: Autofix generated type files
if: steps.check-spec-changes.outputs.has_changes == 'true'
run: |
GENERATED_TYPE_FILES=$(git diff --name-only -- src/core/shared/contracts/infra-api.types.ts src/core/shared/contracts/dashboard-api.types.ts | tr '\n' ' ')
GENERATED_TYPE_FILES=$(git diff --name-only -- src/core/shared/contracts/infra-api.types.ts | tr '\n' ' ')

if [[ -z "${GENERATED_TYPE_FILES}" ]]; then
echo "No generated type changes detected; skipping autofix."
Expand All @@ -92,11 +89,9 @@ jobs:
commit-message: "chore: sync infra OpenAPI specs"
title: "chore: sync infra OpenAPI specs"
body: |
This PR syncs OpenAPI specs from [e2b-dev/infra](https://github.com/e2b-dev/infra):
- `spec/openapi.infra.yaml`
- `spec/openapi.dashboard-api.yaml`
This PR syncs `spec/openapi.infra.yaml` from [e2b-dev/infra](https://github.com/e2b-dev/infra).

It also regenerates dependent TypeScript API types and applies formatting/lint autofixes.
It also regenerates the dependent TypeScript API types and applies formatting/lint autofixes.

---
*This PR was automatically created by the sync-infra-specs workflow.*
Expand Down
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ Open-source dashboard for self-hosted [E2B infrastructure](https://github.com/e2

## Overview

Built with Next.js 16, React 19, and TypeScript. The dashboard talks to two APIs from your [E2B infrastructure deployment](https://github.com/e2b-dev/infra):
Built with Next.js 16, React 19, and TypeScript. The dashboard talks to a single API from your [E2B infrastructure deployment](https://github.com/e2b-dev/infra):

- **infra-api** (`https://api.<your-domain>`) — sandboxes, templates, builds
- **dashboard-api** (`https://dashboard-api.<your-domain>`) — template & build metadata

### Authentication

Expand All @@ -32,9 +31,9 @@ Authentication is a single **team API key**:

| Variable | Read | Purpose |
|---|---|---|
| `PUBLIC_E2B_DOMAIN` | runtime | Required E2B cluster domain; used by the SDK and to derive `https://api.<domain>` and `https://dashboard-api.<domain>` |
| `PUBLIC_E2B_DOMAIN` | runtime | Required E2B cluster domain; used by the SDK and to derive `https://api.<domain>` |
| `PUBLIC_SANDBOX_URL` | per request | Optional sandbox traffic base URL, reachable from both the browser and server |
| `E2B_INFRA_API_URL` / `E2B_DASHBOARD_API_URL` | server start | Optional server-side API URLs; override domain-derived URLs |
| `E2B_INFRA_API_URL` | server start | Optional server-side API URL; overrides the domain-derived URL |
| `DASHBOARD_COOKIE_SECURE` | server start | `false` only for a plain-http install; the API key cookie then travels unencrypted. Defaults to secure in production builds |

Set `PUBLIC_E2B_DOMAIN` when starting the container. Next does not give
Expand All @@ -50,11 +49,10 @@ set, even if the new name is also present.
|---|---|
| `NEXT_PUBLIC_E2B_DOMAIN` | `PUBLIC_E2B_DOMAIN` |
| `NEXT_PUBLIC_INFRA_API_URL` | `E2B_INFRA_API_URL` |
| `NEXT_PUBLIC_DASHBOARD_API_URL` | `E2B_DASHBOARD_API_URL` |
| `NEXT_PUBLIC_E2B_SANDBOX_URL` / `E2B_SANDBOX_URL` | `PUBLIC_SANDBOX_URL` |

API URL overrides remain optional; without them the domain determines both
API URLs. An absent or blank `PUBLIC_SANDBOX_URL` lets the SDK use domain
The API URL override remains optional; without it the domain determines the
API URL. An absent or blank `PUBLIC_SANDBOX_URL` lets the SDK use domain
routing.

Every API or sandbox URL must include `http://` or `https://`. The schema in
Expand Down Expand Up @@ -109,8 +107,8 @@ bun install
3. Set up environment variables
```bash
cp .env.example .env
# set PUBLIC_E2B_DOMAIN (and optionally E2B_INFRA_API_URL /
# E2B_DASHBOARD_API_URL) to point at your infrastructure
# set PUBLIC_E2B_DOMAIN (and optionally E2B_INFRA_API_URL) to point at
# your infrastructure
```

4. Start the development server
Expand Down Expand Up @@ -151,9 +149,8 @@ docker run --rm -p 3001:3001 \
`PUBLIC_E2B_DOMAIN` fails validation.
- The build needs outbound HTTPS for the three Google Fonts families in
`src/app/fonts.ts`; an air-gapped build fails there.
- `GET /api/health` reports dashboard-api's health and answers 503 while
dashboard-api is unreachable, so use `GET /` as the container liveness
check.
- `GET /api/health` reports infra-api's health and answers 503 while
infra-api is unreachable, so use `GET /` as the container liveness check.
- `scripts/container-smoke.sh` builds the image and asserts those responses.

## Scripts
Expand All @@ -166,7 +163,6 @@ docker run --rm -p 3001:3001 \
| `bun run test:integration` | Integration tests |
| `bun run lint` / `bun run format` | Biome lint / format |
| `bun run generate:infra` | Regenerate infra-api contract types from `spec/` |
| `bun run generate:dashboard-api` | Regenerate dashboard-api contract types from `spec/` |

## Releases

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"prebuild": "bun scripts:check-app-env",
"<<<<<<< Gen": "",
"generate:infra": "bunx openapi-typescript ./spec/openapi.infra.yaml -o ./src/core/shared/contracts/infra-api.types.ts",
"generate:dashboard-api": "bunx openapi-typescript ./spec/openapi.dashboard-api.yaml -o ./src/core/shared/contracts/dashboard-api.types.ts",
"<<<<<<< Scripts": "",
"scripts:check-app-env": "bun scripts/check-app-env.ts",
"<<<<<<< Development": "",
Expand Down
8 changes: 3 additions & 5 deletions scripts/container-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ check "GET /sandboxes redirects to the key form" 307 \
check "GET /sandboxes redirect target" "http://127.0.0.1:${PORT}/?returnTo=%2Fsandboxes" \
"$(curl -sS -o /dev/null -w '%{redirect_url}' "http://127.0.0.1:${PORT}/sandboxes")"

# /api/health probes dashboard-api, which this run does not provide, so 503 is
# the correct answer here and proves route handlers are being served.
check "GET /api/health without a dashboard-api" 503 \
# /api/health probes infra-api, which never resolves under smoke.invalid, so 503
# is the correct answer here and proves route handlers are being served.
check "GET /api/health without an infra-api" 503 \
"$(curl -sS -o /dev/null -w '%{http_code}' "http://127.0.0.1:${PORT}/api/health")"

if [ "${fail}" != 0 ]; then
Expand Down Expand Up @@ -91,11 +91,9 @@ check_invalid_config() {
check_invalid_config PUBLIC_SANDBOX_URL missing-scheme.example:3002
check_invalid_config PUBLIC_E2B_DOMAIN ''
check_invalid_config E2B_INFRA_API_URL ftp://api.example
check_invalid_config E2B_DASHBOARD_API_URL missing-scheme.example:3010
check_invalid_config E2B_SANDBOX_URL https://sandbox.example
check_invalid_config NEXT_PUBLIC_E2B_DOMAIN old.example
check_invalid_config NEXT_PUBLIC_INFRA_API_URL https://api.old.example
check_invalid_config NEXT_PUBLIC_DASHBOARD_API_URL https://dashboard-api.old.example
check_invalid_config NEXT_PUBLIC_E2B_SANDBOX_URL https://sandbox.old.example
check_invalid_config DASHBOARD_COOKIE_SECURE off

Expand Down
Loading
Loading