Add app.no_sandbox option to launch browser with --no-sandbox - #47
Open
CatBraaain wants to merge 1 commit into
Open
Add app.no_sandbox option to launch browser with --no-sandbox#47CatBraaain wants to merge 1 commit into
CatBraaain wants to merge 1 commit into
Conversation
On nix-managed non-NixOS hosts the Chrome sandbox SUID helper cannot be configured (/nix/store is read-only), so browser mode aborts at launch. Add an explicit opt-in that passes --no-sandbox to the browser launcher, mirroring the existing app.insecure option shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
app.no_sandbox(bool, defaultfalse); exposed as the--no-sandboxCLI flagtrue, the browser is launched via go-rod'sNoSandbox(true)launcher optionappsection ofconfig.yamlserver.insecureoption. No new logic — pure wiring, +16 lines across 5 filesWhy
On nix-managed non-NixOS hosts (e.g. WSL2), the SUID sandbox helper that Chrome requires cannot be configured:
/nix/storeis read-only, sochrome-sandboxcan never getroot:4755. Browser mode therefore dies at launch:Native NixOS hosts don't hit this because
security.wrappersprovides a proper setuid wrapper, but hosts that use nix as a package manager have no way to fix it. Pointingbrowser_pathat a shell wrapper that appends--no-sandboxworks, but leaves a wrapper script to maintain on every host. With an official option, the plain Chrome binary path works as-is.Security note
--no-sandboxdisables Chrome's renderer sandbox, so:false(no behavior change for existing setups)insecure, this is an explicit opt-in for environments that cannot run the SUID helper (e.g. read-only /nix/store, root containers)Testing
make fmt/go vet/make test(-race, all packages): pass--no-sandboxflag: duckduckgo search succeedsno_sandbox: true/ envOPENSERP_APP_NO_SANDBOX=true: also succeed