sandboxbox 1.2.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -99
- package/cli.js +125 -162
- package/package.json +11 -12
- package/BUBBLEWRAP-REALITY.md +0 -210
- package/Dockerfile.test +0 -16
- package/USAGE.md +0 -111
- package/bin/bwrap +0 -0
- package/build-final.log +0 -2217
- package/build-output.log +0 -289
- package/complete-build.log +0 -231
- package/container.js +0 -847
- package/debug-cli.js +0 -15
- package/final-build.log +0 -268
- package/final-complete-build.log +0 -240
- package/full-build.log +0 -234
- package/init-firewall.sh +0 -36
- package/lib/bubblewrap.js +0 -203
- package/npm-build-test.log +0 -410
- package/playwright.sh +0 -183
- package/run.sh +0 -12
- package/sandboxbox-sandbox/build.sh +0 -83
- package/scripts/build.js +0 -303
- package/scripts/download-bubblewrap.js +0 -186
- package/test-cli.js +0 -72
- package/test-project/Dockerfile.sandboxbox +0 -20
package/USAGE.md
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
# SandboxBox Usage Guide
|
2
|
-
|
3
|
-
## 🚀 Super Simple Usage
|
4
|
-
|
5
|
-
### Install (One-time)
|
6
|
-
```bash
|
7
|
-
# Install bubblewrap (requires sudo ONCE)
|
8
|
-
sudo apt-get install bubblewrap
|
9
|
-
```
|
10
|
-
|
11
|
-
### Use Anywhere (3 ways)
|
12
|
-
|
13
|
-
#### 1. npx (Recommended)
|
14
|
-
```bash
|
15
|
-
npx sandboxbox setup # Setup Alpine environment
|
16
|
-
npx sandboxbox quick-test ./my-project # Quick test with sample Dockerfile
|
17
|
-
npx sandboxbox run ./my-project # Run Playwright tests
|
18
|
-
```
|
19
|
-
|
20
|
-
#### 2. Local script
|
21
|
-
```bash
|
22
|
-
./run.sh setup
|
23
|
-
./run.sh quick-test ./my-project
|
24
|
-
./run.sh run ./my-project
|
25
|
-
```
|
26
|
-
|
27
|
-
#### 3. Direct Node.js
|
28
|
-
```bash
|
29
|
-
node cli.js setup
|
30
|
-
node cli.js quick-test ./my-project
|
31
|
-
node cli.js run ./my-project
|
32
|
-
```
|
33
|
-
|
34
|
-
## 📋 Available Commands
|
35
|
-
|
36
|
-
| Command | What it does |
|
37
|
-
|---------|-------------|
|
38
|
-
| `setup` | Downloads Alpine Linux + installs Playwright dependencies |
|
39
|
-
| `build <dockerfile>` | Builds container from Dockerfile |
|
40
|
-
| `run <project>` | Runs Playwright tests in isolation |
|
41
|
-
| `shell <project>` | Interactive shell in container |
|
42
|
-
| `quick-test <project>` | Creates sample Dockerfile + runs tests |
|
43
|
-
| `version` | Shows version info |
|
44
|
-
|
45
|
-
## ⚡ Quick Test Example
|
46
|
-
|
47
|
-
```bash
|
48
|
-
# Any project directory
|
49
|
-
mkdir my-test && cd my-test
|
50
|
-
|
51
|
-
# One command does everything:
|
52
|
-
npx sandboxbox quick-test .
|
53
|
-
|
54
|
-
# This creates:
|
55
|
-
# - Dockerfile.sandboxbox (sample Dockerfile)
|
56
|
-
# - Runs tests in isolated environment
|
57
|
-
```
|
58
|
-
|
59
|
-
## 🎯 Sample Dockerfile (auto-generated)
|
60
|
-
|
61
|
-
```dockerfile
|
62
|
-
FROM alpine
|
63
|
-
|
64
|
-
RUN apk add --no-cache nodejs npm
|
65
|
-
WORKDIR /app
|
66
|
-
COPY package*.json ./
|
67
|
-
RUN if [ -f package.json ]; then npm install; fi
|
68
|
-
COPY . .
|
69
|
-
CMD ["npm", "test"]
|
70
|
-
```
|
71
|
-
|
72
|
-
## 🏗️ Build Custom Dockerfile
|
73
|
-
|
74
|
-
```bash
|
75
|
-
# Your custom Dockerfile
|
76
|
-
npx sandboxbox build ./MyDockerfile
|
77
|
-
|
78
|
-
# Run the built container
|
79
|
-
npx sandboxbox run ./my-project
|
80
|
-
```
|
81
|
-
|
82
|
-
## 📦 As npm dependency
|
83
|
-
|
84
|
-
```bash
|
85
|
-
# Add to your project
|
86
|
-
npm install sandboxbox
|
87
|
-
|
88
|
-
# Use in package.json scripts
|
89
|
-
{
|
90
|
-
"scripts": {
|
91
|
-
"test:isolated": "sandboxbox run .",
|
92
|
-
"test:container": "sandboxbox quick-test ."
|
93
|
-
}
|
94
|
-
}
|
95
|
-
```
|
96
|
-
|
97
|
-
## 💡 Benefits
|
98
|
-
|
99
|
-
- ✅ **8ms startup** (37x faster than Docker)
|
100
|
-
- ✅ **Zero privileges** after bubblewrap install
|
101
|
-
- ✅ **True isolation** with Linux namespaces
|
102
|
-
- ✅ **Playwright ready** (Chromium testing)
|
103
|
-
- ✅ **Works anywhere** (no Docker required)
|
104
|
-
|
105
|
-
## 🔧 Requirements
|
106
|
-
|
107
|
-
- **bubblewrap (bwrap)** - Install once with system package manager
|
108
|
-
- **Node.js** - For running the CLI
|
109
|
-
- **No root privileges** - After bubblewrap installation
|
110
|
-
|
111
|
-
That's it! 🎉
|
package/bin/bwrap
DELETED
Binary file
|