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

feat: adds default fuses to templates #3480

Merged
merged 2 commits into from
Feb 1, 2024

Conversation

yangannyx
Copy link
Contributor

@yangannyx yangannyx commented Jan 31, 2024

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:
In order to make fuses more discoverable and add safe defaults for new electron applications, we are introducing a default fuses configuration in each of the existing templates used in electron forge init

To test this change, I created a new project using our 5 existing templates: base, vite, vite-typescript, webpack, webpack-typescript. For each of these projects, I ran yarn package and checked that the resulting .app ran as expected. I also verified that the fuses were actually set by running npx @electron/fuses read and verifying that the output matches the forge.config configurations:

  Fuse Version: v1
  RunAsNode is Disabled
  EnableCookieEncryption is Enabled
  EnableNodeOptionsEnvironmentVariable is Disabled
  EnableNodeCliInspectArguments is Disabled
  EnableEmbeddedAsarIntegrityValidation is Enabled
  OnlyLoadAppFromAsar is Enabled
  LoadBrowserProcessSpecificV8Snapshot is Disabled

@yangannyx yangannyx requested a review from a team as a code owner January 31, 2024 20:41
@yangannyx yangannyx changed the title Adds default fuses to templates feat: Adds default fuses to templates Feb 1, 2024
@yangannyx yangannyx changed the title feat: Adds default fuses to templates feat: adds default fuses to templates Feb 1, 2024

