-
-
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
feat: make --no-sandbox
optional for building with AppImage
#6429
feat: make --no-sandbox
optional for building with AppImage
#6429
Conversation
|
@@ -20,7 +20,7 @@ export default class AppImageTarget extends Target { | |||
super("appImage") | |||
|
|||
this.desktopEntry = new Lazy<string>(() => | |||
helper.computeDesktopEntry(this.options, "AppRun --no-sandbox %U", { | |||
helper.computeDesktopEntry(this.options, `AppRun ${[...(this.options.executableArgs ?? ["--no-sandbox"]), "%U"].join(" ")}`, { |
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.
Can you please split in to its own const?
const args = this.options.executableArgs?.join(" ") || "--no-sandbox"
helper.computeDesktopEntry(this.options, `AppRun ${args} %U`, {
--no-sandbox
optional for building with AppImage--no-sandbox
optional for building with AppImage
Can you please rebase off latest master? That should resolve the test failures |
8d776e8
to
4838fcf
Compare
@mmaietta Done, I think I accidentally wiped out one of the |
This runtime option disables the chromium sandbox. It was added as a default option in `electron-builder` v22.10.3 (see electron-userland/electron-builder#4496) because the required kernel privileges might not be available on the user's computer (e.g. in Debian). However, these privileges might be available on some computers and the sandbox should be used in this case. Thankfully, `electron-builder` v22.14.8 makes this optional when using the build option `executableArgs` (see electron-userland/electron-builder#6429). Since we don't have any arguments to pass to Cozy Desktop, we'll just add an empty argument to the list to prevent the use of `--no-sandbox` in the Desktop entry. We'll still add the option ourselves when necesary (see ./build/launcher-script.sh`).
This runtime option disables the chromium sandbox. It was added as a default option in `electron-builder` v22.10.3 (see electron-userland/electron-builder#4496) because the required kernel privileges might not be available on the user's computer (e.g. in Debian). However, these privileges might be available on some computers and the sandbox should be used in this case. Thankfully, `electron-builder` v22.14.8 makes this optional when using the build option `executableArgs` (see electron-userland/electron-builder#6429). Since we don't have any arguments to pass to Cozy Desktop, we'll just add an empty argument to the list to prevent the use of `--no-sandbox` in the Desktop entry. We'll still add the option ourselves when necesary (see ./build/launcher-script.sh`).
I've noticed that
--no-sandbox
is hardcoded into the arguments list when building anAppImage
. This seems to be a good default for many implementations, but doesn't work for all of them. Example being the Mattermost Desktop App (see this issue: mattermost/desktop#1804)I've created this PR in order to potentially add an override option for users to specify their own arguments when launching the AppImage, using the
executableArgs
field which doesn't appear to be used by the AppImage at this time.Let me know if this change makes sense and if I can make any further edits to support this.