Unverified Commit 300e1ed3 authored by mtsonline's avatar mtsonline Committed by GitHub
Browse files

Merge pull request #106 from Worteks/unprivileged

feat(unprivileged)
parents 735ba7db 135ccbb3
......@@ -16,10 +16,14 @@ RUN apt-get update && apt-get install -y \
dbus-x11 \
libasound2 \
libasound2-plugins\
libnss-wrapper \
alsa-utils \
alsa-oss \
pulseaudio \
pulseaudio-utils
pulseaudio-utils \
&& mkdir /home/lithium /var/run/pulse /run/user/lithium \
&& chown -R 1001:0 /home/lithium /run/user/lithium /var/run/pulse \
&& chmod -R g=u /home/lithium /run/user/lithium /var/run/pulse
RUN ln -s /usr/bin/python3 /usr/local/bin/python \
&& pip3 install --upgrade pip
......@@ -58,7 +62,9 @@ COPY stream.py ./
COPY chat.py ./
COPY startStream.sh ./
COPY docker-entrypoint.sh ./
COPY nsswrapper.sh ./
ENTRYPOINT ["sh","docker-entrypoint.sh"]
CMD ["sh","startStream.sh" ]
USER 1001
#!/bin/bash
. /usr/src/app/nsswrapper.sh
if pulseaudio --check ; then
echo "Pulseaudio already running - killing it..."
pulseaudio --kill
......
#!/bin/sh
if test "`id -u`" -ne 0; then
if test -s /tmp/pulse-passwd; then
echo Skipping nsswrapper setup - already initialized
else
echo Setting up nsswrapper mapping `id -u` to lithium
sed "s|^audio:\(.*\)|audio:\1,lithium|" \
/etc/group >/tmp/pulse-group
if test `id -g` -ne 0; then
echo "lithium:x:`id -g`:" >>/tmp/pulse-group
fi
(
cat /etc/passwd
echo "lithium:x:`id -u`:`id -g`:lithium:/home/lithium:/bin/sh"
) >/tmp/pulse-passwd
fi
export NSS_WRAPPER_PASSWD=/tmp/pulse-passwd
export NSS_WRAPPER_GROUP=/tmp/pulse-group
export LD_PRELOAD=/usr/lib/libnss_wrapper.so
fi
export HOME=/home/lithium
#!/bin/sh
. /usr/src/app/nsswrapper.sh
STREAM_MEETING="";
if [ "${BBB_STREAM_URL}" != "" ]
then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment