{"id":26730287,"url":"https://github.com/bengabp/sandbox","last_synced_at":"2026-05-08T13:43:51.991Z","repository":{"id":284421171,"uuid":"954894113","full_name":"bengabp/sandbox","owner":"bengabp","description":"Run and manage playwright in a sandbox","archived":false,"fork":false,"pushed_at":"2025-03-26T23:10:08.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T23:28:38.641Z","etag":null,"topics":["browser-automation","docker","isolated","playwright","python","sandboxing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengabp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-03-25T19:26:37.000Z","updated_at":"2025-03-26T23:10:10.000Z","dependencies_parsed_at":"2025-03-26T23:28:42.186Z","dependency_job_id":null,"html_url":"https://github.com/bengabp/sandbox","commit_stats":null,"previous_names":["bengabp/playwright-sandboxer","bengabp/sandbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bengabp/sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengabp%2Fsandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengabp%2Fsandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengabp%2Fsandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengabp%2Fsandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengabp","download_url":"https://codeload.github.com/bengabp/sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengabp%2Fsandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31774028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["browser-automation","docker","isolated","playwright","python","sandboxing"],"created_at":"2025-03-27T23:19:13.032Z","updated_at":"2026-04-13T22:33:37.763Z","avatar_url":"https://github.com/bengabp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sandbox\n[![Typing SVG](https://readme-typing-svg.demolab.com?font=Fira+Code\u0026weight=100\u0026size=25\u0026duration=2000\u0026pause=1000\u0026background=000000\u0026center=true\u0026vCenter=true\u0026width=500\u0026height=81\u0026lines=Run+playwright+in+a+sandbox)](https://git.io/typing-svg)\n\n![sb-demo](https://github.com/user-attachments/assets/6f7cd2c6-3bdc-466f-9c46-3e1f2b0ba483)\n\n# :hammer_and_wrench:  Building the sandbox image\nThe sandbox image contains code that automates playwright and wraps its dependencies together. A [base image](https://hub.docker.com/r/bengabp/sandbox) has been used which has poetry, playwright and important packages installed. This also reduces the time it takes for the sb image to build and helps you focus on sandbox code dependencies.\n\n## Libraries in base image\n- x11vnc\n- xvfb\n\n\n\n- poetry\n- playwright (with system dependencies and browsers installed)\n- python 3.11\n- novnc\n- websockify\n\nYou can extend the base image to install additional system dependencies and packages\n\n```bash\n# Building base image\ndocker buildx build -t docker.io/\u003cYOUR-DOCKER-HUB-USERNAME\u003e/sandbox:base\n\n# Building sb(sandbox) image\ndocker buildx build -t sb .\n```\n\n## Reactjs Client Connection\n```typescript\n// Sandbox.tsx\nimport React from 'react';\nimport { useEffect, useRef, useState } from \"react\";\n\nconst WS_URL = \"ws://localhost:3001\"; // WebSocket server running in Docker\nconst VNC_URL = \"http://localhost:6080/vnc.html\"; // noVNC server\n\nconst Sandbox: React.FC = () =\u003e {\n    const ws = useRef\u003cWebSocket | null\u003e(null);\n    const [connected, setConnected] = useState(false);\n  \n    useEffect(() =\u003e {\n      ws.current = new WebSocket(WS_URL);\n      ws.current.onopen = () =\u003e {\n        console.log(\"Connected to WebSocket server\");\n        setConnected(true);\n      };\n      ws.current.onclose = () =\u003e {\n        console.log(\"WebSocket disconnected\");\n        setConnected(false);\n      };\n      ws.current.onerror = (error) =\u003e {\n        console.error(\"WebSocket error:\", error);\n      };\n      return () =\u003e {\n        ws.current?.close();\n      };\n    }, []);\n  \n    return (\n      \u003cdiv style={{ textAlign: \"center\" }}\u003e\n        \u003ch2\u003eRemote Browser Control\u003c/h2\u003e\n        \u003cp\u003eStatus: {connected ? \"🟢 Connected\" : \"🔴 Disconnected\"}\u003c/p\u003e\n        \u003ciframe\n          src={VNC_URL}\n          width=\"1920px\"\n          height=\"1080px\"\n          style={{ border: \"1px solid black\" }}\n        /\u003e\n      \u003c/div\u003e\n    );\n}\nexport default Sandbox;\n```\n\n# Api\nThe purpose of the api is to manage sandbox instances and dynamic code injection for new sandboxes.\n## Stack\n- Fastapi \u0026 Sqlalchemy - Backend \u0026 ORM\n- Alembic - Database migrations\n- Postgres via NeonDb - Database\n\n## Running alembic migration\n```bash\n# Init alembic\nalembic init alembic\n\n# generate migration scripts\nalembic revision --autogenerate -m \"optional custom name\"\n\n# Apply migration\npoetry run alembic upgrade head\n```\n\n## Running the api\n```bash\n# Install dependencies\npoetry update\n\n# Run api\nuvicorn sandbox.main:app --host 0.0.0.0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengabp%2Fsandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengabp%2Fsandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengabp%2Fsandbox/lists"}