From 7a80b8c876f828ccddaf4dd32cca9fa2822425e2 Mon Sep 17 00:00:00 2001 From: Richard Koliser Date: Tue, 5 Jul 2022 13:38:17 -0400 Subject: [PATCH] KASM-2849 Revert KASM-2789 Chromium debug builds This reverts commit 96ff66e11cce7301776583f524243f8b9bb5b34a. We had to revert this commit because the new debug builds do not have Google API keys, so normal Google services do not function like the built in Chromium Google translate right click menu. We could have users procure their own keys but that seems more work than most users will want to do. --- dockerfile-kasm-chromium | 3 - dockerfile-kasm-oracle-8-desktop | 2 +- src/common/install/chromium/custom_startup.sh | 84 ---- .../install/chromium/install_chromium.sh | 68 --- src/ubuntu/install/chromium/custom_startup.sh | 10 +- .../install/chromium/install_chromium.sh | 447 +++--------------- 6 files changed, 64 insertions(+), 550 deletions(-) delete mode 100644 src/common/install/chromium/custom_startup.sh delete mode 100644 src/common/install/chromium/install_chromium.sh diff --git a/dockerfile-kasm-chromium b/dockerfile-kasm-chromium index bc0de75..5e843de 100644 --- a/dockerfile-kasm-chromium +++ b/dockerfile-kasm-chromium @@ -3,9 +3,6 @@ ARG BASE_IMAGE="core-ubuntu-focal" FROM kasmweb/$BASE_IMAGE:$BASE_TAG USER root -# This argument is optional, if not present the install script will get latest Chromium -ARG CHROMIUM_VERSION - ENV HOME /home/kasm-default-profile ENV STARTUPDIR /dockerstartup ENV INST_SCRIPTS $STARTUPDIR/install diff --git a/dockerfile-kasm-oracle-8-desktop b/dockerfile-kasm-oracle-8-desktop index 893eef4..bf26cdb 100644 --- a/dockerfile-kasm-oracle-8-desktop +++ b/dockerfile-kasm-oracle-8-desktop @@ -24,7 +24,7 @@ COPY ./src/oracle/install/misc $INST_SCRIPTS/misc/ RUN bash $INST_SCRIPTS/misc/install_tools.sh && rm -rf $INST_SCRIPTS/misc/ # Install Chromium -COPY ./src/common/install/chromium $INST_SCRIPTS/chromium/ +COPY ./src/ubuntu/install/chromium $INST_SCRIPTS/chromium/ RUN bash $INST_SCRIPTS/chromium/install_chromium.sh && rm -rf $INST_SCRIPTS/chromium/ # Install Firefox diff --git a/src/common/install/chromium/custom_startup.sh b/src/common/install/chromium/custom_startup.sh deleted file mode 100644 index 46d284c..0000000 --- a/src/common/install/chromium/custom_startup.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -set -ex -START_COMMAND="chromium-browser" -PGREP="chromium" -MAXIMIZE="true" -DEFAULT_ARGS="" - -if [[ $MAXIMIZE == 'true' ]] ; then - DEFAULT_ARGS+=" --start-maximized" -fi -ARGS=${APP_ARGS:-$DEFAULT_ARGS} - -options=$(getopt -o gau: -l go,assign,url: -n "$0" -- "$@") || exit -eval set -- "$options" - -while [[ $1 != -- ]]; do - case $1 in - -g|--go) GO='true'; shift 1;; - -a|--assign) ASSIGN='true'; shift 1;; - -u|--url) OPT_URL=$2; shift 2;; - *) echo "bad option: $1" >&2; exit 1;; - esac -done -shift - -# Process non-option arguments. -for arg; do - echo "arg! $arg" -done - -FORCE=$2 - -kasm_exec() { - if [ -n "$OPT_URL" ] ; then - URL=$OPT_URL - elif [ -n "$1" ] ; then - URL=$1 - fi - - # Since we are execing into a container that already has the browser running from startup, - # when we don't have a URL to open we want to do nothing. Otherwise a second browser instance would open. - if [ -n "$URL" ] ; then - /usr/bin/filter_ready - /usr/bin/desktop_ready - $START_COMMAND $ARGS $OPT_URL - else - echo "No URL specified for exec command. Doing nothing." - fi -} - -kasm_startup() { - if [ -n "$KASM_URL" ] ; then - URL=$KASM_URL - elif [ -z "$URL" ] ; then - URL=$LAUNCH_URL - fi - - if [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ; then - - echo "Entering process startup loop" - set +x - while true - do - if ! pgrep -x $PGREP > /dev/null - then - /usr/bin/filter_ready - /usr/bin/desktop_ready - set +e - $START_COMMAND $ARGS $URL - set -e - fi - sleep 1 - done - set -x - - fi - -} - -if [ -n "$GO" ] || [ -n "$ASSIGN" ] ; then - kasm_exec -else - kasm_startup -fi diff --git a/src/common/install/chromium/install_chromium.sh b/src/common/install/chromium/install_chromium.sh deleted file mode 100644 index ebf5f60..0000000 --- a/src/common/install/chromium/install_chromium.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env bash -set -ex - -CHROME_ARGS="--password-store=basic --no-sandbox --ignore-gpu-blocklist --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'" -ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') - -if [[ "${DISTRO}" == @(centos|oracle7|oracle8) ]]; then - if [ "${DISTRO}" == "oracle8" ]; then - dnf install -y chromium - dnf clean all - else - yum install -y chromium - yum clean all - fi -elif [ "${DISTRO}" == "opensuse" ]; then - zypper install -yn chromium - zypper clean --all -else - echo "Unrecognized DISTRO parameter: ${DISTRO}" -fi - -sed -i 's/-stable//g' /usr/share/applications/chromium-browser.desktop - -cp /usr/share/applications/chromium-browser.desktop $HOME/Desktop/ -chown 1000:1000 $HOME/Desktop/chromium-browser.desktop - -mv /usr/bin/chromium-browser /usr/bin/chromium-browser-orig -cat >/usr/bin/chromium-browser <> $HOME/.config/mimeapps.list <>/usr/bin/x-www-browser <>/etc/chromium/policies/managed/default_managed_policy.json </usr/bin/chrome <>/usr/bin/x-www-browser <>/etc/chromium/policies/managed/default_managed_policy.json <>$HOME/Desktop/chrome.desktop </usr/bin/chromium-browser </usr/bin/chromium-browser <> $HOME/.config/mimeapps.list <>/usr/bin/x-www-browser <>/etc/chromium/policies/managed/default_managed_policy.json <>/etc/chromium/policies/managed/default_managed_policy.json <