From bde09ebb237c52e65060b57d0f3703a531fe7c99 Mon Sep 17 00:00:00 2001 From: Matthew McClaskey Date: Mon, 29 Apr 2024 01:01:34 +0000 Subject: [PATCH] KASM-5252 add kasmos desktop --- ci-scripts/template-vars.yaml | 20 +++++++ dockerfile-kasmos-desktop | 52 +++++++++++++++++++ src/kasmos/install/browser/install_browser.sh | 16 ++++++ .../install/office/install_office_app.sh | 13 +++++ .../resources/onlyoffice/docs-editor.desktop | 21 ++++++++ .../onlyoffice/present-editor.desktop | 21 ++++++++ .../onlyoffice/sheets-editor.desktop | 21 ++++++++ .../only_office/install_only_office.sh | 6 +-- 8 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 dockerfile-kasmos-desktop create mode 100644 src/kasmos/install/browser/install_browser.sh create mode 100644 src/kasmos/install/office/install_office_app.sh create mode 100644 src/kasmos/resources/onlyoffice/docs-editor.desktop create mode 100644 src/kasmos/resources/onlyoffice/present-editor.desktop create mode 100644 src/kasmos/resources/onlyoffice/sheets-editor.desktop diff --git a/ci-scripts/template-vars.yaml b/ci-scripts/template-vars.yaml index 1180fd8..f3ef4fb 100644 --- a/ci-scripts/template-vars.yaml +++ b/ci-scripts/template-vars.yaml @@ -723,6 +723,26 @@ singleImages: - src/ubuntu/install/firefox/** - src/ubuntu/install/cleanup/** - src/ubuntu/install/chrome/** + - name: kasmos-desktop + singleapp: false + base: core-kasmos + dockerfile: dockerfile-kasmos-desktop + changeFiles: + - src/ubuntu/install/chrome/** + - src/ubuntu/install/chromium/** + - src/ubuntu/intall/only_office/** + - src/ubuntu/install/libre_office/** + - src/ubuntu/install/misc/** + - src/kasmos/install/browser/** + - src/ubuntu/install/vs_code/** + - src/ubuntu/install/nextcloud/** + - src/ubuntu/install/remmina/** + - src/kasmos/install/office/** + - src/ubuntu/install/zoom/** + - src/ubuntu/install/thunderbird/** + - src/ubuntu/install/slack/** + - src/ubuntu/install/gamepad_utils/** + - src/ubuntu/install/cleanup/** - name: postman singleapp: true base: core-ubuntu-focal diff --git a/dockerfile-kasmos-desktop b/dockerfile-kasmos-desktop new file mode 100644 index 0000000..1a1ff4a --- /dev/null +++ b/dockerfile-kasmos-desktop @@ -0,0 +1,52 @@ +ARG BASE_TAG="develop" +ARG BASE_IMAGE="core-kasmos" +FROM kasmweb/$BASE_IMAGE:$BASE_TAG + +USER root + +ENV HOME /home/kasm-default-profile +ENV STARTUPDIR /dockerstartup +WORKDIR $HOME + +### Envrionment config +ENV DEBIAN_FRONTEND=noninteractive \ + SKIP_CLEAN=true \ + KASM_RX_HOME=$STARTUPDIR/kasmrx \ + DONT_PROMPT_WSL_INSTALL="No_Prompt_please" \ + INST_DIR=$STARTUPDIR/install \ + INST_SCRIPTS="/ubuntu/install/misc/install_tools.sh \ + /kasmos/install/browser/install_browser.sh \ + /ubuntu/install/vs_code/install_vs_code.sh \ + /ubuntu/install/remmina/install_remmina.sh \ + /kasmos/install/office/install_office_app.sh \ + /ubuntu/install/zoom/install_zoom.sh \ + /ubuntu/install/thunderbird/install_thunderbird.sh \ + /ubuntu/install/slack/install_slack.sh \ + /ubuntu/install/gamepad_utils/install_gamepad_utils.sh \ + /ubuntu/install/cleanup/cleanup.sh" + +# Copy install scripts +COPY ./src/ $INST_DIR + +# Run installations +RUN \ + for SCRIPT in $INST_SCRIPTS; do \ + bash ${INST_DIR}${SCRIPT} || exit 1; \ + done && \ + $STARTUPDIR/set_user_permission.sh $HOME && \ + rm -f /etc/X11/xinit/Xclients && \ + chown 1000:0 $HOME && \ + mkdir -p /home/kasm-user && \ + chown -R 1000:0 /home/kasm-user && \ + rm -Rf ${INST_DIR} + +# Remove desktop shortcuts +RUN rm $HOME/Desktop/*.desktop \ + && sed -i 's#inode/directory;##g' /usr/share/applications/code.desktop + +# Userspace Runtime +ENV HOME /home/kasm-user +WORKDIR $HOME +USER 1000 + +CMD ["--tail-log"] \ No newline at end of file diff --git a/src/kasmos/install/browser/install_browser.sh b/src/kasmos/install/browser/install_browser.sh new file mode 100644 index 0000000..095029f --- /dev/null +++ b/src/kasmos/install/browser/install_browser.sh @@ -0,0 +1,16 @@ +ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') +if [ "$ARCH" == "amd64" ] ; then + bash ${INST_DIR}/ubuntu/install/chrome/install_chrome.sh + + # Remove default app launchers + rm -f $HOME/Desktop/google-chrome.desktop + rm -f /usr/share/applications/browser.desktop + mv /usr/share/applications/google-chrome.desktop /usr/share/applications/browser.desktop +else + bash ${INST_DIR}/ubuntu/install/chromium/install_chromium.sh + + rm -f $HOME/Desktop/chromium.desktop + rm -f /usr/share/applications/browser.desktop + mv /usr/share/applications/chromium.desktop /usr/share/applications/browser.desktop + +fi \ No newline at end of file diff --git a/src/kasmos/install/office/install_office_app.sh b/src/kasmos/install/office/install_office_app.sh new file mode 100644 index 0000000..49c33b7 --- /dev/null +++ b/src/kasmos/install/office/install_office_app.sh @@ -0,0 +1,13 @@ +ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') +if [ "$ARCH" == "amd64" ] ; then + bash ${INST_DIR}/ubuntu/install/only_office/install_only_office.sh + + # Remove default app launchers + rm -f $HOME/Desktop/onlyoffice-desktopeditors.desktop + rm -f /usr/share/applications/onlyoffice-desktopeditors.desktop + + cp ${INST_DIR}/kasmos/resources/onlyoffice/*.desktop /usr/share/applications/ +else + apt update + apt install -y libreoffice-plasma +fi \ No newline at end of file diff --git a/src/kasmos/resources/onlyoffice/docs-editor.desktop b/src/kasmos/resources/onlyoffice/docs-editor.desktop new file mode 100644 index 0000000..0b1d5fd --- /dev/null +++ b/src/kasmos/resources/onlyoffice/docs-editor.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Version=1.0 +Name=Docs +GenericName=Document Editor +Comment=Document Editor +Type=Application +Exec=/usr/bin/onlyoffice-desktopeditors --new=word %U +Terminal=false +Icon=application-msword +Keywords=Text;Document;OpenDocument Text;Microsoft Word;Microsoft Works;odt;doc;docx;rtf; +Categories=Office;WordProcessor;Spreadsheet; +MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;text/csv;text/spreadsheet;application/csv;application/excel;application/x-excel;application/x-msexcel;application/x-ms-excel;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.slide;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.ms-powerpoint.slideshow.macroEnabled.12;x-scheme-handler/oo-office;text/docxf;text/oform; +Actions=NewDocument; + +[Desktop Action NewDocument] +Name=New Document +Name[de]=Neues Dokument +Name[fr]=Nouveau document +Name[es]=Documento nuevo +Name[ru]=Создать документ +Exec=/usr/bin/onlyoffice-desktopeditors --new:word diff --git a/src/kasmos/resources/onlyoffice/present-editor.desktop b/src/kasmos/resources/onlyoffice/present-editor.desktop new file mode 100644 index 0000000..0839ea7 --- /dev/null +++ b/src/kasmos/resources/onlyoffice/present-editor.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Version=1.0 +Name=Slides +GenericName=Slide Deck Editor +Comment=Slide Deck Editor +Type=Application +Exec=/usr/bin/onlyoffice-desktopeditors --new=slide %U +Terminal=false +Icon=application-mspowerpoint +Keywords=Text;Document;OpenDocument Text;Microsoft Word;Microsoft Works;odt;doc;docx;rtf; +Categories=Office; +MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;text/csv;text/spreadsheet;application/csv;application/excel;application/x-excel;application/x-msexcel;application/x-ms-excel;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.slide;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.ms-powerpoint.slideshow.macroEnabled.12;x-scheme-handler/oo-office;text/docxf;text/oform; +Actions=NewPresentation; + +[Desktop Action NewPresentation] +Name=New Presentation +Name[de]=Neue Präsentation +Name[fr]=Nouvelle présentation +Name[es]=Presentación nueva +Name[ru]=Создать презентацию +Exec=/usr/bin/onlyoffice-desktopeditors --new:slide diff --git a/src/kasmos/resources/onlyoffice/sheets-editor.desktop b/src/kasmos/resources/onlyoffice/sheets-editor.desktop new file mode 100644 index 0000000..9a44e06 --- /dev/null +++ b/src/kasmos/resources/onlyoffice/sheets-editor.desktop @@ -0,0 +1,21 @@ +[Desktop Entry] +Version=1.0 +Name=Sheets +GenericName=Spreadsheet Editor +Comment=Spreadsheet Editor +Type=Application +Exec=/usr/bin/onlyoffice-desktopeditors --new=cell %U +Terminal=false +Icon=application-x-excel +Keywords=Text;Document;OpenDocument Text;Microsoft Word;Microsoft Works;odt;doc;docx;rtf; +Categories=Office;WordProcessor;Spreadsheet; +MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;text/csv;text/spreadsheet;application/csv;application/excel;application/x-excel;application/x-msexcel;application/x-ms-excel;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv;application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.slide;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.ms-powerpoint.slideshow.macroEnabled.12;x-scheme-handler/oo-office;text/docxf;text/oform; +Actions=NewSpreadsheet; + +[Desktop Action NewSpreadsheet] +Name=New Spreadsheet +Name[de]=Neues Tabellendokument +Name[fr]=Nouveau classeur +Name[es]=Hoja de cálculo nueva +Name[ru]=Создать эл.таблицу +Exec=/usr/bin/onlyoffice-desktopeditors --new:cell diff --git a/src/ubuntu/install/only_office/install_only_office.sh b/src/ubuntu/install/only_office/install_only_office.sh index fab061a..89746c0 100644 --- a/src/ubuntu/install/only_office/install_only_office.sh +++ b/src/ubuntu/install/only_office/install_only_office.sh @@ -7,10 +7,10 @@ if [ "$ARCH" == "arm64" ] ; then echo "Only Office is not supported on arm64, skipping Only Office installation" exit 0 fi -curl -L -o only_office.deb "https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_${ARCH}.deb" +curl -L -o /tmp/only_office.deb "https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_${ARCH}.deb" apt-get update -apt-get install -y ./only_office.deb -rm -rf only_office.deb +apt-get install -y /tmp/only_office.deb +rm -rf /tmp/only_office.deb # Desktop icon cp /usr/share/applications/onlyoffice-desktopeditors.desktop $HOME/Desktop