Skip to content

Commit

Permalink
Improve NGINX startup
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Jul 7, 2024
1 parent c3054f9 commit 189a2cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions kasmvnc-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ yq -i "
.encoding.rect_encoding_mode.rectangle_compress_threads = ${KASMVNC_THREADS-0} |
.encoding.max_frame_rate = ${DISPLAY_REFRESH} |
.network.interface = \"127.0.0.1\" |
.network.websocket_port = 8082 |
.network.websocket_port = 8081 |
.network.ssl.require_ssl = $(echo ${SELKIES_ENABLE_HTTPS-false} | tr '[:upper:]' '[:lower:]')
" /etc/kasmvnc/kasmvnc.yaml

Expand Down Expand Up @@ -74,13 +74,13 @@ server {
client_max_body_size 10M;
proxy_pass http$(if [ \"$(echo ${SELKIES_ENABLE_HTTPS} | tr '[:upper:]' '[:lower:]')\" = \"true\" ]; then echo -n "s"; fi)://localhost:8082;
proxy_pass http$(if [ \"$(echo ${SELKIES_ENABLE_HTTPS} | tr '[:upper:]' '[:lower:]')\" = \"true\" ]; then echo -n "s"; fi)://localhost:8081;
}
}" | tee /etc/nginx/sites-available/default > /dev/null

# Run KasmVNC
if ls ~/.vnc/*\:"${KASMVNC_DISPLAY#*:}".pid >/dev/null 2>&1; then kasmvncserver -kill "${KASMVNC_DISPLAY}"; fi
kasmvncserver "${KASMVNC_DISPLAY}" -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -noxstartup -FrameRate "${DISPLAY_REFRESH}" -RectThreads "${KASMVNC_THREADS}" -interface 127.0.0.1 -rfbport 9082 -websocketPort 8082 -disableBasicAuth -AlwaysShared -BlacklistTimeout 0 ${KASMVNC_FLAG}
kasmvncserver "${KASMVNC_DISPLAY}" -geometry "${DISPLAY_SIZEW}x${DISPLAY_SIZEH}" -depth "${DISPLAY_CDEPTH}" -noxstartup -FrameRate "${DISPLAY_REFRESH}" -RectThreads "${KASMVNC_THREADS}" -interface 127.0.0.1 -rfbport 9082 -websocketPort 8081 -disableBasicAuth -AlwaysShared -BlacklistTimeout 0 ${KASMVNC_FLAG}

until [ -S "/tmp/.X11-unix/X${KASMVNC_DISPLAY#*:}" ]; do sleep 0.5; done;

Expand Down
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ autorestart=true
priority=20

[program:nginx]
command=bash -c "until head -n 1 /etc/nginx/sites-available/default | grep -q 'Selkies'; do sleep 0.5; done; /usr/sbin/nginx -g \"daemon off;\""
command=bash -c "until nc -z localhost 8081; do sleep 0.5; done; /usr/sbin/nginx -g \"daemon off;\""
stdout_logfile=/tmp/nginx.log
stdout_logfile_maxbytes=5MB
stdout_logfile_backups=0
Expand Down

0 comments on commit 189a2cb

Please sign in to comment.