mirror of
https://github.com/kasmtech/workspaces-core-images.git
synced 2025-06-25 22:41:47 +02:00
Resolve KASM-6341 "Feature/ pcm audio"
This commit is contained in:
parent
8d94df5afc
commit
81b2294d18
@ -9,15 +9,8 @@ COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|||||||
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
FROM install_tools AS squid_builder
|
|
||||||
ARG DISTRO=alpine
|
|
||||||
|
|
||||||
RUN ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
|
||||||
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/f2b6ac26e7f91240e57d6d6e1dad4cc2704445ee/output/kasm-squid-builder_alpine_${ARCH}.tar.gz"
|
|
||||||
RUN tar -xzf kasm-squid-builder_*.tar.gz -C /
|
|
||||||
|
|
||||||
### Layer from squid changes
|
### Layer from squid changes
|
||||||
FROM install_tools as base_layer
|
FROM install_tools AS base_layer
|
||||||
|
|
||||||
### Environment config
|
### Environment config
|
||||||
ARG BG_IMG=bg_alpine.png
|
ARG BG_IMG=bg_alpine.png
|
||||||
@ -100,9 +93,6 @@ COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
|||||||
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
||||||
RUN apk add --no-cache coreutils # the timeout function used by the backend needs to be the one from core utils.
|
RUN apk add --no-cache coreutils # the timeout function used by the backend needs to be the one from core utils.
|
||||||
|
|
||||||
### Copy built Squid
|
|
||||||
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
||||||
|
|
||||||
### Install Squid
|
### Install Squid
|
||||||
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
||||||
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
||||||
|
@ -13,12 +13,7 @@ COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|||||||
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
FROM install_tools AS squid_builder
|
FROM install_tools AS base_layer
|
||||||
|
|
||||||
RUN wget --progress=dot:giga 'https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/de1dffbc94d4132d6c696de8c6dfcd6f08900f61/output/kasm-squid-builder_centos_amd64.tar.gz'
|
|
||||||
RUN tar -xzf kasm-squid-builder_centos_amd64.tar.gz -C /
|
|
||||||
|
|
||||||
FROM install_tools as base_layer
|
|
||||||
|
|
||||||
### Environment config
|
### Environment config
|
||||||
ARG BG_IMG=bg_centos.png
|
ARG BG_IMG=bg_centos.png
|
||||||
@ -101,9 +96,6 @@ COPY ./src/ubuntu/install/printer/resources/*.ppd /etc/cups/ppd/
|
|||||||
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
||||||
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
||||||
|
|
||||||
### Copy built Squid
|
|
||||||
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
||||||
|
|
||||||
### Install Squid
|
### Install Squid
|
||||||
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
||||||
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
||||||
|
@ -12,15 +12,7 @@ COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|||||||
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
FROM install_tools AS squid_builder
|
FROM install_tools AS base_layer
|
||||||
|
|
||||||
ARG DISTRO=fedora37
|
|
||||||
|
|
||||||
RUN ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
|
||||||
wget "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/1149fc830c7edcb383eec390cce2beba16befde5/output/kasm-squid-builder_${ARCH}.tar.gz"
|
|
||||||
RUN tar -xzf kasm-squid-builder_*.tar.gz -C /
|
|
||||||
|
|
||||||
FROM install_tools as base_layer
|
|
||||||
|
|
||||||
MAINTAINER Kasm Tech "info@kasmweb.com"
|
MAINTAINER Kasm Tech "info@kasmweb.com"
|
||||||
LABEL "com.kasmweb.image"="true"
|
LABEL "com.kasmweb.image"="true"
|
||||||
@ -109,9 +101,6 @@ COPY ./src/ubuntu/install/printer/resources/*.ppd /etc/cups/ppd/
|
|||||||
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
||||||
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
||||||
|
|
||||||
### Copy built Squid
|
|
||||||
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
||||||
|
|
||||||
### Install Squid
|
### Install Squid
|
||||||
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
||||||
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
||||||
|
@ -12,20 +12,7 @@ COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|||||||
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
FROM install_tools AS squid_builder
|
FROM install_tools AS base_layer
|
||||||
|
|
||||||
ARG DISTRO=oracle8
|
|
||||||
|
|
||||||
RUN if [ "${DISTRO}" == "oracle8" ] || [ "${DISTRO}" == "oracle9" ] || [ "${DISTRO}" == "rockylinux9" ] || [ "${DISTRO}" == "rockylinux8" ] || [ "${DISTRO}" == "almalinux8" ] || [ "${DISTRO}" == "almalinux9" ] || [ "${DISTRO}" == "rhel9" ]; then \
|
|
||||||
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
|
||||||
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/1149fc830c7edcb383eec390cce2beba16befde5/output/kasm-squid-builder_${ARCH}.tar.gz"; \
|
|
||||||
else \
|
|
||||||
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
|
||||||
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/de1dffbc94d4132d6c696de8c6dfcd6f08900f61/output/kasm-squid-builder_centos_${ARCH}.tar.gz"; \
|
|
||||||
fi
|
|
||||||
RUN tar -xzf kasm-squid-builder_*.tar.gz -C /
|
|
||||||
|
|
||||||
FROM install_tools as base_layer
|
|
||||||
|
|
||||||
MAINTAINER Kasm Tech "info@kasmweb.com"
|
MAINTAINER Kasm Tech "info@kasmweb.com"
|
||||||
LABEL "com.kasmweb.image"="true"
|
LABEL "com.kasmweb.image"="true"
|
||||||
@ -128,9 +115,6 @@ COPY ./src/ubuntu/install/printer/resources/*.ppd /etc/cups/ppd/
|
|||||||
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
||||||
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
||||||
|
|
||||||
### Copy built Squid
|
|
||||||
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
||||||
|
|
||||||
### Install Squid
|
### Install Squid
|
||||||
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
||||||
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
||||||
|
@ -11,15 +11,7 @@ COPY ./src/ubuntu/install/tools $INST_SCRIPTS/tools/
|
|||||||
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
RUN bash "$INST_SCRIPTS/tools/install_tools.sh" && rm -rf "$INST_SCRIPTS/tools/"
|
||||||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
FROM install_tools AS squid_builder
|
FROM install_tools AS base_layer
|
||||||
|
|
||||||
ARG DISTRO=opensuse
|
|
||||||
|
|
||||||
RUN ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g') && \
|
|
||||||
wget --progress=dot:giga "https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/1149fc830c7edcb383eec390cce2beba16befde5/output/kasm-squid-builder_${ARCH}.tar.gz"
|
|
||||||
RUN tar -xzf kasm-squid-builder_*.tar.gz -C /
|
|
||||||
|
|
||||||
FROM install_tools as base_layer
|
|
||||||
|
|
||||||
### Environment config
|
### Environment config
|
||||||
ARG BG_IMG=bg_opensuse.png
|
ARG BG_IMG=bg_opensuse.png
|
||||||
@ -99,9 +91,6 @@ COPY ./src/ubuntu/install/printer/resources/*.ppd /etc/cups/ppd/
|
|||||||
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
COPY ./src/ubuntu/install/recorder $INST_SCRIPTS/recorder/
|
||||||
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
RUN bash $INST_SCRIPTS/recorder/install_recorder.sh && rm -rf $INST_SCRIPTS/recorder
|
||||||
|
|
||||||
### Copy built Squid
|
|
||||||
COPY --from=squid_builder /usr/local/squid /usr/local/squid
|
|
||||||
|
|
||||||
### Install Squid
|
### Install Squid
|
||||||
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
COPY ./src/ubuntu/install/squid/install/ $INST_SCRIPTS/squid_install/
|
||||||
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
RUN bash $INST_SCRIPTS/squid_install/install_squid.sh && rm -rf $INST_SCRIPTS/squid_install/
|
||||||
|
@ -266,6 +266,25 @@ function start_audio_out (){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function start_pcm_audio (){
|
||||||
|
if [[ ${KASM_SVC_AUDIO:-1} == 1 ]]; then
|
||||||
|
log 'Starting audio out'
|
||||||
|
if [ "${START_PULSEAUDIO:-0}" == "1" ] ;
|
||||||
|
then
|
||||||
|
echo "Starting Pulse"
|
||||||
|
HOME=/var/run/pulse pulseaudio --start
|
||||||
|
fi
|
||||||
|
/opt/audio/start kasmaudio 4901 ${HOME}/.vnc/self.pem ${HOME}/.vnc/self.pem "kasm_user:$VNC_PW" &
|
||||||
|
|
||||||
|
KASM_PROCS['kasm_audio_server']=$!
|
||||||
|
|
||||||
|
if [[ $DEBUG == true ]]; then
|
||||||
|
echo -e "\n------------------ Started Audio Server ----------------------------"
|
||||||
|
echo "Kasm Audio Server PID: ${KASM_PROCS['kasm_audio_server']}";
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function start_audio_in (){
|
function start_audio_in (){
|
||||||
if [[ ${KASM_SVC_AUDIO_INPUT:-1} == 1 ]]; then
|
if [[ ${KASM_SVC_AUDIO_INPUT:-1} == 1 ]]; then
|
||||||
log 'Starting audio input server'
|
log 'Starting audio input server'
|
||||||
@ -523,8 +542,12 @@ chmod 600 $PASSWD_PATH
|
|||||||
wait_on_printer
|
wait_on_printer
|
||||||
start_kasmvnc
|
start_kasmvnc
|
||||||
start_window_manager
|
start_window_manager
|
||||||
start_audio_out_websocket
|
if [ -z ${PCM_AUDIO+x} ]; then
|
||||||
start_audio_out
|
start_audio_out_websocket
|
||||||
|
start_audio_out
|
||||||
|
else
|
||||||
|
start_pcm_audio
|
||||||
|
fi
|
||||||
start_audio_in
|
start_audio_in
|
||||||
start_upload
|
start_upload
|
||||||
start_gamepad
|
start_gamepad
|
||||||
@ -590,7 +613,11 @@ do
|
|||||||
echo "Restarting Audio Out Service"
|
echo "Restarting Audio Out Service"
|
||||||
start_audio_out
|
start_audio_out
|
||||||
;;
|
;;
|
||||||
kasm_audio_in)
|
kasm_audio_server)
|
||||||
|
echo "Restarting Audio Server"
|
||||||
|
start_pcm_audio
|
||||||
|
;;
|
||||||
|
kasm_audio_in)
|
||||||
echo "Audio In Service Failed"
|
echo "Audio In Service Failed"
|
||||||
# TODO: Needs work in python project to support auto restart
|
# TODO: Needs work in python project to support auto restart
|
||||||
# start_audio_in
|
# start_audio_in
|
||||||
@ -600,7 +627,7 @@ do
|
|||||||
# TODO: This will only work if both processes are killed, requires more work
|
# TODO: This will only work if both processes are killed, requires more work
|
||||||
start_upload
|
start_upload
|
||||||
;;
|
;;
|
||||||
kasm_gamepad)
|
kasm_gamepad)
|
||||||
echo "Gamepad Service Failed"
|
echo "Gamepad Service Failed"
|
||||||
# TODO: Needs work in python project to support auto restart
|
# TODO: Needs work in python project to support auto restart
|
||||||
# start_gamepad
|
# start_gamepad
|
||||||
|
@ -45,7 +45,7 @@ elif [ "${DISTRO}" == "fedora40" ]; then
|
|||||||
dnf localinstall -y --nogpgcheck https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-40.noarch.rpm
|
dnf localinstall -y --nogpgcheck https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-40.noarch.rpm
|
||||||
dnf install -y --allowerasing ffmpeg pulseaudio pulseaudio-utils
|
dnf install -y --allowerasing ffmpeg pulseaudio pulseaudio-utils
|
||||||
elif [ "${DISTRO}" == "opensuse" ]; then
|
elif [ "${DISTRO}" == "opensuse" ]; then
|
||||||
zypper install -ny curl git
|
zypper install -ny curl git
|
||||||
zypper install -yn ffmpeg pulseaudio-utils
|
zypper install -yn ffmpeg pulseaudio-utils
|
||||||
elif [ "${DISTRO}" == "alpine" ]; then
|
elif [ "${DISTRO}" == "alpine" ]; then
|
||||||
if grep -q v3.19 /etc/os-release || grep -q v3.20 /etc/os-release; then
|
if grep -q v3.19 /etc/os-release || grep -q v3.20 /etc/os-release; then
|
||||||
@ -64,7 +64,7 @@ elif [ "${DISTRO}" == "alpine" ]; then
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y \
|
apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
git \
|
git \
|
||||||
@ -74,7 +74,17 @@ fi
|
|||||||
|
|
||||||
mkdir -p /var/run/pulse
|
mkdir -p /var/run/pulse
|
||||||
|
|
||||||
|
WS_COMMIT_ID="f7efb82dc59a02d1b99e2e2b3c6d127dc548ba72"
|
||||||
|
WS_BRANCH="develop"
|
||||||
|
WS_COMMIT_ID_SHORT=$(echo "${WS_COMMIT_ID}" | cut -c1-6)
|
||||||
|
|
||||||
|
AS_COMMIT_ID="40caefd2f6732fe5ab90091e89a1e364210afff0"
|
||||||
|
AS_BRANCH="develop"
|
||||||
|
AS_COMMIT_ID_SHORT=$(echo "${AS_COMMIT_ID}" | cut -c1-6)
|
||||||
|
|
||||||
cd $STARTUPDIR
|
cd $STARTUPDIR
|
||||||
mkdir jsmpeg
|
mkdir jsmpeg
|
||||||
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_websocket_relay/f7efb82dc59a02d1b99e2e2b3c6d127dc548ba72/kasm_websocket_relay_${ARCH}_develop.f7efb8.tar.gz | tar xz --strip 1 -C $STARTUPDIR/jsmpeg
|
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_websocket_relay/${WS_COMMIT_ID}/kasm_websocket_relay_${ARCH}_${WS_BRANCH}.${WS_COMMIT_ID_SHORT}.tar.gz | tar xz --strip 1 -C $STARTUPDIR/jsmpeg
|
||||||
chmod +x $STARTUPDIR/jsmpeg/kasm_audio_out-linux
|
chmod +x $STARTUPDIR/jsmpeg/kasm_audio_out-linux
|
||||||
|
mkdir /opt/audio
|
||||||
|
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_audio_server/${AS_COMMIT_ID}/kasm_audio_server_${ARCH}_${AS_BRANCH}.${AS_COMMIT_ID_SHORT}.tar.gz | tar xz -C /opt/audio
|
||||||
|
@ -2,10 +2,9 @@
|
|||||||
### every exit != 0 fails the script
|
### every exit != 0 fails the script
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
COMMIT_ID="10aac48a50c7b8a03fd94e2dc404ebb7e7ab9e24"
|
COMMIT_ID="10efaf2e06feb2c1e3f7ee05978bbb9f0142c01b"
|
||||||
BRANCH="develop"
|
BRANCH="develop"
|
||||||
COMMIT_ID_SHORT=$(echo "${COMMIT_ID}" | cut -c1-6)
|
COMMIT_ID_SHORT=$(echo "${COMMIT_ID}" | cut -c1-6)
|
||||||
|
|
||||||
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
|
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
|
||||||
|
|
||||||
mkdir -p $STARTUPDIR/audio_input
|
mkdir -p $STARTUPDIR/audio_input
|
||||||
|
@ -11,7 +11,6 @@ elif [ "${DISTRO}" == "opensuse" ]; then
|
|||||||
elif [[ "${DISTRO}" == @(debian|kali|parrotos6|ubuntu) ]]; then
|
elif [[ "${DISTRO}" == @(debian|kali|parrotos6|ubuntu) ]]; then
|
||||||
# Uninstall unneccesary/vulnerable packages
|
# Uninstall unneccesary/vulnerable packages
|
||||||
dpkg --purge ipp-usb #KASM-5266
|
dpkg --purge ipp-usb #KASM-5266
|
||||||
|
|
||||||
apt-get autoremove -y
|
apt-get autoremove -y
|
||||||
apt-get autoclean -y
|
apt-get autoclean -y
|
||||||
fi
|
fi
|
||||||
|
@ -16,6 +16,7 @@ elif [ "${DISTRO}" == "alpine" ]; then
|
|||||||
usermod -a -G lpadmin root
|
usermod -a -G lpadmin root
|
||||||
else
|
else
|
||||||
apt-get update
|
apt-get update
|
||||||
|
apt-get install -y cups-filters
|
||||||
apt-get install -y cups cups-client cups-pdf
|
apt-get install -y cups cups-client cups-pdf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1,31 +1,31 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
# Install openssl
|
||||||
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
|
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
|
||||||
if [[ "${ARCH}" == "arm64" ]]; then
|
if [[ "${DISTRO}" == @(centos|oracle7|oracle8|oracle9|rhel9|fedora37|fedora38|fedora39|fedora40|almalinux8|almalinux9|rockylinux8|rockylinux9) ]]; then
|
||||||
LIBSSLDEB=$(curl -sL http://ports.ubuntu.com/pool/main/o/openssl/ | awk -F'(href="|">)' '/libssl1.1.*ubuntu2.[0-9][0-9]_arm64.deb/ {print $4}')
|
dnf install -y openssl xkbcomp
|
||||||
LIBSSLRPM=$(curl -sL https://ap.edge.kernel.org/fedora/releases/39/Everything/aarch64/os/Packages/o/ | awk -F'(href="|">)' '/openssl1.1-1/ {print $2}')
|
rm -f /etc/X11/xinit/xinitrc
|
||||||
LIBSSLURL="http://ports.ubuntu.com/pool/main/o/openssl/${LIBSSLDEB}"
|
elif [[ "${DISTRO}" == "alpine" ]]; then
|
||||||
RPMLIBSSL="https://ap.edge.kernel.org/fedora/releases/39/Everything/aarch64/os/Packages/o/${LIBSSLRPM}"
|
apk add --no-cache openssl
|
||||||
|
elif [ "${DISTRO}" == "opensuse" ]; then
|
||||||
|
zypper install -yn openssl
|
||||||
else
|
else
|
||||||
LIBSSLDEB=$(curl -sL http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/ | awk -F'(href="|">)' '/libssl1.1.*ubuntu2.[0-9][0-9]_amd64.deb/ {print $4}')
|
apt-get update
|
||||||
LIBSSLRPM=$(curl -sL https://ap.edge.kernel.org/fedora/releases/39/Everything/x86_64/os/Packages/o/ | awk -F'(href="|">)' '/openssl1.1-1.*x86_64/ {print $2}')
|
apt-get install -y openssl
|
||||||
LIBSSLURL="http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/${LIBSSLDEB}"
|
|
||||||
RPMLIBSSL="https://ap.edge.kernel.org/fedora/releases/39/Everything/x86_64/os/Packages/o/${LIBSSLRPM}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# intall squid
|
# Intall squid
|
||||||
SQUID_COMMIT='1149fc830c7edcb383eec390cce2beba16befde5'
|
SQUID_COMMIT='c45537169794a16029e06d7d456edb21b9ce7d12'
|
||||||
if $(grep -q Jammy /etc/os-release) || $(grep -q Kali /etc/os-release) || $(grep -q lory /etc/os-release); then
|
if $(grep -q Focal /etc/os-release) || $(grep -q bullseye /etc/os-release) || [ -f /usr/bin/zypper ] || [[ "${DISTRO}" == @(oracle8|almalinux8|rockylinux8) ]]; then
|
||||||
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_${ARCH}.tar.gz | tar -xzf - -C /
|
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_ubuntu11_${ARCH}.tar.gz | tar -xzf - -C /
|
||||||
wget ${LIBSSLURL} -O libssl1.1.${ARCH}.deb
|
elif [[ "${DISTRO}" == "alpine" ]]; then
|
||||||
dpkg -i libssl1.1.${ARCH}.deb
|
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_alpine_${ARCH}.tar.gz | tar -xzf - -C /
|
||||||
rm -f libssl1.1.${ARCH}.deb
|
else
|
||||||
elif [[ "${DISTRO}" != @(centos|oracle7|oracle8|oracle9|rhel9|opensuse|fedora37|fedora38|fedora39|fedora40|rockylinux9|rockylinux8|almalinux9|almalinux8|alpine) ]] ; then
|
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_ubuntu_${ARCH}.tar.gz | tar -xzf - -C /
|
||||||
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm-squid-builder/${SQUID_COMMIT}/output/kasm-squid-builder_${ARCH}.tar.gz | tar -xzf - -C /
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# update squid conf with user info
|
# Update squid conf with user info
|
||||||
if [[ "${DISTRO}" == @(centos|oracle7|oracle8|oracle9|rhel9|fedora37|fedora38|fedora39|fedora40|almalinux8|almalinux9|rockylinux8|rockylinux9|alpine) ]]; then
|
if [[ "${DISTRO}" == @(centos|oracle7|oracle8|oracle9|rhel9|fedora37|fedora38|fedora39|fedora40|almalinux8|almalinux9|rockylinux8|rockylinux9|alpine) ]]; then
|
||||||
useradd --system --shell /usr/sbin/nologin --home-dir /bin proxy
|
useradd --system --shell /usr/sbin/nologin --home-dir /bin proxy
|
||||||
elif [ "${DISTRO}" == "opensuse" ]; then
|
elif [ "${DISTRO}" == "opensuse" ]; then
|
||||||
@ -34,43 +34,14 @@ elif [ "${DISTRO}" == "opensuse" ]; then
|
|||||||
usermod -a -G proxy proxy
|
usermod -a -G proxy proxy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# File and perms
|
||||||
mkdir /usr/local/squid/etc/ssl_cert -p
|
mkdir /usr/local/squid/etc/ssl_cert -p
|
||||||
chown proxy:proxy /usr/local/squid/etc/ssl_cert -R
|
chown proxy:proxy /usr/local/squid/etc/ssl_cert -R
|
||||||
chmod 700 /usr/local/squid/etc/ssl_cert -R
|
chmod 700 /usr/local/squid/etc/ssl_cert -R
|
||||||
cd /usr/local/squid/etc/ssl_cert
|
cd /usr/local/squid/etc/ssl_cert
|
||||||
|
|
||||||
if [[ "${DISTRO}" == @(fedora37|fedora38|fedora39) ]]; then
|
|
||||||
dnf install -y openssl1.1 xkbcomp
|
|
||||||
rm -f /etc/X11/xinit/xinitrc
|
|
||||||
elif [[ "${DISTRO}" == "fedora40" ]]; then
|
|
||||||
curl -o \
|
|
||||||
/tmp/libssl.rpm -L \
|
|
||||||
"${RPMLIBSSL}"
|
|
||||||
rpm -i \
|
|
||||||
/tmp/libssl.rpm
|
|
||||||
rm -f /etc/X11/xinit/xinitrc
|
|
||||||
elif [[ "${DISTRO}" == @(rockylinux9|oracle9|rhel9|almalinux9) ]]; then
|
|
||||||
dnf install -y compat-openssl11 xkbcomp
|
|
||||||
rm -f /etc/X11/xinit/xinitrc
|
|
||||||
elif [[ "${DISTRO}" == @(centos|oracle7) ]]; then
|
|
||||||
yum install -y openssl11-libs
|
|
||||||
elif [[ "${DISTRO}" == "alpine" ]]; then
|
|
||||||
if grep -q v3.19 /etc/os-release || grep -q v3.20 /etc/os-release; then
|
|
||||||
apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing openssl1.1-compat
|
|
||||||
else
|
|
||||||
apk add --no-cache openssl1.1-compat
|
|
||||||
fi
|
|
||||||
elif grep -q bookworm /etc/os-release || grep -q noble /etc/os-release; then
|
|
||||||
wget ${LIBSSLURL} -O libssl1.1.${ARCH}.deb
|
|
||||||
dpkg -i libssl1.1.${ARCH}.deb
|
|
||||||
rm -f libssl1.1.${ARCH}.deb
|
|
||||||
fi
|
|
||||||
|
|
||||||
/usr/local/squid/libexec/security_file_certgen -c -s /usr/local/squid/var/logs/ssl_db -M 4MB
|
/usr/local/squid/libexec/security_file_certgen -c -s /usr/local/squid/var/logs/ssl_db -M 4MB
|
||||||
chown proxy:proxy /usr/local/squid/var/logs/ssl_db -R
|
chown proxy:proxy /usr/local/squid/var/logs/ssl_db -R
|
||||||
|
|
||||||
chown -R proxy:proxy /usr/local/squid -R
|
chown -R proxy:proxy /usr/local/squid -R
|
||||||
|
|
||||||
mkdir -p /etc/squid/
|
mkdir -p /etc/squid/
|
||||||
|
|
||||||
# Trick so we can auto re-direct blocked urls to a special page
|
# Trick so we can auto re-direct blocked urls to a special page
|
||||||
|
@ -11,7 +11,6 @@ if [[ "${DISTRO}" == @(centos|oracle7) ]] ; then
|
|||||||
elif [[ "${DISTRO}" == @(fedora37|fedora38|fedora39|fedora40|oracle8|oracle9|rhel9|rockylinux9|rockylinux8|almalinux8|almalinux9) ]]; then
|
elif [[ "${DISTRO}" == @(fedora37|fedora38|fedora39|fedora40|oracle8|oracle9|rhel9|rockylinux9|rockylinux8|almalinux8|almalinux9) ]]; then
|
||||||
dnf install -y wget net-tools bzip2 tar vim hostname procps-ng bc
|
dnf install -y wget net-tools bzip2 tar vim hostname procps-ng bc
|
||||||
elif [ "${DISTRO}" == "opensuse" ]; then
|
elif [ "${DISTRO}" == "opensuse" ]; then
|
||||||
#sed -i 's/download.opensuse.org/mirrorcache-us.opensuse.org/g' /etc/zypp/repos.d/*.repo
|
|
||||||
zypper install -yn wget net-tools bzip2 tar vim gzip iputils bc
|
zypper install -yn wget net-tools bzip2 tar vim gzip iputils bc
|
||||||
elif [ "${DISTRO}" == "alpine" ]; then
|
elif [ "${DISTRO}" == "alpine" ]; then
|
||||||
apk add --no-cache \
|
apk add --no-cache \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user