gigadrive 2.9.0 → 2.10.1
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/dist/index.cjs +25 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +25 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { Effect as Effect29, Layer, LogLevel, Logger } from "effect";
|
|
|
9
9
|
// package.json
|
|
10
10
|
var package_default = {
|
|
11
11
|
name: "gigadrive",
|
|
12
|
-
version: "2.
|
|
12
|
+
version: "2.10.1",
|
|
13
13
|
repository: {
|
|
14
14
|
type: "git",
|
|
15
15
|
url: "https://github.com/Gigadrive/sdk.git",
|
|
@@ -3062,7 +3062,7 @@ var describeMicroVm = (vm, now = Date.now()) => {
|
|
|
3062
3062
|
`Image: ${vm.image.name}`,
|
|
3063
3063
|
`Size: ${vm.vcpus} vCPU, ${formatMemory(vm.memoryMb)} memory, ${formatMemory(vm.diskMb)} disk`,
|
|
3064
3064
|
`Region: ${vm.region}`,
|
|
3065
|
-
`Network: ${vm.network.egress === "deny" ? "outbound traffic blocked" : "internet access"}`,
|
|
3065
|
+
`Network: ${vm.network.egress === "deny" ? "outbound traffic blocked" : vm.network.allow && vm.network.allow.length > 0 ? `only ${vm.network.allow.join(", ")} (and DNS)` : "internet access"}`,
|
|
3066
3066
|
`Previews: ${vm.network.previews === "private" ? "private (preview token required)" : "public"}`,
|
|
3067
3067
|
`Application: ${vm.applicationId}`,
|
|
3068
3068
|
`Created: ${vm.createdAt}`
|
|
@@ -3330,6 +3330,20 @@ var createInput = (flags) => Effect22.gen(function* () {
|
|
|
3330
3330
|
onNone: () => Effect22.succeed(void 0),
|
|
3331
3331
|
onSome: (text) => parseLifetime("--timeout", text)
|
|
3332
3332
|
});
|
|
3333
|
+
if (flags.denyEgress && flags.allowEgress.length > 0) {
|
|
3334
|
+
return yield* new InvalidMicroVmOptionsError({
|
|
3335
|
+
message: "--allow-egress cannot be combined with --deny-egress."
|
|
3336
|
+
});
|
|
3337
|
+
}
|
|
3338
|
+
if (flags.allowEgress.length > 32) {
|
|
3339
|
+
return yield* new InvalidMicroVmOptionsError({ message: "--allow-egress takes at most 32 networks." });
|
|
3340
|
+
}
|
|
3341
|
+
const badNetwork = flags.allowEgress.find((network) => !/^\d{1,3}(\.\d{1,3}){3}\/\d{1,2}$/.test(network.trim()));
|
|
3342
|
+
if (badNetwork !== void 0) {
|
|
3343
|
+
return yield* new InvalidMicroVmOptionsError({
|
|
3344
|
+
message: `--allow-egress must be an IPv4 network such as 140.82.112.0/20 (got ${badNetwork}).`
|
|
3345
|
+
});
|
|
3346
|
+
}
|
|
3333
3347
|
const badPort = flags.ports.find((port) => !Number.isInteger(port) || port < 1 || port > 65535);
|
|
3334
3348
|
if (badPort !== void 0) {
|
|
3335
3349
|
return yield* new InvalidMicroVmOptionsError({ message: `--port must be between 1 and 65535 (got ${badPort}).` });
|
|
@@ -3348,10 +3362,11 @@ var createInput = (flags) => Effect22.gen(function* () {
|
|
|
3348
3362
|
...flags.ports.length > 0 ? { ports: [...flags.ports] } : {},
|
|
3349
3363
|
...env ? { env } : {},
|
|
3350
3364
|
...metadata ? { metadata } : {},
|
|
3351
|
-
...flags.denyEgress || flags.privatePreviews ? {
|
|
3365
|
+
...flags.denyEgress || flags.privatePreviews || flags.allowEgress.length > 0 ? {
|
|
3352
3366
|
network: {
|
|
3353
3367
|
egress: flags.denyEgress ? "deny" : "allow",
|
|
3354
|
-
...flags.privatePreviews ? { previews: "private" } : {}
|
|
3368
|
+
...flags.privatePreviews ? { previews: "private" } : {},
|
|
3369
|
+
...flags.allowEgress.length > 0 ? { allow: [...flags.allowEgress] } : {}
|
|
3355
3370
|
}
|
|
3356
3371
|
} : {},
|
|
3357
3372
|
...Option14.match(flags.region, { onNone: () => ({}), onSome: (region) => ({ region }) })
|
|
@@ -3417,6 +3432,12 @@ var createCommand = Command12.make(
|
|
|
3417
3432
|
privatePreviews: Options7.boolean("private-previews").pipe(
|
|
3418
3433
|
Options7.withDescription("Answer preview URLs only to requests that carry the preview token printed at create")
|
|
3419
3434
|
),
|
|
3435
|
+
allowEgress: Options7.text("allow-egress").pipe(
|
|
3436
|
+
Options7.withDescription(
|
|
3437
|
+
"Only reach this public IPv4 network, such as 140.82.112.0/20, besides DNS (repeatable, up to 32)"
|
|
3438
|
+
),
|
|
3439
|
+
Options7.repeated
|
|
3440
|
+
),
|
|
3420
3441
|
region: Options7.text("region").pipe(Options7.withDescription("Region to place the microVM in"), Options7.optional),
|
|
3421
3442
|
json: jsonOption2
|
|
3422
3443
|
},
|