{"id":50973524,"url":"https://github.com/liut/strata","last_synced_at":"2026-06-19T05:02:04.460Z","repository":{"id":345323759,"uuid":"1185446882","full_name":"liut/strata","owner":"liut","description":"Lightweight Session Sandbox — Isolated Shell via Namespace + Overlayfs","archived":false,"fork":false,"pushed_at":"2026-03-19T03:46:00.000Z","size":148,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T05:53:06.230Z","etag":null,"topics":["ai-agents","bwrap","docker","golang","grpc","linux-namespace","mcp","overlayfs","sandbox","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-18T15:38:01.000Z","updated_at":"2026-03-19T03:46:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/liut/strata","commit_stats":null,"previous_names":["liut/strata"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/liut/strata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liut%2Fstrata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liut%2Fstrata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liut%2Fstrata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liut%2Fstrata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liut","download_url":"https://codeload.github.com/liut/strata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liut%2Fstrata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34517751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","bwrap","docker","golang","grpc","linux-namespace","mcp","overlayfs","sandbox","shell","terminal"],"created_at":"2026-06-19T05:02:01.097Z","updated_at":"2026-06-19T05:02:04.455Z","avatar_url":"https://github.com/liut.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Strata\n\n\u003e Lightweight Session Sandbox — Isolated Shell via Namespace + Overlayfs\n\n[中文版](./README.zh.md)\n\n## Features\n\n- **Lightweight**: Linux Namespace + bubblewrap + fuse-overlayfs\n- **Isolated**: Per-user + per-session with writable overlay layer\n- **Multi-Protocol**: HTTP REST / WebSocket / gRPC / MCP\n- **Persistent**: overlayfs layering, changes don't affect base\n- **Auto Cleanup**: TTL-based session cleanup\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────┐\n│  API Layer (HTTP/WS + gRPC + MCP)           │\n└─────────────────┬───────────────────────────┘\n                  │\n┌─────────────────▼───────────────────────────┐\n│  Session Manager                            │\n│  - GetOrCreate(user, session)               │\n│  - TTL cleanup                              │\n└─────────────────┬───────────────────────────┘\n                  │\n┌─────────────────▼───────────────────────────┐\n│  Isolation Layer                            │\n│  bwrap + overlayfs (fuse-overlayfs)         │\n│  ├── PID/IPC/UTS Namespace                  │\n│  ├── overlay: lower + upper + merged        │\n│  └── PTY (pseudo-terminal)                  │\n└─────────────────────────────────────────────┘\n```\n\n## Quick Start\n\n```bash\n# Check dependencies\n./scripts/check-env.sh\n\n# Build\nmake build\n\n# Run\n./dist/strata\n```\n\n## Usage\n\n```bash\n# Create session\ncurl -X POST http://localhost:2280/api/sessions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"user_id\": \"alice\", \"session_id\": \"task-001\"}'\n\n# Execute command\ncurl -X POST http://localhost:2280/api/sessions/alice/task-001/exec \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"command\": \"ls -la\"}'\n\n# Interactive shell (WebSocket)\nwscat -c 'ws://localhost:2280/api/ws/alice/task-001/shell'\n```\n\n## API\n\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | `/api/sessions` | Create session |\n| DELETE | `/api/sessions/{uid}/{sid}` | Close session |\n| POST | `/api/sessions/{uid}/{sid}/exec` | Execute command |\n| GET | `/api/stats` | Stats |\n| GET | `/api/ws/{uid}/{sid}/shell` | WebSocket |\n\n## MCP\n\nMCP available at `http://localhost:2280/mcp/`\n\nFor AI agents:\n```bash\nnpx tsx scripts/strata-mcp.ts\n```\n\n## Config\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `STRATA_SERVER_ADDR` | `:2280` | Listen address (HOST:PORT combined) |\n| `STRATA_SANDBOX_SESSION_ROOT` | `/tmp/strata/sessions` | Session directory |\n| `STRATA_SANDBOX_SESSION_TTL` | `30m` | Session timeout |\n| `STRATA_SANDBOX_MAX_SESSIONS` | `100` | Max sessions |\n| `STRATA_SANDBOX_OVERLAY_DRIVER` | `fuse` | fuse/kernel/none |\n\nView all: `./dist/strata run --help`\n\n## Identity\n\nAll API endpoints support two identity modes:\n\n**Path-based** (explicit):\n```bash\ncurl -X POST http://localhost:2280/api/sessions/alice/task-001/exec \\\n  -d '{\"command\": \"ls\"}'\n```\n\n**Header-based** (alternative):\n```bash\ncurl -X POST http://localhost:2280/api/sessions/exec \\\n  -H \"X-Owner-Id: alice\" \\\n  -H \"X-Session-Id: task-001\" \\\n  -d '{\"command\": \"ls\"}'\n```\n\nHeader priority is higher than path values.\n\n## Dependencies\n\n### Build Dependencies\n\n| Package | Install |\n|---------|---------|\n| `meson` | `apt install meson` |\n| `libcap-dev` | `apt install libcap-dev` |\n\n### Runtime Dependencies\n\n| Package | Install |\n|---------|---------|\n| `bubblewrap` (bwrap) | Build from [github.com/containers/bubblewrap](https://github.com/containers/bubblewrap) |\n| `fuse-overlayfs` | `apt install fuse-overlayfs` |\n\n### Building bubblewrap\n\n```bash\ngit clone https://github.com/containers/bubblewrap\ncd bubblewrap\nmeson _builddir\nmeson compile -C _builddir\nmeson test -C _builddir\nsudo meson install -C _builddir\nsudo setcap cap_sys_admin+ip /usr/local/bin/bwrap\n```\n\n### Runtime Requirements\n\n- Linux kernel ≥ 5.11\n- Go ≥ 1.25 (build only)\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliut%2Fstrata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliut%2Fstrata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliut%2Fstrata/lists"}