Skip to content
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

docs: Properly document runAsNode utility process option #41255

Merged
merged 2 commits into from Feb 6, 2024

Conversation

felixrieseberg
Copy link
Member

Description of Change

This PR properly documents (1) that utility processes do not receive an stdout/stderr pipe by default and (2) that they are excellent alternatives to process.fork when the RunAsNode fuse is set to false.

Checklist

Release Notes

Notes: no-notes

@electron-cation electron-cation bot added documentation 📓 semver/patch backwards-compatible bug fixes new-pr 🌱 PR opened in the last 24 hours labels Feb 6, 2024
@VerteDinde VerteDinde added the target/29-x-y PR should also be added to the "29-x-y" branch. label Feb 6, 2024
@@ -15,7 +15,7 @@ Fuses are the solution to this problem, at a high level they are "magic bits" in
**Default:** Enabled
**@electron/fuses:** `FuseV1Options.RunAsNode`

The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function.
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this recommendation also be added to docs/tutorial/security.md for higher visibility? As in a new checklist item, vaguely speaking "AvoidELECTRON_RUN_AS_NODE, use Utility Processes instead".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, I'll add it there, too - probably in a separate PR!

docs/api/utility-process.md Outdated Show resolved Hide resolved
Co-authored-by: Charles Kerr <charles@charleskerr.com>
@VerteDinde VerteDinde merged commit 4367c5a into electron:main Feb 6, 2024
14 checks passed
Copy link

release-clerk bot commented Feb 6, 2024

No Release Notes

@trop
Copy link
Contributor

trop bot commented Feb 6, 2024

I have automatically backported this PR to "29-x-y", please check out #41260

@trop trop bot added in-flight/29-x-y merged/29-x-y PR was merged to the "29-x-y" branch. and removed target/29-x-y PR should also be added to the "29-x-y" branch. in-flight/29-x-y labels Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📓 merged/29-x-y PR was merged to the "29-x-y" branch. new-pr 🌱 PR opened in the last 24 hours semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants