KASM-1983 Add Chromium Image

- Update Chrome installer to accept version
This commit is contained in:
Justin Travis 2021-10-01 11:28:38 -04:00
parent 82ab35964d
commit 58a536828d
16 changed files with 177 additions and 22 deletions

View File

@ -34,7 +34,7 @@ build:
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]
@ -56,7 +56,7 @@ build_dev:
- /^release\/.*$/ - /^release\/.*$/
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]
@ -76,7 +76,7 @@ build_schedules:
- schedules - schedules
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]
@ -96,5 +96,5 @@ update_readmes:
- $README_PASSWORD - $README_PASSWORD
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]

View File

@ -27,7 +27,7 @@ RUN chmod +x $STARTUPDIR/custom_startup.sh
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ########### ######### End Customizations ###########

View File

@ -31,7 +31,7 @@ RUN chmod +x $STARTUPDIR/custom_startup.sh
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ########### ######### End Customizations ###########

View File

@ -13,7 +13,7 @@ WORKDIR $HOME
# Install Google Chrome # Install Google Chrome
COPY ./src/ubuntu/install/chrome $INST_SCRIPTS/chrome/ COPY ./src/ubuntu/install/chrome $INST_SCRIPTS/chrome/
RUN bash $INST_SCRIPTS/chrome/install_chrome.sh && rm -rf $INST_SCRIPTS/chrome/ RUN bash $INST_SCRIPTS/chrome/install_chrome.sh 87.0.4280.141-1 && rm -rf $INST_SCRIPTS/chrome/
# Update the desktop environment to be optimized for a single application # Update the desktop environment to be optimized for a single application
RUN cp $HOME/.config/xfce4/xfconf/single-application-xfce-perchannel-xml/* $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/ RUN cp $HOME/.config/xfce4/xfconf/single-application-xfce-perchannel-xml/* $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/
@ -31,7 +31,7 @@ RUN bash $INST_SCRIPTS/chrome_flash/install_flash.sh && rm -rf $INST_SCRIPTS/ch
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ########### ######### End Customizations ###########

45
dockerfile-kasm-chromium Normal file
View File

@ -0,0 +1,45 @@
ARG BASE_TAG="develop"
FROM kasmweb/core-ubuntu-bionic:$BASE_TAG
USER root
ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
WORKDIR $HOME
######### Customize Container Here ###########
# Install Chromium
COPY ./src/ubuntu/install/chromium $INST_SCRIPTS/chromium/
RUN bash $INST_SCRIPTS/chromium/install_chromium.sh && rm -rf $INST_SCRIPTS/chromium/
# Update the desktop environment to be optimized for a single application
RUN cp $HOME/.config/xfce4/xfconf/single-application-xfce-perchannel-xml/* $HOME/.config/xfce4/xfconf/xfce-perchannel-xml/
RUN cp /usr/share/extra/backgrounds/bg_kasm.png /usr/share/extra/backgrounds/bg_default.png
RUN apt-get remove -y xfce4-panel
# Setup the custom startup script that will be invoked when the container starts
ENV LAUNCH_URL http://kasmweb.com
COPY ./src/ubuntu/install/chromium/custom_startup.sh $STARTUPDIR/custom_startup.sh
RUN chmod +x $STARTUPDIR/custom_startup.sh
# Install Custom Certificate Authority
# COPY ./src/ubuntu/install/certificates $INST_SCRIPTS/certificates/
# RUN bash $INST_SCRIPTS/certificates/install_ca_cert.sh && rm -rf $INST_SCRIPTS/certificates/
ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ###########
RUN chown 1000:0 $HOME
RUN $STARTUPDIR/set_user_permission.sh $HOME
ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME
USER 1000

View File

@ -21,7 +21,7 @@ RUN apt-get remove -y xfce4-panel
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
# Setup the custom startup script that will be invoked when the container starts # Setup the custom startup script that will be invoked when the container starts
ENV LAUNCH_URL http://kasmweb.com ENV LAUNCH_URL http://kasmweb.com

View File

@ -31,7 +31,7 @@ RUN chmod +x $STARTUPDIR/custom_startup.sh
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ########### ######### End Customizations ###########

View File

@ -30,7 +30,7 @@ RUN bash $INST_SCRIPTS/firefox_flash/install_flash.sh && rm -rf $INST_SCRIPTS/f
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
######### End Customizations ########### ######### End Customizations ###########

View File

@ -21,7 +21,7 @@ RUN apt-get remove -y xfce4-panel
ENV KASM_RESTRICTED_FILE_CHOOSER=1 ENV KASM_RESTRICTED_FILE_CHOOSER=1
COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/ COPY ./src/ubuntu/install/gtk/ $INST_SCRIPTS/gtk/
RUN $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh RUN bash $INST_SCRIPTS/gtk/install_restricted_file_chooser.sh
# Setup the custom startup script that will be invoked when the container starts # Setup the custom startup script that will be invoked when the container starts
ENV LAUNCH_URL about:blank ENV LAUNCH_URL about:blank

14
docs/chromium/README.md Normal file
View File

@ -0,0 +1,14 @@
# About This Image
This Image contains a browser-accessible version of [Chromium](https://www.chromium.org/Home).
![Screenshot][Image_Screenshot]
[Image_Screenshot]: https://f.hubspotusercontent30.net/hubfs/5856039/dockerhub/image-screenshots/chromium.png "Image Screenshot"
# Environment Variables
* `LAUNCH_URL` - The default URL the browser launches to when created.
* `APP_ARGS` - Additional arguments to pass to the browser when launched.
* `KASM_RESTRICTED_FILE_CHOOSER` - Confine "File Upload" and "File Save"
dialogs to ~/Desktop. On by default.

View File

@ -0,0 +1 @@
Chromium for Kasm Workspaces

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -ex
CHROME_ARGS="--password-store=basic --no-sandbox --disable-gpu --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'" 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'"
apt-get update apt-get update
apt install -y apt-transport-https curl apt install -y apt-transport-https curl

View File

@ -1,19 +1,28 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -ex
CHROME_ARGS="--password-store=basic --no-sandbox --disable-gpu --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'" 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'"
CHROME_VERSION=$1
if [ "$DISTRO" = centos ]; then if [ "$DISTRO" = centos ]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm if [ ! -z "${CHROME_VERSION}" ]; then
yum localinstall -y google-chrome-stable_current_x86_64.rpm wget https://dl.google.com/linux/chrome/rpm/stable/x86_64/google-chrome-stable-${CHROME_VERSION}.x86_64.rpm -O chrome.rpm
rm google-chrome-stable_current_x86_64.rpm else
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm -O chrome.rpm
fi
yum localinstall -y chrome.rpm
rm chrome.rpm
else else
apt-get update apt-get update
apt-get remove -y chromium-browser-l10n chromium-codecs-ffmpeg chromium-browser apt-get remove -y chromium-browser-l10n chromium-codecs-ffmpeg chromium-browser
if [ ! -z "${CHROME_VERSION}" ]; then
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb wget https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb -O chrome.deb
apt-get install -y ./google-chrome-stable_current_amd64.deb else
rm google-chrome-stable_current_amd64.deb wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O chrome.deb
fi
apt-get install -y ./chrome.deb
rm chrome.deb
fi fi
sed -i 's/-stable//g' /usr/share/applications/google-chrome.desktop sed -i 's/-stable//g' /usr/share/applications/google-chrome.desktop

View File

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -ex
FORCE=$2
if [ -n "$1" ] ; then
URL=$1
else
URL=$LAUNCH_URL
fi
DEFAULT_ARGS="--start-maximized"
ARGS=${APP_ARGS:-$DEFAULT_ARGS}
if [ -n "$URL" ] && ( [ -z "$DISABLE_CUSTOM_STARTUP" ] || [ -n "$FORCE" ] ) ; then
if [ -f /tmp/custom_startup.lck ] ; then
echo "custom_startup already running!"
exit 1
fi
touch /tmp/custom_startup.lck
while true
do
if ! pgrep -x chromium > /dev/null
then
/usr/bin/filter_ready
/usr/bin/desktop_ready
chromium-browser $ARGS $URL
fi
sleep 1
done
rm /tmp/custom_startup.lck
fi

View File

@ -0,0 +1,56 @@
#!/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'"
if [ "$DISTRO" = centos ]; then
yum install -y chromium
yum clean all
else
apt-get update
apt-get install -y software-properties-common
apt-get remove -y chromium-browser-l10n chromium-codecs-ffmpeg chromium-browser
apt-get install -y chromium-browser
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 <<EOL
#!/usr/bin/env bash
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"None"/' ~/.config/chromium/Default/Preferences
/usr/bin/chromium-browser-orig ${CHROME_ARGS} "\$@"
EOL
chmod +x /usr/bin/chromium-browser
cp /usr/bin/chromium-browser /usr/bin/chromium
if [ "$DISTRO" = centos ]; then
cat >> $HOME/.config/mimeapps.list <<EOF
[Default Applications]
x-scheme-handler/http=chromium-browser.desktop
x-scheme-handler/https=chromium-browser.desktop
x-scheme-handler/ftp=chromium-browser.desktop
x-scheme-handler/chrome=chromium-browser.desktop
text/html=chromium-browser.desktop
application/x-extension-htm=chromium-browser.desktop
application/x-extension-html=chromium-browser.desktop
application/x-extension-shtml=chromium-browser.desktop
application/xhtml+xml=chromium-browser.desktop
application/x-extension-xhtml=chromium-browser.desktop
application/x-extension-xht=chromium-browser.desktop
EOF
else
sed -i 's@exec -a "$0" "$HERE/chromium" "$\@"@@g' /usr/bin/x-www-browser
cat >>/usr/bin/x-www-browser <<EOL
exec -a "\$0" "\$HERE/chromium" "${CHROME_ARGS}" "\$@"
EOL
fi
mkdir -p /etc/chromium/policies/managed/
cat >>/etc/chromium/policies/managed/default_managed_policy.json <<EOL
{"CommandLineFlagSecurityWarningsEnabled": false, "DefaultBrowserSettingEnabled": false}
EOL

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -ex set -ex
CHROME_ARGS="--password-store=basic --no-sandbox --disable-gpu --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'" 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'"
apt-get update apt-get update