-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Passing --enable-sandbox argument? #2562
Comments
Could you point to the part where |
So it seems like OS sandboxing will not be enforced without the command-line arg. |
@tanx I am not expert here. Other options are not option for you? "To create a sandboxed window, pass sandbox: true to webPreferences:" |
|
I guess the more general question would be... is it possible to set cli args at all in electron-builder like in electron-packager? See: lightninglabs/lightning-app#75 (comment) |
@tanx It is not possible technically without introducing special wrapper. lightninglabs/lightning-app#75 (comment) Please point me to docs. @tanx If you will not find docs how it is possible using electron-packager (I guess it is not possible) and will still want to pass |
Ok. Thanks for explaining. I was assuming that e.g. for Mac OS the |
@tanx Exactly. Short googling doesn't give me official answer from docs, but I found
You can try to configure your macOS build: "build": {
"mac": {
"extendInfo": {
"ProgramArguments": ["--enable-sandbox"]
}
}
} |
To make clear — I am open to add this functionality for some targets, but I need to be sure that you are understand what you are asking for. So, if you clearly stated that the only way to enable sandbox it is passing CLI args and you need this functionality, I will add such option for some targets. For example, it is possible for all macOS targets, for Snap and AppImage targets for Linux. And not possible for any Windows targets without additional investigation and work. |
Awesome. The proposed solution looks promising. Didn't know you could pass platform specific configuration like that. I'll test it out and report back.
Basically just a flag that guarantees OS-level sandboxing will be enforced for all rendering processes/windows. |
https://www.electron.build/configuration/mac/
What is not clear for me:
|
It's been a while since I looked into this, I recall testing some changes to electron-forge (electron/forge#411) which was used by electron-packager and I assumed that it might be a possible route there. Looking back at my notes of that time, I figured that it would be easier to compile my own custom electron binaries with a patch to enable the sandbox by default. |
It is only for
Please specify what targets do you use and want. |
FWIW these are the targets we're currently building: |
We use mac, window (ia32 & x64) & linux (x64), I can provide early testing for those by the way.
The |
Because user can start app directly, right? |
Being able to pass parameters to the underlying electron binary is a neat feature. A |
Electron v5 comes with OS-level sandbox enabled by default. And so there is a need to disable it in some cases by passing Here is another case I needed to pass an argument to the app, which is not the same as doing that through I'd suggest renaming to issue to something like I just realized there might be a conflict of embedded and directly passed arguments. A directly passed argument should probably have a priority. I think this task might be outside of electron-userland's scope as it looks like there will be a need to introduce some kind of loader that will load needed arguments from the config file and the call the app with those arguments. So users could edit the arguments config file. |
Is there a way to pass the --enable-sandbox argument to electron?
I know of the --enable-mixed-sandbox hack, but is there are better way?
The text was updated successfully, but these errors were encountered: