Skip to content
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c3c80c6
remove: envd gen + chore: fix test ts issues
ben-fornefeld Jun 12, 2025
8454a21
chore: move/rename server context
ben-fornefeld Jun 13, 2025
4ca841c
add: fs context,store & events-manager
ben-fornefeld Jun 13, 2025
4c3ff78
update: e2b sdk to fix isolatedModules errors
ben-fornefeld Jun 13, 2025
1abe664
chore: rename feature folder
ben-fornefeld Jun 13, 2025
6250725
chore: rename context
ben-fornefeld Jun 13, 2025
3243011
add: sandbox context
ben-fornefeld Jun 13, 2025
97fd559
chore: re-organize files
ben-fornefeld Jun 13, 2025
9f7ccb0
refactor: move sandbox connection to sandbox context
ben-fornefeld Jun 13, 2025
57d53c0
chore: syntax
ben-fornefeld Jun 13, 2025
7ce857e
improve: watchHandle event handling
ben-fornefeld Jun 13, 2025
f37c626
add: mermaid overview chart
ben-fornefeld Jun 13, 2025
99bd9f3
refactor: mermaid chart
ben-fornefeld Jun 13, 2025
364dbdc
chore: cleanup mermaid chart
ben-fornefeld Jun 13, 2025
01b2083
refactor: sandbox inspect application layer to use a single watch han…
ben-fornefeld Jun 18, 2025
fbea1c6
refactor: prepare state layer for react
ben-fornefeld Jun 18, 2025
b3714a0
refactor: server side sandbox connection handling
ben-fornefeld Jun 20, 2025
27c2f01
chore: reduce watch route timeout to 10 min
ben-fornefeld Jun 20, 2025
2bda457
chore: re-organize/comment pools
ben-fornefeld Jun 20, 2025
a52f616
fix: correctly close SandboxPool connections in WatchDirPool and callers
ben-fornefeld Jun 20, 2025
15fbe44
refactor: inspect context to correctly populate store based on seedEn…
ben-fornefeld Jun 20, 2025
b98f927
feat: add E2B_DOMAIN to environment configuration and enhance watch r…
ben-fornefeld Jun 20, 2025
7e0665f
fix: missing test env
ben-fornefeld Jun 23, 2025
ee28b6f
improve: loggign & watchDir release in watch route
ben-fornefeld Jun 23, 2025
4391c6a
improve: sandbox inspect watch route and pooling
ben-fornefeld Jun 23, 2025
7531f78
refactor: handle sandbox connection client side but fetch root + deta…
ben-fornefeld Jun 24, 2025
528d267
remove: rename E2B_DOMAIN env to NEXT_PUBLIC_E2B_DOMAIN for client si…
ben-fornefeld Jun 24, 2025
dfb18dd
fix: connect to correct sandboxId on client and pass secure connectio…
ben-fornefeld Jun 24, 2025
90b2b40
feat: load directory debounce and unlimited watchDir timeout
ben-fornefeld Jun 24, 2025
5363cec
feat: add sorting direction state and normalize order on node insert …
ben-fornefeld Jun 24, 2025
fbac823
chore: update e2b sdk
ben-fornefeld Jun 24, 2025
a3bb3f5
fix: missing test env
ben-fornefeld Jun 24, 2025
6d41d94
fix: debounce to not act as a delay on first call
ben-fornefeld Jun 25, 2025
5ed78d0
chore: clean up sandbox root fetch
ben-fornefeld Jun 25, 2025
46281d9
chore: refactor events-manager -> sandbox-manager
ben-fornefeld Jun 30, 2025
3c217a3
chore: clean-up sandbox context
ben-fornefeld Jun 30, 2025
078f144
refactor: sandbox-manager debounce handling
ben-fornefeld Jun 30, 2025
a1f335d
feat: file viewing / content loading state
ben-fornefeld Jun 30, 2025
6b91c0c
refactor: file node selection state + refresh file after write event
ben-fornefeld Jun 30, 2025
a50f99a
refactor: selection / state
ben-fornefeld Jun 30, 2025
8d098f4
feat: add content / file hooks
ben-fornefeld Jun 30, 2025
446cffb
refactor: await file read after selection
ben-fornefeld Jun 30, 2025
345074e
refactor: ensure file / node states are using separate store props
ben-fornefeld Jun 30, 2025
e550d5f
fix: useFile return
ben-fornefeld Jun 30, 2025
f6e5b70
refactor: handle different file content encodings
ben-fornefeld Jul 1, 2025
c2c9662
fix: stable reference children caching
ben-fornefeld Jul 1, 2025
bfa119b
refactor: filesystem store
ben-fornefeld Jul 1, 2025
5c26e97
feat: add resetSelected operation and update file selection logic
ben-fornefeld Jul 2, 2025
25162d8
chore: move file content state logic to filesystem utility and remove…
ben-fornefeld Jul 2, 2025
2d67890
fix: update import path for determineFileContentState to filesystem u…
ben-fornefeld Jul 2, 2025
ffa1c1f
feat: implement debounced file read logic in SandboxManager
ben-fornefeld Jul 3, 2025
b5e0184
feat: add file download functionality and improve file content state …
ben-fornefeld Jul 3, 2025
966d09f
feat: enhance error handling in SandboxManager with user-friendly mes…
ben-fornefeld Jul 3, 2025
225add9
feat: implement loaded state management for filesystem nodes in Sandb…
ben-fornefeld Jul 3, 2025
a868d92
fix: update useFilesystemNode hook to return undefined instead of thr…
ben-fornefeld Jul 3, 2025
22b9877
refactor: improve directory loading state management in SandboxInspec…
ben-fornefeld Jul 3, 2025
776a5b7
fix: enhance user feedback for aborted requests in SandboxManager err…
ben-fornefeld Jul 3, 2025
d7c039b
fix: update file download logic to use node name and open in new tab
ben-fornefeld Jul 3, 2025
ada637d
fix: update file reading logic in SandboxManager to use blob format a…
ben-fornefeld Jul 3, 2025
7536f91
chore: remove outdated overview diagram from dashboard sandbox
ben-fornefeld Jul 3, 2025
97cc291
fix: enhance error handling in SandboxManager to detect directory-rel…
ben-fornefeld Jul 7, 2025
1142756
feat: add Content Security Policy header to enhance security in Next.…
ben-fornefeld Jul 15, 2025
a028a85
refactor: move fumadocs roots to archive + add env configs for CSP he…
ben-fornefeld Jul 19, 2025
c8a2483
fix: add Supabase URL to CSP img-src directive
ben-fornefeld Jul 19, 2025
3947550
chore: add GitHub and Google avatar URLs to CSP image sources
ben-fornefeld Jul 19, 2025
3cbcfb2
chore: configure ESLint directories and clean up TypeScript paths
ben-fornefeld Jul 19, 2025
d1608e0
feat: add frame-src CSP header support with configurable sources
ben-fornefeld Jul 19, 2025
76e6785
chore: remove deprecated files and clean up archive structure
ben-fornefeld Jul 28, 2025
c5cc1a2
Apply suggestion from @Copilot
ben-fornefeld Jul 29, 2025
960e960
chore: remove optional Content Security Policy configurations from en…
ben-fornefeld Jul 30, 2025
ef175af
Merge branch 'implement-application-layer-and-state-abstractions-e2b-…
ben-fornefeld Jul 30, 2025
392c71d
chore: add 'pathe' dependency and refactor path utility functions for…
ben-fornefeld Jul 30, 2025
b0732b9
feat: enhance SandboxManager to support secure sandbox environments w…
ben-fornefeld Jul 30, 2025
cde833b
feat: enhance SandboxManager to support secure sandbox environments w…
ben-fornefeld Jul 30, 2025
b73c04d
refactor: simplify setSelected method in SandboxInspectProvider and u…
ben-fornefeld Jul 30, 2025
c6f88ea
chore: update tsconfig.json to remove 'archive' from excluded directo…
ben-fornefeld Jul 30, 2025
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
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
### Visit: https://github.com/e2b-dev/infra/blob/main/README.md for a self-hosting guide
INFRA_API_URL=https://api.e2b.dev

