sandboxbox 2.2.2 → 2.2.4
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/CLAUDE.md +9 -0
- package/package.json +1 -1
- package/sandboxbox-2.2.2.tgz +0 -0
- package/utils/podman.js +34 -44
package/CLAUDE.md
CHANGED
@@ -74,6 +74,15 @@ if (process.platform === 'win32' && isBundled) {
|
|
74
74
|
- **Configuration**: All machines initialized with `--rootful=false` flag
|
75
75
|
- **Benefits**: No elevated permissions required, better security, true portability
|
76
76
|
|
77
|
+
### Portable Podman Architecture
|
78
|
+
- **Direct Podman Execution**: Uses bundled Podman binary without complex machine management
|
79
|
+
- **Rootless Operation**: Always runs in rootless mode for portability (--rootful=false)
|
80
|
+
- **Self-Contained**: All dependencies included in the package
|
81
|
+
- **Simple Configuration**: Minimal backend setup only when needed
|
82
|
+
- **Auto-Download**: Downloads platform-specific binaries automatically
|
83
|
+
- **NPX Compatible**: Works via npx without global installation
|
84
|
+
- **Windows Podman Remote**: Uses podman-remote-release-windows_amd64.zip as portable client
|
85
|
+
|
77
86
|
## Isolation Architecture
|
78
87
|
|
79
88
|
### Workflow
|
package/package.json
CHANGED
Binary file
|
package/utils/podman.js
CHANGED
@@ -37,43 +37,7 @@ export function checkPodman() {
|
|
37
37
|
};
|
38
38
|
|
39
39
|
const version = execSync(`"${podmanPath}" --version`, execOptions).trim();
|
40
|
-
|
41
|
-
// Auto-manage Podman machine on Windows
|
42
|
-
if (process.platform === 'win32' && isBundled) {
|
43
|
-
try {
|
44
|
-
execSync(`"${podmanPath}" info`, { ...execOptions, stdio: 'pipe' });
|
45
|
-
} catch (infoError) {
|
46
|
-
if (infoError.message.includes('Cannot connect to Podman')) {
|
47
|
-
console.log('\n🔧 Podman machine not running, auto-initializing...');
|
48
|
-
|
49
|
-
try {
|
50
|
-
execSync(`"${podmanPath}" machine start`, {
|
51
|
-
stdio: 'inherit',
|
52
|
-
cwd: __dirname,
|
53
|
-
shell: process.platform === 'win32'
|
54
|
-
});
|
55
|
-
console.log('\n✅ Podman machine started successfully in rootless mode!');
|
56
|
-
} catch (startError) {
|
57
|
-
if (startError.message.includes('not found') || startError.message.includes('does not exist')) {
|
58
|
-
execSync(`"${podmanPath}" machine init --rootful=false`, {
|
59
|
-
stdio: 'inherit',
|
60
|
-
cwd: __dirname,
|
61
|
-
shell: process.platform === 'win32'
|
62
|
-
});
|
63
|
-
execSync(`"${podmanPath}" machine start`, {
|
64
|
-
stdio: 'inherit',
|
65
|
-
cwd: __dirname,
|
66
|
-
shell: process.platform === 'win32'
|
67
|
-
});
|
68
|
-
console.log('\n✅ Podman machine initialized and started in rootless mode!');
|
69
|
-
} else {
|
70
|
-
throw startError;
|
71
|
-
}
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
40
|
+
console.log(color('green', `✅ ${version}${isBundled ? ' (bundled)' : ''}`));
|
77
41
|
return podmanPath;
|
78
42
|
} catch (error) {
|
79
43
|
console.log('❌ Podman not found');
|
@@ -97,23 +61,49 @@ export function checkPodman() {
|
|
97
61
|
const newVersion = execSync(`"${newPodmanPath}" --version`, execOptions).trim();
|
98
62
|
console.log(`\n✅ ${newVersion} (auto-downloaded)`);
|
99
63
|
|
100
|
-
|
64
|
+
// Auto-setup minimal backend for Windows portable operation
|
65
|
+
if (process.platform === 'win32' && isBundled) {
|
101
66
|
try {
|
102
67
|
execSync(`"${newPodmanPath}" info`, { ...execOptions, stdio: 'pipe' });
|
103
68
|
} catch (infoError) {
|
104
69
|
if (infoError.message.includes('Cannot connect to Podman')) {
|
105
|
-
console.log('\n🔧
|
70
|
+
console.log('\n🔧 Setting up portable Podman backend...');
|
106
71
|
try {
|
107
|
-
|
108
|
-
execSync(`"${newPodmanPath}" machine start`, {
|
109
|
-
|
110
|
-
|
111
|
-
|
72
|
+
// Try to start existing machine first
|
73
|
+
execSync(`"${newPodmanPath}" machine start`, {
|
74
|
+
stdio: 'inherit',
|
75
|
+
shell: true,
|
76
|
+
cwd: __dirname
|
77
|
+
});
|
78
|
+
console.log('\n✅ Portable Podman backend started!');
|
79
|
+
} catch (startError) {
|
80
|
+
if (startError.message.includes('does not exist') || startError.message.includes('not found')) {
|
81
|
+
try {
|
82
|
+
// Create new machine if none exists
|
83
|
+
execSync(`"${newPodmanPath}" machine init --rootful=false`, {
|
84
|
+
stdio: 'inherit',
|
85
|
+
shell: true,
|
86
|
+
cwd: __dirname
|
87
|
+
});
|
88
|
+
execSync(`"${newPodmanPath}" machine start`, {
|
89
|
+
stdio: 'inherit',
|
90
|
+
shell: true,
|
91
|
+
cwd: __dirname
|
92
|
+
});
|
93
|
+
console.log('\n✅ Portable Podman backend created and started!');
|
94
|
+
} catch (initError) {
|
95
|
+
console.log('\n⚠️ Podman backend setup needed on first container run');
|
96
|
+
}
|
97
|
+
} else {
|
98
|
+
console.log('\n⚠️ Podman backend setup needed on first container run');
|
99
|
+
}
|
112
100
|
}
|
113
101
|
}
|
114
102
|
}
|
115
103
|
}
|
116
104
|
|
105
|
+
console.log('\n✅ Portable Podman ready');
|
106
|
+
|
117
107
|
return newPodmanPath;
|
118
108
|
} catch (downloadError) {
|
119
109
|
console.log(`\n❌ Auto-download failed: ${downloadError.message}`);
|