Skip to content

Commit fb8d535

Browse files
committed
Add workaround for older Linux kernels
1 parent abbe7e2 commit fb8d535

3 files changed

Lines changed: 27 additions & 5 deletions

File tree

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ progress [========================================] 100% | ETA: 0s | 100/100
2323
### Options
2424

2525
```
26-
-q --quiet Only print the file download URL.
27-
-v --verbose Print each step of the file upload process. Useful for debugging.
28-
-h --help Print program usage info and exit.
29-
--version Print program version and exit.
26+
-q --quiet Only print the file download URL.
27+
-v --verbose Print each step of the file upload process. Useful for debugging.
28+
--chrome-args Arguments passed to the underlying Chromium instance.
29+
-h --help Print program usage info and exit.
30+
--version Print program version and exit.
3031
```
3132

3233
## Installing
@@ -61,6 +62,19 @@ what should be a several-KB script with a few HTTP requests is instead a
6162
several-KB script with a ~250MB dependency hanging off of it. Sorry.
6263
At least it's self-contained.
6364

65+
## Troubleshooting
66+
67+
Errors like this may come up on older Linux installs.
68+
69+
```
70+
No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
71+
```
72+
73+
You can work around this using `--chrome-args`:
74+
```bash
75+
wormhole-cli --chrome-args="--no-sandbox" <your file>
76+
```
77+
6478
# License
6579
This code is licensed under the
6680
[GPL-3.0](https://www.gnu.org/licenses/gpl-3.0-standalone.html) license.

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,20 @@ const argv = minimist(process.argv.slice(2), {
2121
verbose: false,
2222
version: false,
2323
},
24+
string: [
25+
'chrome-args',
26+
]
2427
});
2528
argv.files = argv._;
29+
argv.chrome_args = argv['chrome-args'].split(/\s+/);
2630

2731
const USAGE = [
2832
`Usage: ${info.name} [OPTIONS] <file(s)>`,
2933
'',
3034
'Options:',
3135
`\t -q --quiet Print only the download URL.`,
3236
`\t -v --verbose Prints each step of the upload process.`,
37+
`\t --chrome-args Arguments passed to the underlying Chromium browser.`,
3338
`\t -h --help Prints this help text and exits.`,
3439
`\t --version Prints the program's version and exits.`,
3540
].join('\n')
@@ -62,6 +67,7 @@ if (argv.files.length === 0) {
6267
}
6368

6469
(async () => await uploadFiles(argv.files, {
70+
chrome_args: argv.chrome_args,
6571
quiet: argv.quiet,
6672
verbose: argv.verbose,
6773
}))();

wormhole.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ module.exports.uploadFiles = async function uploadFiles(files, options={}) {
2020
}
2121

2222
vlog('Starting headless browser');
23-
const browser = await puppeteer.launch();
23+
const browser = await puppeteer.launch({
24+
args: options.chrome_args,
25+
});
2426
const page = await browser.newPage();
2527

2628
vlog(`Loading ${WORMHOLE_HOME}`);

0 commit comments

Comments
 (0)