### Default domain for the E2B SDK
### Used for Sandbox Details Page
NEXT_PUBLIC_E2B_DOMAIN=e2b.dev

### KV database configuration
KV_REST_API_TOKEN=
KV_REST_API_URL=
Expand All @@ -21,6 +25,15 @@ KV_REST_API_URL=
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key

### =================================
### OPTIONAL CONTENT SECURITY POLICY
### =================================
### Example: https://e2b.dev *.e2b.dev
CSP_SCRIPT_SRC=
CSP_STYLE_SRC=
CSP_IMG_SRC=https://avatars.githubusercontent.com https://lh3.googleusercontent.com
CSP_FRAME_SRC=https://vercel.live

### =================================
### OPTIONAL SERVER ENVIRONMENT VARIABLES
### =================================
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
archive/
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
SUPABASE_SERVICE_ROLE_KEY: test-service-role-key
INFRA_API_URL: https://api.e2b-test.dev
BILLING_API_URL: https://billing.e2b-test.dev
NEXT_PUBLIC_E2B_DOMAIN: e2b-test.dev
NEXT_PUBLIC_POSTHOG_KEY: test-posthog-key
NEXT_PUBLIC_SUPABASE_URL: https://test-supabase-url.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY: test-supabase-anon-key
Expand Down
119 changes: 44 additions & 75 deletions bun.lock

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import { withSentryConfig } from '@sentry/nextjs'
import { createMDX } from 'fumadocs-mdx/next'

