|
| 1 | +# Roo Code GitHub Codespaces Configuration |
| 2 | + |
| 3 | +This directory contains the configuration for running Roo Code in GitHub Codespaces, providing a fully configured development environment with automatic Chrome/Puppeteer dependency installation. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +### Automatic Dependency Installation |
| 8 | + |
| 9 | +- **Chrome Browser**: Google Chrome Stable is automatically installed with all required dependencies |
| 10 | +- **Docker Support**: Docker-in-Docker feature enables containerized browser option |
| 11 | +- **Node.js Environment**: Pre-configured TypeScript/Node.js development container |
| 12 | +- **VS Code Extensions**: Essential extensions are pre-installed |
| 13 | + |
| 14 | +### Browser Tool Support |
| 15 | + |
| 16 | +The configuration ensures the browser tool works seamlessly in Codespaces by: |
| 17 | + |
| 18 | +1. **Automatic Chrome Installation**: Chrome and all its dependencies are installed during container creation |
| 19 | +2. **Dependency Detection**: The extension automatically detects and installs missing dependencies |
| 20 | +3. **Docker Fallback**: If Chrome fails, Docker browser container can be used as fallback |
| 21 | +4. **Environment Variables**: Proper configuration for Puppeteer to use system Chrome |
| 22 | + |
| 23 | +## Configuration Options |
| 24 | + |
| 25 | +### Docker Browser (Optional) |
| 26 | + |
| 27 | +You can enable Docker-based browser isolation in VS Code settings: |
| 28 | + |
| 29 | +```json |
| 30 | +{ |
| 31 | + "roo-cline.browserDocker.enabled": true, |
| 32 | + "roo-cline.browserDocker.image": "browserless/chrome:latest", |
| 33 | + "roo-cline.browserDocker.autoStart": true |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +### Benefits of Docker Browser |
| 38 | + |
| 39 | +- **Isolation**: Browser runs in a separate container |
| 40 | +- **Consistency**: Same browser environment across all systems |
| 41 | +- **No Dependencies**: No need to install Chrome dependencies on host |
| 42 | +- **Security**: Enhanced security through containerization |
| 43 | + |
| 44 | +## Troubleshooting |
| 45 | + |
| 46 | +### Browser Tool Not Working? |
| 47 | + |
| 48 | +1. **Check Chrome Installation**: |
| 49 | + |
| 50 | + ```bash |
| 51 | + google-chrome --version |
| 52 | + # or |
| 53 | + google-chrome-stable --version |
| 54 | + ``` |
| 55 | + |
| 56 | +2. **Test Chrome Headless**: |
| 57 | + |
| 58 | + ```bash |
| 59 | + google-chrome --headless --no-sandbox --disable-gpu --dump-dom https://example.com |
| 60 | + ``` |
| 61 | + |
| 62 | +3. **Check Missing Dependencies**: |
| 63 | + |
| 64 | + ```bash |
| 65 | + ldd $(which google-chrome) | grep "not found" |
| 66 | + ``` |
| 67 | + |
| 68 | +4. **Install Missing Dependencies Manually**: |
| 69 | + |
| 70 | + ```bash |
| 71 | + sudo apt-get update |
| 72 | + sudo apt-get install -y \ |
| 73 | + libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ |
| 74 | + libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 \ |
| 75 | + libxrandr2 libgbm1 libasound2 |
| 76 | + ``` |
| 77 | + |
| 78 | +5. **Use Docker Browser as Fallback**: |
| 79 | + - Enable Docker browser in settings (see Configuration Options above) |
| 80 | + - Ensure Docker is running: `docker info` |
| 81 | + - The extension will automatically use Docker if Chrome fails |
| 82 | + |
| 83 | +### Docker Issues? |
| 84 | + |
| 85 | +1. **Check Docker Status**: |
| 86 | + |
| 87 | + ```bash |
| 88 | + docker info |
| 89 | + ``` |
| 90 | + |
| 91 | +2. **Pull Browser Image Manually**: |
| 92 | + |
| 93 | + ```bash |
| 94 | + docker pull browserless/chrome:latest |
| 95 | + ``` |
| 96 | + |
| 97 | +3. **Test Docker Browser**: |
| 98 | + ```bash |
| 99 | + docker run -d --name test-browser -p 3000:3000 browserless/chrome:latest |
| 100 | + # Visit http://localhost:3000 to verify |
| 101 | + docker stop test-browser && docker rm test-browser |
| 102 | + ``` |
| 103 | + |
| 104 | +## Files in This Directory |
| 105 | + |
| 106 | +- **devcontainer.json**: Main configuration file for the dev container |
| 107 | +- **post-create.sh**: Script that runs after container creation (installs dependencies) |
| 108 | +- **post-start.sh**: Script that runs each time the container starts (verifies setup) |
| 109 | +- **README.md**: This documentation file |
| 110 | + |
| 111 | +## How It Works |
| 112 | + |
| 113 | +1. **Container Creation**: When you create a Codespace, it uses the TypeScript/Node.js base image |
| 114 | +2. **Feature Installation**: Docker-in-Docker and Chrome features are installed |
| 115 | +3. **Post-Create Script**: Installs Chrome dependencies and builds the project |
| 116 | +4. **Post-Start Script**: Verifies the environment on each container start |
| 117 | +5. **Automatic Detection**: The extension detects the Codespace environment and adapts accordingly |
| 118 | + |
| 119 | +## Environment Variables |
| 120 | + |
| 121 | +The following environment variables are set automatically: |
| 122 | + |
| 123 | +- `CODESPACES=true`: Indicates running in GitHub Codespaces |
| 124 | +- `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true`: Prevents Puppeteer from downloading Chromium |
| 125 | +- `PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable`: Points Puppeteer to system Chrome |
| 126 | + |
| 127 | +## Support |
| 128 | + |
| 129 | +If you encounter issues with the browser tool in Codespaces: |
| 130 | + |
| 131 | +1. Check the troubleshooting section above |
| 132 | +2. Review the post-start script output for warnings |
| 133 | +3. Report issues at: https://github.com/RooCodeInc/Roo-Code/issues |
0 commit comments