Resolve KASM-1423 "Bugfix/ pulseaudio container storage"

This commit is contained in:
Ryan Kuba 2022-04-06 17:15:22 +00:00 committed by Matthew McClaskey
parent cb9983a1f5
commit b55701d4dd
7 changed files with 25 additions and 13 deletions

View File

@ -40,7 +40,8 @@ ENV DISPLAY=:1 \
LANG=$LANG \
LANGUAGE=$LANGUAGE \
LC_ALL=$LC_ALL \
KASMVNC_AUTO_RECOVER=true
KASMVNC_AUTO_RECOVER=true \
PULSE_RUNTIME_PATH=/var/run/pulse
EXPOSE $VNC_PORT \
$NO_VNC_PORT \
@ -147,7 +148,8 @@ RUN touch $STARTUPDIR/wm.log \
&& rm -rf $STARTUPDIR/install \
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
&& chown -R root:root /usr/local/bin
&& chown -R root:root /usr/local/bin \
&& chown 1000:root /var/run/pulse
USER 1000

View File

@ -55,7 +55,8 @@ ENV DISPLAY=:1 \
LANGUAGE=$LANGUAGE \
LC_ALL=$LC_ALL \
SINGLE_APPLICATION=0 \
KASMVNC_AUTO_RECOVER=true
KASMVNC_AUTO_RECOVER=true \
PULSE_RUNTIME_PATH=/var/run/pulse
EXPOSE $VNC_PORT \
$NO_VNC_PORT \
@ -159,7 +160,8 @@ RUN touch $STARTUPDIR/wm.log \
&& rm -rf $STARTUPDIR/install \
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
&& chown -R root:root /usr/local/bin
&& chown -R root:root /usr/local/bin \
&& chown 1000:root /var/run/pulse
USER 1000

View File

@ -52,7 +52,8 @@ ENV DISPLAY=:1 \
LANG=$LANG \
LANGUAGE=$LANGUAGE \
LC_ALL=$LC_ALL \
KASMVNC_AUTO_RECOVER=true
KASMVNC_AUTO_RECOVER=true \
PULSE_RUNTIME_PATH=/var/run/pulse
EXPOSE $VNC_PORT \
$NO_VNC_PORT \
@ -166,7 +167,8 @@ RUN touch $STARTUPDIR/wm.log \
&& rm -rf $STARTUPDIR/install \
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
&& chown -R root:root /usr/local/bin
&& chown -R root:root /usr/local/bin \
&& chown 1000:root /var/run/pulse
USER ubuntu

View File

@ -64,7 +64,8 @@ ENV DISPLAY=:1 \
LANGUAGE=$LANGUAGE \
LC_ALL=$LC_ALL \
SINGLE_APPLICATION=0 \
KASMVNC_AUTO_RECOVER=true
KASMVNC_AUTO_RECOVER=true \
PULSE_RUNTIME_PATH=/var/run/pulse
EXPOSE $VNC_PORT \
$NO_VNC_PORT \
@ -172,7 +173,8 @@ RUN touch $STARTUPDIR/wm.log \
&& rm -rf $STARTUPDIR/install \
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
&& chown -R root:root /usr/local/bin
&& chown -R root:root /usr/local/bin \
&& chown 1000:root /var/run/pulse
USER 1000

View File

@ -59,7 +59,8 @@ ENV DISPLAY=:1 \
LANGUAGE=$LANGUAGE \
LC_ALL=$LC_ALL \
SINGLE_APPLICATION=0 \
KASMVNC_AUTO_RECOVER=true
KASMVNC_AUTO_RECOVER=true \
PULSE_RUNTIME_PATH=/var/run/pulse
EXPOSE $VNC_PORT \
$NO_VNC_PORT \
@ -156,7 +157,8 @@ RUN touch $STARTUPDIR/wm.log \
&& rm -rf $STARTUPDIR/install \
&& mkdir -p $STARTUPDIR/kasmrx/Downloads \
&& chown 1000:1000 $STARTUPDIR/kasmrx/Downloads \
&& chown -R root:root /usr/local/bin
&& chown -R root:root /usr/local/bin \
&& chown 1000:root /var/run/pulse
USER 1000

View File

@ -110,16 +110,16 @@ function start_audio_out (){
if [ "${START_PULSEAUDIO:-0}" == "1" ] ;
then
echo "Starting Pulse"
pulseaudio --start
HOME=/var/run/pulse pulseaudio --start
fi
if [[ $DEBUG == true ]]; then
echo 'Starting audio service in debug mode'
no_proxy=127.0.0.1 ffmpeg -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio &
HOME=/var/run/pulse no_proxy=127.0.0.1 ffmpeg -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio &
KASM_PROCS['kasm_audio_out']=$!
else
echo 'Starting audio service'
no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 &
HOME=/var/run/pulse no_proxy=127.0.0.1 ffmpeg -v verbose -f pulse -fragment_size ${PULSEAUDIO_FRAGMENT_SIZE:-2000} -ar 44100 -i default -f mpegts -correct_ts_overflow 0 -codec:a mp2 -b:a 128k -ac 1 -muxdelay 0.001 http://127.0.0.1:8081/kasmaudio > /dev/null 2>&1 &
KASM_PROCS['kasm_audio_out']=$!
echo -e "\n------------------ Started Audio Out ----------------------------"
echo "Kasm Audio Out PID: ${KASM_PROCS['kasm_audio_out']}";

View File

@ -28,6 +28,8 @@ else
apt-get install -y curl git ffmpeg
fi
mkdir -p /var/run/pulse
cd $STARTUPDIR
mkdir jsmpeg
wget -qO- https://kasmweb-build-artifacts.s3.amazonaws.com/kasm_websocket_relay/f173f72a9faa6239e43f2efcb48aabe8a984d443/kasm_websocket_relay_${DISTRO/kali/ubuntu}_${ARCH}_develop.f173f7.tar.gz | tar xz --strip 1 -C $STARTUPDIR/jsmpeg