const withMDX = createMDX()

const cspHeader = `
Comment thread
ben-fornefeld marked this conversation as resolved.
Outdated
default-src 'self';
script-src 'self' 'unsafe-eval' 'unsafe-inline' ${process.env.CSP_SCRIPT_SRC};
style-src 'self' 'unsafe-inline' ${process.env.CSP_STYLE_SRC};
img-src 'self' data: ${process.env.NEXT_PUBLIC_SUPABASE_URL} ${process.env.CSP_IMG_SRC};
frame-src 'self' ${process.env.CSP_FRAME_SRC};
font-src 'self';
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
worker-src 'self' blob: ${process.env.CSP_SCRIPT_SRC};
upgrade-insecure-requests;
`

/** @type {import('next').NextConfig} */
const config = {
eslint: {
dirs: ['src', 'scripts'], // Only run ESLint on these directories during production builds
},
reactStrictMode: true,
experimental: {
reactCompiler: true,
Expand All @@ -26,7 +42,7 @@ const config = {
trailingSlash: false,
headers: async () => [
{
source: '/:path*',
source: '/(.*)',
headers: [
{
// config to prevent the browser from rendering the page inside a frame or iframe and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
Expand All @@ -35,6 +51,15 @@ const config = {
},
],
},
{
source: '/dashboard/(.*)',
headers: [
{
key: 'Content-Security-Policy',
value: cspHeader.replace(/\n/g, ''),
},
],
},
],
rewrites: async () => [
{
Expand Down Expand Up @@ -95,7 +120,7 @@ const config = {
skipTrailingSlashRedirect: true,
}

export default withSentryConfig(withMDX(config), {
export default withSentryConfig(config, {
// For all available options, see:
// https://www.npmjs.com/package/@sentry/webpack-plugin#options

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"<<<<<< Gen": "",
"generate:infra": "bunx openapi-typescript ./spec/openapi.yaml -o ./src/types/infra-api.d.ts",
"generate:supabase": "bunx supabase@latest gen types typescript --schema public > src/types/database.types.ts --project-id $SUPABASE_PROJECT_ID",
"generate:envd": "buf generate --template ./spec/envd/buf.gen.yaml",
"<<<<<< Scripts": "",
"scripts:check-app-env": "bun scripts/check-app-env.ts",
"scripts:check-e2e-env": "bun scripts/check-e2e-env.ts",
Expand All @@ -27,7 +26,6 @@
"<<<<<< Development": "",
"shad": "bunx shadcn@canary",
"prebuild": "bun scripts:check-app-env",
"postinstall": "fumadocs-mdx",
"<<<<<< Testing": "",
"test:run": "bun scripts:check-all-env && vitest run",
"test:integration": "bun scripts:check-app-env && vitest run src/__test__/integration/",
Expand All @@ -38,7 +36,6 @@
"test:development:metrics": "vitest run src/__test__/development/metrics.test.ts"
},
"dependencies": {
"@connectrpc/connect": "^2.0.2",
"@fumadocs/mdx-remote": "^1.2.0",
"@google-cloud/storage": "^7.15.2",
"@hookform/resolvers": "^3.10.0",
Expand Down Expand Up @@ -81,6 +78,7 @@
"clsx": "^2.1.1",
"cmdk": "^1.0.4",
"date-fns": "^4.1.0",
"e2b": "^1.7.1",
"fast-xml-parser": "^4.5.1",
"fumadocs-core": "^15.0.6",
"fumadocs-mdx": "^11.5.3",
Expand Down Expand Up @@ -141,7 +139,6 @@
"autoprefixer": "^10.4.20",
"babel-plugin-react-compiler": "^19.1.0-rc.2",
"drizzle-kit": "^0.30.3",
"e2b": "^1.7.1",
"eslint": "^9.19.0",
"eslint-config-next": "^15.1.6",
"eslint-config-prettier": "^10.0.1",
Expand Down
61 changes: 0 additions & 61 deletions source.config.ts

This file was deleted.

21 changes: 0 additions & 21 deletions spec/envd/buf.gen.yaml

This file was deleted.

124 changes: 0 additions & 124 deletions spec/envd/filesystem/filesystem.proto

This file was deleted.

Loading