const config: ForgeConfig = {
packagerConfig: {},
packagerConfig: {
asar: true,
Copy link
Contributor Author

@yangannyx yangannyx Feb 1, 2024

Choose a reason for hiding this comment

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

wasn't sure if there was a reason why this config wasn't set to true for any of the vite templates. this needs to be true to set the OnlyLoadAppFromAsar fuse to true, since OnlyLoadAppFromAsar only reads app.asar

Copy link
Member

@felixrieseberg felixrieseberg left a comment

Choose a reason for hiding this comment

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

This looks good, approved!!

@felixrieseberg felixrieseberg merged commit 71eb328 into electron:main Feb 1, 2024
8 of 12 checks passed
Brooooooklyn added a commit to toeverything/AFFiNE that referenced this pull request Feb 23, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@electron-forge/maker-base](https://togithub.com/electron/forge) | [`7.2.0` -> `7.3.0`](https://renovatebot.com/diffs/npm/@electron-forge%2fmaker-base/7.2.0/7.3.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@electron-forge%2fmaker-base/7.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@electron-forge%2fmaker-base/7.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@electron-forge%2fmaker-base/7.2.0/7.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@electron-forge%2fmaker-base/7.2.0/7.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [@napi-rs/cli](https://togithub.com/napi-rs/napi-rs) | [`3.0.0-alpha.40` -> `3.0.0-alpha.41`](https://renovatebot.com/diffs/npm/@napi-rs%2fcli/3.0.0-alpha.40/3.0.0-alpha.41) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@napi-rs%2fcli/3.0.0-alpha.41?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@napi-rs%2fcli/3.0.0-alpha.41?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@napi-rs%2fcli/3.0.0-alpha.40/3.0.0-alpha.41?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@napi-rs%2fcli/3.0.0-alpha.40/3.0.0-alpha.41?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>electron/forge (@&#8203;electron-forge/maker-base)</summary>

### [`v7.3.0`](https://togithub.com/electron/forge/releases/tag/v7.3.0)

[Compare Source](https://togithub.com/electron/forge/compare/v7.2.0...v7.3.0)

##### What's Changed

##### Features

-   feat(plugin-vite): upgrade to vite@5 by [@&#8203;caoxiemeihao](https://togithub.com/caoxiemeihao) in [electron/forge#3468
-   feat: allow a custom out dir from forge config by [@&#8203;lutzroeder](https://togithub.com/lutzroeder) in [electron/forge#3458
-   feat(template-vite): patch types by [@&#8203;caoxiemeihao](https://togithub.com/caoxiemeihao) in [electron/forge#3494
-   feat: adds default fuses to templates by [@&#8203;yangannyx](https://togithub.com/yangannyx) in [electron/forge#3480
-   feat(publisher-github): option to automatically generate release notes by [@&#8203;dsanders11](https://togithub.com/dsanders11) in [electron/forge#3484

##### Fixes

-   fix(electron-release-publisher): change api/version endpoint in PublisherERS to use versions/sorted by [@&#8203;kgallagher52](https://togithub.com/kgallagher52) in [electron/forge#3431
-   fix(core): packageJSON won't be found when programmatic usage instead of CLI by [@&#8203;ianho](https://togithub.com/ianho) in [electron/forge#3455
-   fix: actually depend on preceeding groups by [@&#8203;MarshallOfSound](https://togithub.com/MarshallOfSound) in [electron/forge#3438
-   fix: normalize windows version with build part correctly by [@&#8203;rickymohk](https://togithub.com/rickymohk) in [electron/forge#3461
-   fix: .vscode settings.json changes on open by [@&#8203;lutzroeder](https://togithub.com/lutzroeder) in [electron/forge#3460
-   fix(plugin-vite): package volume size to large by [@&#8203;caoxiemeihao](https://togithub.com/caoxiemeihao) in [electron/forge#3336

##### Performance

-   refactor: only run webpack once for multi-arch packages by [@&#8203;MarshallOfSound](https://togithub.com/MarshallOfSound) in [electron/forge#3437

##### Other Changes

-   chore: update Packager by [@&#8203;erikian](https://togithub.com/erikian) in [electron/forge#3419
-   chore: bump electronjs/node to 2.2.0 (main) by [@&#8203;electron-roller](https://togithub.com/electron-roller) in [electron/forge#3469
-   chore(plugins/electronegativity): correct some config types  by [@&#8203;Dogdriip](https://togithub.com/Dogdriip) in [electron/forge#3482
-   chore: use Dependabot to update GitHub Actions deps by [@&#8203;dsanders11](https://togithub.com/dsanders11) in [electron/forge#3487
-   chore: bump electronjs/node to 2.2.1 (main) by [@&#8203;electron-roller](https://togithub.com/electron-roller) in [electron/forge#3496

##### New Contributors

-   [@&#8203;kgallagher52](https://togithub.com/kgallagher52) made their first contribution in [electron/forge#3431
-   [@&#8203;rickymohk](https://togithub.com/rickymohk) made their first contribution in [electron/forge#3461
-   [@&#8203;lutzroeder](https://togithub.com/lutzroeder) made their first contribution in [electron/forge#3460
-   [@&#8203;ianho](https://togithub.com/ianho) made their first contribution in [electron/forge#3455
-   [@&#8203;yangannyx](https://togithub.com/yangannyx) made their first contribution in [electron/forge#3480
-   [@&#8203;Dogdriip](https://togithub.com/Dogdriip) made their first contribution in [electron/forge#3482

**Full Changelog**: electron/forge@v7.2.0...v7.3.0

</details>

<details>
<summary>napi-rs/napi-rs (@&#8203;napi-rs/cli)</summary>

### [`v3.0.0-alpha.41`](https://togithub.com/napi-rs/napi-rs/releases/tag/%40napi-rs/cli%403.0.0-alpha.41)

[Compare Source](https://togithub.com/napi-rs/napi-rs/compare/@napi-rs/cli@3.0.0-alpha.40...@napi-rs/cli@3.0.0-alpha.41)

##### What's Changed

-   fix(cli): fallback to wasm32 if platform is not support by [@&#8203;Brooooooklyn](https://togithub.com/Brooooooklyn) in [napi-rs/napi-rs#1967
-   fix(cli): allow more platform & arch fallback to wasm by [@&#8203;Brooooooklyn](https://togithub.com/Brooooooklyn) in [napi-rs/napi-rs#1969

**Full Changelog**: https://github.com/napi-rs/napi-rs/compare/napi@2.15.3...[@&#8203;napi-rs/cli](https://togithub.com/napi-rs/cli)[@&#8203;3](https://togithub.com/3).0.0-alpha.41

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/toeverything/AFFiNE).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5In0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants