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

How to confirm fuse values at runtime? #6

Closed
Nantris opened this issue Feb 10, 2022 · 5 comments
Closed

How to confirm fuse values at runtime? #6

Nantris opened this issue Feb 10, 2022 · 5 comments

Comments

@Nantris
Copy link

Nantris commented Feb 10, 2022

The fuse for NODE_OPTIONS logs to the console when it can't be used - NODE_OPTIONS have been disabled in this app - but the others seem not to log anything, or perhaps are not being set properly.

I ask because it seems like setting [FuseV1Options.EnableNodeCliInspectArguments]: false has no effect, --inspect still seems to work (granted I am not testing it directly, but rather loading the app in Debugtron - which seems to simply run the app with --inspect)

Our configuration of the fuses is adapted from this code for setting fuses: electron-userland/electron-builder#6365 (comment)

@MarshallOfSound
Copy link
Member

npx @electron/fuses read --app path/to/Thing.app

Should output some info to the terminal about the current status of fuses

@Nantris
Copy link
Author

Nantris commented Feb 12, 2022

Thanks for the reply @MarshallOfSound!

I see the output EnableNodeCliInspectArguments is Disabled - but Debugtron is still able to open debugger instances for the app, which it seems should not be possible if this fuse is having the desired effect. Is there something I'm overlooking?

@Nantris
Copy link
Author

Nantris commented Feb 15, 2022

@MarshallOfSound any thoughts on why this might be?

Note that the following code prevents Debugtron from working - which implies it uses the --inspect flag, which implies that the fuse enableNodeCliInspectArguments: false should prevent it from being able to debug an application, but this is not the case. Debugtron still works to debug the application.

// electron main
for (let i = 0; i < process.argv.length; i++) {
  const arg = process.argv[i]
  if (arg.indexOf('--inspect') !== -1 || arg.indexOf('--remote-debugging-port') !== -1) {
    throw new Error('Not allow debugging this program.')
  }
}

@MarshallOfSound
Copy link
Member

--remote-debugging-port is not affected by fuses, it is a Chromium flag that impacts renderer processes and as such can be filtered by the main app bundle if you choose.

Can you confirm if --inspect is working, or whether it is --remote-debugging-port you are seeing work?

@Nantris
Copy link
Author

Nantris commented Feb 15, 2022

Confirming the fuse works as intended. Sorry to waste time with a bad test case.

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

No branches or pull requests

2 participants