@superhq/shuru 0.4.0 → 0.4.2
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/package.json +1 -1
- package/src/sandbox.ts +7 -0
- package/src/types.ts +5 -0
package/package.json
CHANGED
package/src/sandbox.ts
CHANGED
|
@@ -199,6 +199,7 @@ export function buildArgs(bin: string, opts: StartOptions): string[] {
|
|
|
199
199
|
if (opts.memory) args.push("--memory", String(opts.memory));
|
|
200
200
|
if (opts.diskSize) args.push("--disk-size", String(opts.diskSize));
|
|
201
201
|
if (opts.allowNet) args.push("--allow-net");
|
|
202
|
+
if (opts.allowHostWrites) args.push("--allow-host-writes");
|
|
202
203
|
|
|
203
204
|
if (opts.secrets) {
|
|
204
205
|
for (const [name, secret] of Object.entries(opts.secrets)) {
|
|
@@ -218,6 +219,12 @@ export function buildArgs(bin: string, opts: StartOptions): string[] {
|
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
|
|
222
|
+
if (opts.exposeHost) {
|
|
223
|
+
for (const e of opts.exposeHost) {
|
|
224
|
+
args.push("--expose-host", e);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
221
228
|
if (opts.mounts) {
|
|
222
229
|
for (const [host, guest] of Object.entries(opts.mounts)) {
|
|
223
230
|
args.push("--mount", `${host}:${guest}`);
|
package/src/types.ts
CHANGED
|
@@ -16,7 +16,12 @@ export interface StartOptions {
|
|
|
16
16
|
memory?: number;
|
|
17
17
|
diskSize?: number;
|
|
18
18
|
allowNet?: boolean;
|
|
19
|
+
/** Allow :rw mounts to write to host filesystem. Default: false. */
|
|
20
|
+
allowHostWrites?: boolean;
|
|
19
21
|
ports?: string[];
|
|
22
|
+
/** Host ports to expose to the guest via host.shuru.internal. Format: "HOST:GUEST" or "PORT". */
|
|
23
|
+
exposeHost?: string[];
|
|
24
|
+
/** Directory mounts. Key is host path, value is guest path or guest path with mode suffix (e.g. "/workspace" or "/workspace:rw"). */
|
|
20
25
|
mounts?: Record<string, string>;
|
|
21
26
|
secrets?: Record<string, SecretConfig>;
|
|
22
27
|
network?: NetworkConfig;
|