From 5bf59bcd8576b3c6bd7e95e84cf17bfd92b49400 Mon Sep 17 00:00:00 2001 From: Richard Joffray Date: Mon, 29 Jun 2020 14:15:53 -0700 Subject: [PATCH] adding --no-sandbox for Dockerfile, checking the HOME env variable --- README.md | 2 +- bin/entrypoint | 14 ++++++++++---- docker-deploy.sh | 2 +- examples/multiple-windows/Dockerfile | 2 +- examples/simple-url/Dockerfile | 2 +- package-lock.json | 2 +- package.json | 2 +- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c57b748..1036945 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Oak -[![release](https://img.shields.io/badge/release-v6.0.0-green.svg)](https://github.com/OakLabsInc/oak/releases/tag/6.0.0) +[![release](https://img.shields.io/badge/release-v6.0.1-green.svg)](https://github.com/OakLabsInc/oak/releases/tag/6.0.1) [![node](https://img.shields.io/badge/node-v12.18.1-green.svg)](https://github.com/nodejs/node/releases/tag/v12.18.1) [![electron](https://img.shields.io/badge/electron-v6.1.12-green.svg)](https://github.com/electron/electron/releases/tag/v6.1.12) [![Coverage Status](https://coveralls.io/repos/github/OakLabsInc/oak/badge.svg?t=zYcBU6)](https://coveralls.io/github/OakLabsInc/oak) diff --git a/bin/entrypoint b/bin/entrypoint index b609875..f0d3d4b 100755 --- a/bin/entrypoint +++ b/bin/entrypoint @@ -5,12 +5,18 @@ const { spawn } = require('child_process') const electron = require('electron') const _ = require('lodash') +let args = [ + join(__dirname, '..'), + ...(process.argv.splice(2, process.argv.length)) +] + +if (process.env.HOME && process.env.HOME === '/root') { + args.push('--no-sandbox') +} + spawn( electron, - [ - join(__dirname, '..'), - ...(process.argv.splice(2, process.argv.length)) - ], + args, { stdio: 'inherit', env: _.defaults(process.env, { diff --git a/docker-deploy.sh b/docker-deploy.sh index e70ed5b..e417b81 100755 --- a/docker-deploy.sh +++ b/docker-deploy.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -OAK_VERSION="6.0.0" +OAK_VERSION="6.0.1" BASE="oaklabs/oak" # our FROM line in the Dockerfile, should ideally match the current electron node version diff --git a/examples/multiple-windows/Dockerfile b/examples/multiple-windows/Dockerfile index 298af64..b7ec6c4 100644 --- a/examples/multiple-windows/Dockerfile +++ b/examples/multiple-windows/Dockerfile @@ -1,4 +1,4 @@ -FROM oaklabs/oak:6.0.0 +FROM oaklabs/oak:6.0.1 WORKDIR /app COPY . /app diff --git a/examples/simple-url/Dockerfile b/examples/simple-url/Dockerfile index 1678f45..1d3900f 100644 --- a/examples/simple-url/Dockerfile +++ b/examples/simple-url/Dockerfile @@ -1,4 +1,4 @@ -FROM oaklabs/oak:6.0.0 +FROM oaklabs/oak:6.0.1 WORKDIR /app COPY . /app diff --git a/package-lock.json b/package-lock.json index 5e2d48e..1b4b520 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "oak", - "version": "6.0.0", + "version": "6.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bdafddd..9966b83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "oak", - "version": "6.0.0", + "version": "6.0.1", "description": "A very opinionated kiosk framework based on Electron", "engines": { "node": ">=12.18.x"