Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Workarounds and Optimization' started by Tommychris, Jan 5, 2018.

  1. Tommychris

    Tommychris Registered

    Joined:
    Jan 5, 2018
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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!
     
    #1 Tommychris, Jan 5, 2018
    Last edited by a moderator: Jan 5, 2018
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,396
    Likes Received:
    1,606
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page