Find which bin is used to allow in jail (Chrome headless, Puppeteer)

Tommychris

Registered
Jan 5, 2018
1
0
1
Hungary
cPanel Access Level
Root Administrator
Hi Everybody!

I want to use Puppeteer github.com/GoogleChrome/puppeteer (with Node.js). This is a Node.js wrapper around Chromium, so my goal is to use Chromium in headless mode. I wrote my sample script, and it works like a charm, if the logged in user has "normal shell", but it gives me false result if the user has Jailed shell.

Of course, I want to use jailed shell in the future, but I also want to use that Puppeteer. My real problem is:

When I run in both normal and jailed shell the script runs without any error. Only the produced image differs: In jailes shell I got white image, in normal shell I got the correct screenhsot.

My node.js code:
Code:
================
'use strict';

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    ignoreHTTPSErrors: true,
    headless: true,
    args: ['--disable-gpu', '--enable-logging', '--no-sandbox', '--disable-setuid-sandbox'],
  });
  const page = await browser.newPage();
  await page.goto('[URL]https://google.com');[/URL]
  await page.screenshot({path: 'google.jpg', fromSurface: true});
  await page.close();
  await browser.close();
})();
================
So, how can I find which binaries are that Node.js, Puppeteer or Chrome tries to use, but it locates outside of the jail?

After, how I can allow that binaries to run inside jailed shell?

Thanks for your answers!
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,237
463
Hello,

The following document provides instructions on how to configure custom jailed shell mounts should you like to grant jailed users access to a specific directory:

How to Create Custom Jailed Shell Mounts - cPanel Knowledge Base - cPanel Documentation

As far as the actual path or binary that's resulting in the issue you are facing, you may want to look into the documentation for the script you are using to determine where error messages are logged to get a better idea of why the images are not loading correctly.

Thank you.