Make the various used ports configurable
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -443,9 +443,19 @@ ENV \
|
|||||||
MODE="primary" \
|
MODE="primary" \
|
||||||
ENABLE_VNC_AUDIO="true"
|
ENABLE_VNC_AUDIO="true"
|
||||||
|
|
||||||
# Be sure that the noVNC port is exposed
|
# Configure required ports
|
||||||
EXPOSE 8083
|
ENV \
|
||||||
|
PORT_SSH="2222" \
|
||||||
|
PORT_VNC="5900" \
|
||||||
|
PORT_AUDIO_STREAM="5901" \
|
||||||
|
PORT_NOVNC_WEB="8083" \
|
||||||
|
PORT_AUDIO_WEBSOCKET="32123"
|
||||||
|
|
||||||
|
# Expose the required ports
|
||||||
|
EXPOSE 2222
|
||||||
|
EXPOSE 5900
|
||||||
EXPOSE 5901
|
EXPOSE 5901
|
||||||
|
EXPOSE 8083
|
||||||
EXPOSE 32123
|
EXPOSE 32123
|
||||||
|
|
||||||
# Set entrypoint
|
# Set entrypoint
|
||||||
|
|||||||
@@ -412,9 +412,19 @@ ENV \
|
|||||||
MODE="primary" \
|
MODE="primary" \
|
||||||
ENABLE_VNC_AUDIO="true"
|
ENABLE_VNC_AUDIO="true"
|
||||||
|
|
||||||
# Be sure that the noVNC port is exposed
|
# Configure required ports
|
||||||
EXPOSE 8083
|
ENV \
|
||||||
|
PORT_SSH="2222" \
|
||||||
|
PORT_VNC="5900" \
|
||||||
|
PORT_AUDIO_STREAM="5901" \
|
||||||
|
PORT_NOVNC_WEB="8083" \
|
||||||
|
PORT_AUDIO_WEBSOCKET="32123"
|
||||||
|
|
||||||
|
# Expose the required ports
|
||||||
|
EXPOSE 2222
|
||||||
|
EXPOSE 5900
|
||||||
EXPOSE 5901
|
EXPOSE 5901
|
||||||
|
EXPOSE 8083
|
||||||
EXPOSE 32123
|
EXPOSE 32123
|
||||||
|
|
||||||
# Set entrypoint
|
# Set entrypoint
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ if [ "${MODE}" != "s" ] & [ "${MODE}" != "secondary" ]; then
|
|||||||
# - https://github.com/calebj/noVNC
|
# - https://github.com/calebj/noVNC
|
||||||
if [ -f /opt/noVNC/audio.patch ]; then
|
if [ -f /opt/noVNC/audio.patch ]; then
|
||||||
echo "Patching noVNC with audio websocket"
|
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
|
pushd /opt/noVNC/ &> /dev/null
|
||||||
patch -p1 --input=/opt/noVNC/audio.patch --batch --quiet
|
patch -p1 --input=/opt/noVNC/audio.patch --batch --quiet
|
||||||
popd &> /dev/null
|
popd &> /dev/null
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ autostart=true
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=10
|
priority=10
|
||||||
user=root
|
user=root
|
||||||
command=/usr/sbin/sshd -Ddp 2222
|
command=/usr/sbin/sshd -Ddp "%(ENV_PORT_SSH)s"
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
stdout_logfile=/var/log/supervisor/sshd.log
|
stdout_logfile=/var/log/supervisor/sshd.log
|
||||||
stdout_logfile_maxbytes=10MB
|
stdout_logfile_maxbytes=10MB
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ autostart=false
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=10
|
priority=10
|
||||||
user=%(ENV_USER)s
|
user=%(ENV_USER)s
|
||||||
command=tcpserver localhost 5901 gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
|
command=tcpserver localhost %(ENV_PORT_AUDIO_STREAM)s gst-launch-1.0 -q pulsesrc server=/tmp/pulseaudio.socket ! audio/x-raw, channels=2, rate=24000 ! cutter ! opusenc ! webmmux ! fdsink fd=1
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.log
|
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiostream.log
|
||||||
stdout_logfile_maxbytes=10MB
|
stdout_logfile_maxbytes=10MB
|
||||||
@@ -18,7 +18,7 @@ autostart=false
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=10
|
priority=10
|
||||||
user=%(ENV_USER)s
|
user=%(ENV_USER)s
|
||||||
command=/usr/local/bin/websockify 32123 localhost:5901
|
command=/usr/local/bin/websockify %(ENV_PORT_AUDIO_WEBSOCKET)s localhost:%(ENV_PORT_AUDIO_STREAM)s
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiowebsock.log
|
stdout_logfile=/home/%(ENV_USER)s/.cache/log/audiowebsock.log
|
||||||
stdout_logfile_maxbytes=10MB
|
stdout_logfile_maxbytes=10MB
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ autostart=true
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=30
|
priority=30
|
||||||
user=%(ENV_USER)s
|
user=%(ENV_USER)s
|
||||||
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport 5900 -shared -forever
|
command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -rfbport %(ENV_PORT_VNC)s -shared -forever
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/x11vnc.log
|
stdout_logfile=/home/%(ENV_USER)s/.cache/log/x11vnc.log
|
||||||
stdout_logfile_maxbytes=10MB
|
stdout_logfile_maxbytes=10MB
|
||||||
@@ -18,7 +18,7 @@ autostart=true
|
|||||||
autorestart=true
|
autorestart=true
|
||||||
priority=30
|
priority=30
|
||||||
user=%(ENV_USER)s
|
user=%(ENV_USER)s
|
||||||
command=/opt/noVNC/utils/launch.sh --vnc localhost:5900 --listen 8083
|
command=/opt/noVNC/utils/launch.sh --vnc localhost:%(ENV_PORT_VNC)s --listen %(ENV_PORT_NOVNC_WEB)s
|
||||||
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
|
environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s"
|
||||||
stopsignal=QUIT
|
stopsignal=QUIT
|
||||||
stdout_logfile=/home/%(ENV_USER)s/.cache/log/novnc.log
|
stdout_logfile=/home/%(ENV_USER)s/.cache/log/novnc.log
|
||||||
|
|||||||
Reference in New Issue
Block a user