Spaces:
Sleeping
Sleeping
metadata
title: Landrun Sandbox + Browser Automation
emoji: π
colorFrom: purple
colorTo: blue
sdk: docker
app_file: app.py
pinned: false
license: mit
π Landrun Sandbox + Browser Automation
Kernel-Level Code Execution Sandbox with Automated UI Testing
Execute code with maximum security using Landrun (Linux Landlock kernel security) and automatically test UIs with Playwright browser automation.
Features
Landrun Security
- Kernel-level isolation using Linux Landlock LSM
- Zero-trust execution with restricted filesystem access
- Read-only system files - only /tmp/sandbox is writable
- Network restrictions - only HTTP/HTTPS allowed
- 10-second timeout protection
Browser Automation
- Playwright Chromium for automated UI testing
- Screenshot capture before/after actions
- Element interaction - click, type, wait, get text
- One-shot API - execute code and test UI in single call
Supported Languages
- Python 3.11 with stdlib + compilers
- JavaScript Node.js server-side execution
- React JSX client-side components with live preview
- HTML + CSS static pages with full styling
API Endpoints
POST /execute
Execute code in sandbox and get preview URL
GET /preview/{uuid}
Get live HTML preview of executed code
POST /browser/test
Test existing preview with browser automation
POST /browser/execute_and_test
Execute code and test UI in single call (one-shot)
Quick Start
Python example:
- Execute React code with browser automation
- Click buttons and capture screenshots
- Get test results with base64 screenshots
Security
- Landrun Sandbox: Kernel-level isolation using Linux Landlock
- Read-only: /usr, /lib, /etc are read-only
- Writable: Only /tmp/sandbox is writable
- Network: TCP ports 80, 443 only
- Timeout: 10 seconds max execution
- Browser: Headless Chromium with 5s action timeout
Technology Stack
- Landrun: Go-based Linux Landlock sandbox
- FastAPI: Modern async Python web framework
- Playwright: Browser automation framework
- Chromium: Headless browser engine
- Docker: Multi-stage container build
- Python 3.11: Runtime environment with compilers
- Node.js: JavaScript execution
Browser Actions
Available actions: click, type, get_text, wait, screenshot
License
MIT License
Links
- Live Demo: https://speedofmastery-hmm.hf.space
- Landrun GitHub: https://github.com/zouuup/landrun
- Playwright Docs: https://playwright.dev