fix run-start.sh: if running in docker-container, just start electron, see #1859

This commit is contained in:
Karsten Hassel 2020-01-03 19:12:02 +01:00
parent 69a887fb05
commit 20a9150ea3
2 changed files with 67 additions and 58 deletions

View File

@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- Force declaration of public ip adress in config file (ISSUE #1852) - Force declaration of public ip adress in config file (ISSUE #1852)
- Fixes `run-start.sh`: If running in docker-container, don't check the environment, just start electron (ISSUE #1859)
### Updated ### Updated

View File

@ -2,28 +2,35 @@
# use bash instead of sh # use bash instead of sh
./untrack-css.sh ./untrack-css.sh
if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty if grep docker /proc/1/cgroup -qa; then
export DISPLAY=:0 # Set by default display # if running in docker, only start electron
fi
# get the processor architecture
arch=$(uname -m)
false='false'
# get the config option, if any electron js/electron.js $1;
# only check non comment lines else
serveronly=$(grep -v '^\s//' config/config.js | grep -i serveronly: | awk '{print tolower($2)}' | tr -d ,\"\') # not running in docker
# set default if not defined in config
serveronly=${serveronly:-false} if [ -z "$DISPLAY" ]; then #If not set DISPLAY is SSH remote or tty
# check for xwindows running export DISPLAY=:0 # Set by default display
xorg=$(pgrep Xorg) fi
#check for macOS # get the processor architecture
mac=$(uname) arch=$(uname -m)
# false='false'
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR # get the config option, if any
# system is in text mode # only check non comment lines
# serveronly=$(grep -v '^\s//' config/config.js | grep -i serveronly: | awk '{print tolower($2)}' | tr -d ,\"\')
if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "." -a $mac != 'Darwin' ]; then # set default if not defined in config
serveronly=${serveronly:-false}
# check for xwindows running
xorg=$(pgrep Xorg)
#check for macOS
mac=$(uname)
#
# if the user requested serveronly OR
# electron support for armv6l has been dropped OR
# system is in text mode
#
if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "." -a $mac != 'Darwin' ]; then
# if user explicitly configured to run server only (no ui local) # if user explicitly configured to run server only (no ui local)
# OR there is no xwindows running, so no support for browser graphics # OR there is no xwindows running, so no support for browser graphics
@ -61,7 +68,8 @@ if [ "$serveronly." != "false." -o "$arch" == "armv6l" ] || [ "$xorg." == "."
chromium-browser -noerrdialogs -kiosk -start_maximized --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null chromium-browser -noerrdialogs -kiosk -start_maximized --disable-infobars --app=http://localhost:$port --ignore-certificate-errors-spki-list --ignore-ssl-errors --ignore-certificate-errors 2>/dev/null
exit exit
fi fi
else else
# we can use electron directly # we can use electron directly
electron js/electron.js $1; electron js/electron.js $1;
fi
fi fi