From 769313610c934bd20091671534dd70b8848d78aa Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Wed, 12 Oct 2022 12:30:11 +0000 Subject: [PATCH] Resolve KASM-3036 "Bugfix/ rpm to be on 0.9.4" --- dockerfile-kasm-core | 1 + dockerfile-kasm-core-centos | 1 + dockerfile-kasm-core-oracle | 1 + dockerfile-kasm-core-suse | 1 + src/common/install/kasm_vnc/kasmvnc.yaml | 4 ++ src/common/startup_scripts/vnc_startup.sh | 5 ++- .../install/kasm_vnc/install_kasm_vnc.sh | 45 ++++++++----------- 7 files changed, 30 insertions(+), 28 deletions(-) create mode 100644 src/common/install/kasm_vnc/kasmvnc.yaml diff --git a/dockerfile-kasm-core b/dockerfile-kasm-core index fe0277e..27696eb 100644 --- a/dockerfile-kasm-core +++ b/dockerfile-kasm-core @@ -86,6 +86,7 @@ ADD /src/common/resources/images/icon_kasm.png /usr/share/extra/icons/icon_kasm. ### Install kasm_vnc dependencies and binaries COPY ./src/ubuntu/install/kasm_vnc $INST_SCRIPTS/kasm_vnc/ RUN bash $INST_SCRIPTS/kasm_vnc/install_kasm_vnc.sh && rm -rf $INST_SCRIPTS/kasm_vnc/ +COPY ./src/common/install/kasm_vnc/kasmvnc.yaml /etc/kasmvnc/ ### Install Kasm Upload Server COPY ./src/ubuntu/install/kasm_upload_server $INST_SCRIPTS/kasm_upload_server/ diff --git a/dockerfile-kasm-core-centos b/dockerfile-kasm-core-centos index e3fc3c8..664dd4f 100644 --- a/dockerfile-kasm-core-centos +++ b/dockerfile-kasm-core-centos @@ -88,6 +88,7 @@ COPY /src/common/resources/images/$BG_IMG /usr/share/backgrounds/bg_default.png ### Install kasm_vnc dependencies and binaries COPY ./src/ubuntu/install/kasm_vnc $INST_SCRIPTS/kasm_vnc/ RUN bash $INST_SCRIPTS/kasm_vnc/install_kasm_vnc.sh && rm -rf $INST_SCRIPTS/kasm_vnc/ +COPY ./src/common/install/kasm_vnc/kasmvnc.yaml /etc/kasmvnc/ ### Install Kasm Upload Server COPY ./src/ubuntu/install/kasm_upload_server $INST_SCRIPTS/kasm_upload_server/ diff --git a/dockerfile-kasm-core-oracle b/dockerfile-kasm-core-oracle index 2b8042f..cdfd80c 100644 --- a/dockerfile-kasm-core-oracle +++ b/dockerfile-kasm-core-oracle @@ -101,6 +101,7 @@ COPY /src/common/resources/images/$BG_IMG /usr/share/backgrounds/bg_default.png ### Install kasm_vnc dependencies and binaries COPY ./src/ubuntu/install/kasm_vnc $INST_SCRIPTS/kasm_vnc/ RUN bash $INST_SCRIPTS/kasm_vnc/install_kasm_vnc.sh && rm -rf $INST_SCRIPTS/kasm_vnc/ +COPY ./src/common/install/kasm_vnc/kasmvnc.yaml /etc/kasmvnc/ ### Install Kasm Upload Server COPY ./src/ubuntu/install/kasm_upload_server $INST_SCRIPTS/kasm_upload_server/ diff --git a/dockerfile-kasm-core-suse b/dockerfile-kasm-core-suse index 3e4ceb5..cb33ab9 100644 --- a/dockerfile-kasm-core-suse +++ b/dockerfile-kasm-core-suse @@ -85,6 +85,7 @@ COPY /src/common/resources/images/$BG_IMG /usr/share/backgrounds/bg_default.png ### Install kasm_vnc dependencies and binaries COPY ./src/ubuntu/install/kasm_vnc $INST_SCRIPTS/kasm_vnc/ RUN bash $INST_SCRIPTS/kasm_vnc/install_kasm_vnc.sh && rm -rf $INST_SCRIPTS/kasm_vnc/ +COPY ./src/common/install/kasm_vnc/kasmvnc.yaml /etc/kasmvnc/ ### Install Kasm Upload Server COPY ./src/ubuntu/install/kasm_upload_server $INST_SCRIPTS/kasm_upload_server/ diff --git a/src/common/install/kasm_vnc/kasmvnc.yaml b/src/common/install/kasm_vnc/kasmvnc.yaml new file mode 100644 index 0000000..d794e04 --- /dev/null +++ b/src/common/install/kasm_vnc/kasmvnc.yaml @@ -0,0 +1,4 @@ +network: + ssl: + pem_certificate: ${HOME}/.vnc/self.pem + pem_key: ${HOME}/.vnc/self.pem diff --git a/src/common/startup_scripts/vnc_startup.sh b/src/common/startup_scripts/vnc_startup.sh index cc8486e..b5ea7fd 100755 --- a/src/common/startup_scripts/vnc_startup.sh +++ b/src/common/startup_scripts/vnc_startup.sh @@ -58,10 +58,11 @@ function start_kasmvnc (){ rm -rf $HOME/.vnc/*.pid + VNCOPTIONS="$VNCOPTIONS -select-de manual" if [[ "${BUILD_ARCH}" =~ ^aarch64$ ]] && [[ -f /lib/aarch64-linux-gnu/libgcc_s.so.1 ]] ; then - LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -websocketPort $NO_VNC_PORT -cert ${HOME}/.vnc/self.pem -httpd ${KASM_VNC_PATH}/www -sslOnly -FrameRate=$MAX_FRAME_RATE -interface 0.0.0.0 -BlacklistThreshold=0 -FreeKeyMappings $VNCOPTIONS $KASM_SVC_SEND_CUT_TEXT $KASM_SVC_ACCEPT_CUT_TEXT + LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -websocketPort $NO_VNC_PORT -httpd ${KASM_VNC_PATH}/www -sslOnly -FrameRate=$MAX_FRAME_RATE -interface 0.0.0.0 -BlacklistThreshold=0 -FreeKeyMappings $VNCOPTIONS $KASM_SVC_SEND_CUT_TEXT $KASM_SVC_ACCEPT_CUT_TEXT else - vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -websocketPort $NO_VNC_PORT -cert ${HOME}/.vnc/self.pem -httpd ${KASM_VNC_PATH}/www -sslOnly -FrameRate=$MAX_FRAME_RATE -interface 0.0.0.0 -BlacklistThreshold=0 -FreeKeyMappings $VNCOPTIONS $KASM_SVC_SEND_CUT_TEXT $KASM_SVC_ACCEPT_CUT_TEXT + vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -websocketPort $NO_VNC_PORT -httpd ${KASM_VNC_PATH}/www -sslOnly -FrameRate=$MAX_FRAME_RATE -interface 0.0.0.0 -BlacklistThreshold=0 -FreeKeyMappings $VNCOPTIONS $KASM_SVC_SEND_CUT_TEXT $KASM_SVC_ACCEPT_CUT_TEXT fi KASM_PROCS['kasmvnc']=$(cat $HOME/.vnc/*${DISPLAY_NUM}.pid) diff --git a/src/ubuntu/install/kasm_vnc/install_kasm_vnc.sh b/src/ubuntu/install/kasm_vnc/install_kasm_vnc.sh index f99da7a..8a5ce41 100644 --- a/src/ubuntu/install/kasm_vnc/install_kasm_vnc.sh +++ b/src/ubuntu/install/kasm_vnc/install_kasm_vnc.sh @@ -8,13 +8,22 @@ install_libjpeg_turbo() { rm "$libjpeg_deb" } +prepare_rpm_repo_dependencies() { + if [[ "$DISTRO" = "oracle7" ]]; then + yum-config-manager --enable ol7_optional_latest + elif [[ "$DISTRO" = "oracle8" ]]; then + dnf config-manager --set-enabled ol8_codeready_builder + dnf install -y oracle-epel-release-el8 + fi +} + echo "Install KasmVNC server" cd /tmp BUILD_ARCH=$(uname -p) UBUNTU_CODENAME="" -COMMIT_ID="fdc4a63eda4b0bc77742cf1047434515fdf58d17" -BRANCH="release" # just use 'release' for a release branch -KASMVNC_VER="0.9.3.2" +COMMIT_ID="0ef8a51945eb45520367f7e92f75085f0831e2f6" +BRANCH="master" # just use 'release' for a release branch +KASMVNC_VER="0.9.4" COMMIT_ID_SHORT=$(echo "${COMMIT_ID}" | cut -c1-6) # Naming scheme is now different between an official release and feature branch @@ -33,18 +42,18 @@ then BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_kali-rolling_${KASM_VER_NAME_PART}_arm64.deb" fi elif [[ "${DISTRO}" == @(centos|oracle7) ]] ; then - BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/output/centos_core/kasmvncserver-0.9.3~beta-1.el7.x86_64.rpm" + BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_centos_core_${KASM_VER_NAME_PART}_x86_64.rpm" elif [[ "${DISTRO}" == "oracle8" ]] ; then if [[ "$(arch)" =~ ^x86_64$ ]] ; then - BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/output/oracle_8/kasmvncserver-0.9.3~beta-1.el8.x86_64.rpm" + BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_oracle_8_${KASM_VER_NAME_PART}_x86_64.rpm" else - BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/output/oracle_8/kasmvncserver-0.9.3~beta-1.el8.aarch64.rpm" + BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_oracle_8_${KASM_VER_NAME_PART}_aarch64.rpm" fi elif [[ "${DISTRO}" == "opensuse" ]] ; then if [[ "$(arch)" =~ ^x86_64$ ]] ; then - BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/output/opensuse_15/kasmvncserver-0.9.3~beta-leap15.x86_64.rpm" + BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_opensuse_15_${KASM_VER_NAME_PART}_x86_64.rpm" else - BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/output/opensuse_15/kasmvncserver-0.9.3~beta-leap15.aarch64.rpm" + BUILD_URL="https://kasmweb-build-artifacts.s3.amazonaws.com/kasmvnc/${COMMIT_ID}/kasmvncserver_opensuse_15_${KASM_VER_NAME_PART}_aarch64.rpm" fi else UBUNTU_CODENAME=$(grep -Po -m 1 "(?<=_CODENAME=)\w+" /etc/os-release) @@ -58,6 +67,7 @@ else fi +prepare_rpm_repo_dependencies if [[ "${DISTRO}" == @(centos|oracle7) ]] ; then wget "${BUILD_URL}" -O kasmvncserver.rpm yum localinstall -y kasmvncserver.rpm @@ -68,26 +78,9 @@ elif [[ "${DISTRO}" == "oracle8" ]] ; then rm kasmvncserver.rpm dnf clean all elif [[ "${DISTRO}" == "opensuse" ]] ; then - zypper -n install -y \ - libglvnd \ - libgnutls30 \ - libgomp1 \ - libjpeg8 \ - libnettle6 \ - libpixman-1-0 \ - libXdmcp6 \ - libXfont2-2 \ - libxkbcommon-x11-0 \ - openssl \ - perl \ - x11-tools \ - xauth \ - xkbcomp \ - xkeyboard-config \ - xrdb mkdir -p /etc/pki/tls/private wget "${BUILD_URL}" -O kasmvncserver.rpm - rpm -i kasmvncserver.rpm + zypper install -y --allow-unsigned-rpm ./kasmvncserver.rpm rm kasmvncserver.rpm zypper clean --all else