Add Niko server as an alternative to noVNC
This commit is contained in:
17
Dockerfile
17
Dockerfile
@@ -224,6 +224,10 @@ RUN \
|
|||||||
&& \
|
&& \
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# Install Neko server
|
||||||
|
COPY --from=m1k1o/neko:base /usr/bin/neko /usr/bin/neko
|
||||||
|
COPY --from=m1k1o/neko:base /var/www /var/www
|
||||||
|
|
||||||
# Install noVNC
|
# Install noVNC
|
||||||
ARG NOVNC_VERSION=1.2.0
|
ARG NOVNC_VERSION=1.2.0
|
||||||
RUN \
|
RUN \
|
||||||
@@ -421,7 +425,12 @@ RUN \
|
|||||||
&& useradd -d ${USER_HOME} -s /bin/bash ${USER} \
|
&& useradd -d ${USER_HOME} -s /bin/bash ${USER} \
|
||||||
&& 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
|
||||||
|
|
||||||
# Add FS overlay
|
# Add FS overlay
|
||||||
COPY overlay /
|
COPY overlay /
|
||||||
@@ -442,6 +451,9 @@ ENV \
|
|||||||
ENV \
|
ENV \
|
||||||
MODE="primary" \
|
MODE="primary" \
|
||||||
WEB_UI_MODE="vnc" \
|
WEB_UI_MODE="vnc" \
|
||||||
|
ENABLE_VNC_AUDIO="true" \
|
||||||
|
NEKO_PASSWORD=neko \
|
||||||
|
NEKO_PASSWORD_ADMIN=admin
|
||||||
|
|
||||||
# Configure required ports
|
# Configure required ports
|
||||||
ENV \
|
ENV \
|
||||||
@@ -449,7 +461,8 @@ ENV \
|
|||||||
PORT_VNC="5900" \
|
PORT_VNC="5900" \
|
||||||
PORT_AUDIO_STREAM="5901" \
|
PORT_AUDIO_STREAM="5901" \
|
||||||
PORT_NOVNC_WEB="8083" \
|
PORT_NOVNC_WEB="8083" \
|
||||||
PORT_AUDIO_WEBSOCKET="32123"
|
PORT_AUDIO_WEBSOCKET="32123" \
|
||||||
|
NEKO_NAT1TO1=""
|
||||||
|
|
||||||
# Expose the required ports
|
# Expose the required ports
|
||||||
EXPOSE 2222
|
EXPOSE 2222
|
||||||
|
|||||||
18
overlay/etc/cont-init.d/70-configure_neko.sh
Normal file
18
overlay/etc/cont-init.d/70-configure_neko.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
echo "**** Configure Neko ****"
|
||||||
|
|
||||||
|
|
||||||
|
if ([ ${WEB_UI_MODE} = "neko" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
|
||||||
|
echo "Enable Neko server"
|
||||||
|
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/neko.ini
|
||||||
|
if [[ -z ${NEKO_NAT1TO1} ]]; then
|
||||||
|
export NEKO_NAT1TO1=$(ip route get 1 | awk '{print $(NF-2);exit}')
|
||||||
|
echo "Setting NEKO_NAT1TO1=${NEKO_NAT1TO1}"
|
||||||
|
else
|
||||||
|
echo "User provided setting NEKO_NAT1TO1=${NEKO_NAT1TO1}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Disable Neko server"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "DONE"
|
||||||
@@ -2,10 +2,8 @@
|
|||||||
echo "**** Configure VNC ****"
|
echo "**** Configure VNC ****"
|
||||||
|
|
||||||
if ([ ${WEB_UI_MODE} = "vnc" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
|
if ([ ${WEB_UI_MODE} = "vnc" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "secondary" ]); then
|
||||||
|
|
||||||
echo "Enable VNC server"
|
echo "Enable VNC server"
|
||||||
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc.ini
|
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/vnc.ini
|
||||||
|
|
||||||
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
|
if [[ "${ENABLE_VNC_AUDIO}" == "true" ]]; then
|
||||||
# Credits for this audio patch:
|
# Credits for this audio patch:
|
||||||
# - https://github.com/novnc/noVNC/issues/302
|
# - https://github.com/novnc/noVNC/issues/302
|
||||||
@@ -34,7 +32,8 @@ if ([ ${WEB_UI_MODE} = "vnc" ] && [ "${MODE}" != "s" ] && [ "${MODE}" != "second
|
|||||||
# Disable supervisord script
|
# Disable supervisord script
|
||||||
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini
|
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/vnc-audio.ini
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Disable VNC server"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "DONE"
|
echo "DONE"
|
||||||
|
|||||||
16
overlay/etc/supervisor.d/neko.ini
Normal file
16
overlay/etc/supervisor.d/neko.ini
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
[program:neko]
|
||||||
|
autostart=false
|
||||||
|
autorestart=true
|
||||||
|
priority=30
|
||||||
|
user=%(ENV_USER)s
|
||||||
|
command=/usr/bin/neko serve --static "/var/www" --display %(ENV_DISPLAY)s --bind :%(ENV_PORT_NOVNC_WEB)s
|
||||||
|
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s"
|
||||||
|
stopsignal=INT
|
||||||
|
stopwaitsecs=5
|
||||||
|
stdout_logfile=/home/%(ENV_USER)s/.cache/log/neko.log
|
||||||
|
stdout_logfile_maxbytes=10MB
|
||||||
|
stdout_logfile_backups=7
|
||||||
|
stderr_logfile=/home/%(ENV_USER)s/.cache/log/neko.err.log
|
||||||
|
stderr_logfile_maxbytes=10MB
|
||||||
|
stderr_logfile_backups=7
|
||||||
Reference in New Issue
Block a user