-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[wrangler/miniflare] Add privileged_containers / --privileged-containers for FUSE in local dev #13748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[wrangler/miniflare] Add privileged_containers / --privileged-containers for FUSE in local dev #13748
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| "wrangler": minor | ||
| "miniflare": minor | ||
| --- | ||
|
|
||
| Add `dev.privileged_containers` config and `--privileged-containers` CLI flag for FUSE in local dev | ||
|
|
||
| When set, miniflare launches local containers with the elevated permissions FUSE requires (`CAP_SYS_ADMIN`, `/dev/fuse`, AppArmor unconfined). Off by default. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,6 +237,7 @@ export type NormalizeAndValidateConfigArgs = { | |
| upstreamProtocol?: string; | ||
| script?: string; | ||
| enableContainers?: boolean; | ||
| privilegedContainers?: boolean; | ||
| generateTypes?: boolean; | ||
| }; | ||
|
|
||
|
|
@@ -692,6 +693,7 @@ function normalizeAndValidateDev( | |
| upstreamProtocol: upstreamProtocolArg, | ||
| remote: remoteArg, | ||
| enableContainers: enableContainersArg, | ||
| privilegedContainers: privilegedContainersArg, | ||
| generateTypes: generateTypesArg, | ||
| } = args; | ||
| assert( | ||
|
|
@@ -709,6 +711,10 @@ function normalizeAndValidateDev( | |
| enableContainersArg === undefined || | ||
| typeof enableContainersArg === "boolean" | ||
| ); | ||
| assert( | ||
| privilegedContainersArg === undefined || | ||
| typeof privilegedContainersArg === "boolean" | ||
| ); | ||
| assert( | ||
| generateTypesArg === undefined || typeof generateTypesArg === "boolean" | ||
| ); | ||
|
|
@@ -731,6 +737,7 @@ function normalizeAndValidateDev( | |
| : local_protocol, | ||
| host, | ||
| enable_containers = enableContainersArg ?? true, | ||
| privileged_containers = privilegedContainersArg ?? false, | ||
| container_engine, | ||
| generate_types = generateTypesArg ?? false, | ||
| ...rest | ||
|
|
@@ -778,6 +785,14 @@ function normalizeAndValidateDev( | |
| "boolean" | ||
| ); | ||
|
|
||
| validateOptionalProperty( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've just realised that the way that Anyway, nothing to do with this PR. |
||
| diagnostics, | ||
| "dev", | ||
| "privileged_containers", | ||
| privileged_containers, | ||
| "boolean" | ||
| ); | ||
|
|
||
| validateOptionalProperty( | ||
| diagnostics, | ||
| "dev", | ||
|
|
@@ -803,6 +818,7 @@ function normalizeAndValidateDev( | |
| upstream_protocol, | ||
| host, | ||
| enable_containers, | ||
| privileged_containers, | ||
| container_engine, | ||
| generate_types, | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I just realised that this means that the Wrangler config value will override any command line arg, right?
Is that what you want? Classically the ordering tends to be command line arg > env var > config value > default.
I appreciate that this is how many of the other properties are being computed too. Although notably
portis validated "correctly". (It's default is set laterworkers-sdk/packages/wrangler/src/api/startDevWorker/ConfigController.ts
Lines 139 to 142 in 47cf644