Add user to pulse group in setup_user.sh script

This commit is contained in:
Josh.5
2022-09-17 19:32:25 +12:00
committed by Josh Sunnex
parent 8b1de46a6d
commit adac278106
4 changed files with 45 additions and 41 deletions

View File

@@ -426,9 +426,6 @@ RUN \
&& chown -R ${USER} \ && chown -R ${USER} \
${USER_HOME} \ ${USER_HOME} \
&& echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \ && echo "${USER} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& adduser ${USER} audio \
&& adduser ${USER} video \
&& adduser ${USER} pulse \
&& \ && \
echo echo

View File

@@ -11,8 +11,8 @@ usermod -o -u "${PUID}" ${USER}
groupmod -o -g "${PGID}" ${USER} groupmod -o -g "${PGID}" ${USER}
echo "Adding run user to video, input and audio groups" echo "Adding run user to video, audio, input and pulse groups"
usermod -a -G video,input,audio ${USER} usermod -a -G video,audio,input,pulse ${USER}
echo "Setting umask to ${UMASK}"; echo "Setting umask to ${UMASK}";

View File

@@ -1,18 +1,21 @@
echo "**** Configure Neko ****" echo "**** Configure Neko ****"
if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
if ([ ${WEB_UI_MODE} = "neko" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then if [ ${WEB_UI_MODE} = "neko" ]; then
echo "Enable Neko server" echo "Enable Neko server"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/neko.ini sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/neko.ini
if [[ -z ${NEKO_NAT1TO1} ]]; then if [[ -z ${NEKO_NAT1TO1} ]]; then
export NEKO_NAT1TO1=$(ip route get 1 | awk '{print $(NF-2);exit}') export NEKO_NAT1TO1=$(ip route get 1 | awk '{print $(NF-2);exit}')
echo "Setting NEKO_NAT1TO1=${NEKO_NAT1TO1}" echo "Setting NEKO_NAT1TO1=${NEKO_NAT1TO1}"
else
echo "User provided setting NEKO_NAT1TO1=${NEKO_NAT1TO1}"
fi
else else
echo "User provided setting NEKO_NAT1TO1=${NEKO_NAT1TO1}" echo "Disable Neko server"
fi fi
else else
echo "Disable Neko server" echo "Neko server not available when container is run in 'secondary' mode"
fi fi
echo "DONE" echo "DONE"

View File

@@ -1,39 +1,43 @@
echo "**** Configure VNC ****" echo "**** Configure VNC ****"
if ([ ${WEB_UI_MODE} = "vnc" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then if ([ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
echo "Enable VNC server" if [ ${WEB_UI_MODE} = "vnc" ]; then
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc.ini echo "Enable VNC server"
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc.ini
# Credits for this audio patch: if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
# - https://github.com/novnc/noVNC/issues/302 # Credits for this audio patch:
# - https://github.com/vexingcodes/dwarf-fortress-docker # - https://github.com/novnc/noVNC/issues/302
# - https://github.com/calebj/noVNC # - https://github.com/vexingcodes/dwarf-fortress-docker
if [ -f /opt/noVNC/audio.patch ]; then # - https://github.com/calebj/noVNC
echo "Patching noVNC with audio websocket" if [ -f /opt/noVNC/audio.patch ]; then
echo "Patching noVNC with audio websocket"
# Enable supervisord script
sed -i "s|32123|${PORT_AUDIO_WEBSOCKET}|" /opt/noVNC/audio.patch
# Apply patch
pushd /opt/noVNC/ &> /dev/null
patch -p1 --input=/opt/noVNC/audio.patch --batch --quiet
popd &> /dev/null
rm /opt/noVNC/audio.patch
fi
# Enable supervisord script # Enable supervisord script
sed -i "s|32123|${PORT_AUDIO_WEBSOCKET}|" /opt/noVNC/audio.patch sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc-audio.ini
# Apply patch
pushd /opt/noVNC/ &> /dev/null
patch -p1 --input=/opt/noVNC/audio.patch --batch --quiet
popd &> /dev/null
rm /opt/noVNC/audio.patch
fi
# Enable supervisord script
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc-audio.ini
# Remove x11vnc from applications menu # Remove x11vnc from applications menu
if ! grep -q 'Hidden=true' /usr/share/applications/x11vnc.desktop; then if ! grep -q 'Hidden=true' /usr/share/applications/x11vnc.desktop; then
echo 'Hidden=true' >> /usr/share/applications/x11vnc.desktop echo 'Hidden=true' >> /usr/share/applications/x11vnc.desktop
fi
else
echo "Disable audio stream"
echo "Disable audio websock"
# Disable supervisord script
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini
fi fi
else else
echo "Disable audio stream" echo "Disable VNC server"
echo "Disable audio websock"
# Disable supervisord script
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini
fi fi
else else
echo "Disable VNC server" echo "VNC server not available when container is run in 'secondary' mode"
fi fi
echo "DONE" echo "DONE"