Skip to content

Commit

Permalink
[Screenshotting] Fix typo in warning logs regarding chromium's sandbox (
Browse files Browse the repository at this point in the history
#131584)

* [Screenshotting] fix typo and prevent linebreak in OS

* remove unnecessary messaging

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
tsullivan and kibanamachine committed May 9, 2022
1 parent 190ed55 commit 58f480b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ export class HeadlessChromiumDriverFactory {
const dataDir = getDataPath();
fs.mkdirSync(dataDir, { recursive: true });
this.userDataDir = fs.mkdtempSync(path.join(dataDir, 'chromium-'));

if (this.config.browser.chromium.disableSandbox) {
logger.warn(`Enabling the Chromium sandbox provides an additional layer of protection.`);
}
}

private getChromiumArgs() {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/screenshotting/server/config/create_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export async function createConfig(parentLogger: Logger, config: ConfigType) {

// disableSandbox was not set by user, apply default for OS
const { os, disableSandbox } = await getDefaultChromiumSandboxDisabled();
const osName = [os.os, os.dist, os.release].filter(Boolean).map(upperFirst).join(' ');
const osName = [os.os, os.dist, os.release].filter(Boolean).map(upperFirst).join(' ').trim();

logger.debug(`Running on OS: '${osName}'`);

if (disableSandbox === true) {
logger.warn(
`Chromium sandbox provides an additional layer of protection, but is not supported for ${osName} OS. Automatically setting 'xpack.screenshotting.capture.browser.chromium.disableSandbox: true'.`
`Chromium sandbox provides an additional layer of protection, but is not supported for ${osName} OS. Automatically setting 'xpack.screenshotting.browser.chromium.disableSandbox: true'.`
);
} else {
logger.info(
Expand Down

0 comments on commit 58f480b

Please sign in to comment.