@ -49,7 +49,19 @@ case "$1" in
--gecos 'Browser Box' ${WEB_BROWSER_USER}
fi
# launch application as ${WEB_BROWSER_USER}
# grant access to video devices
for device in /dev/video*
do
if [[ -c $device ]]; then
VIDEO_GID=$(stat -c %g $device)
break
done
if [[ -n $VIDEO_GID ]]; then
usermod -a -G $VIDEO_GID ${WEB_BROWSER_USER}
cd /home/${WEB_BROWSER_USER}
exec sudo -u ${WEB_BROWSER_USER} -H PULSE_SERVER=/run/pulse/native $@ ${extra_opts}
;;
@ -28,6 +28,15 @@ else
# enumerate video devices for webcam support
VIDEO_DEVICES=
if [ -c $device ]; then
VIDEO_DEVICES="${VIDEO_DEVICES} --device $device:$device"
echo "Starting ${prog}..."
touch ${XAUTH}
docker run -d \
@ -36,6 +45,7 @@ else
--env="USER_GID=${USER_GID}" \
--env="DISPLAY" \
--env="XAUTHORITY=${XAUTH}" \
${VIDEO_DEVICES} \
--volume=${XSOCK}:${XSOCK} \
--volume=${XAUTH}:${XAUTH} \
--volume=/run/user/${USER_UID}/pulse:/run/pulse \