From 7ad2eb45c812ca4fa41ddd040e6c19304639ad48 Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Thu, 18 Jun 2020 16:08:48 +0200 Subject: [PATCH] Able to have pass in vnc --- README_CUSTOM_CONFIG.md | 5 +++++ src/vnc.sh | 13 +++++++++++++ supervisord.conf | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 src/vnc.sh diff --git a/README_CUSTOM_CONFIG.md b/README_CUSTOM_CONFIG.md index 1fc3846..4889dd1 100644 --- a/README_CUSTOM_CONFIG.md +++ b/README_CUSTOM_CONFIG.md @@ -1,3 +1,8 @@ +VNC pass +-------- + +Passing ```VNC_PASSWORD="your_pass_here"``` will secure your vnc connection. + Proxy ----- diff --git a/src/vnc.sh b/src/vnc.sh new file mode 100755 index 0000000..d8132fd --- /dev/null +++ b/src/vnc.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +vnc="/usr/bin/x11vnc -display ${DISPLAY} -forever -shared " + +pass_path="/root/vncpass" +if [ ! -z "${VNC_PASSWORD}" ]; then + /usr/bin/x11vnc -storepasswd ${VNC_PASSWORD} ${pass_path} + param="-rfbauth ${pass_path}" +else + param="-nopw" +fi + +${vnc}${param} diff --git a/supervisord.conf b/supervisord.conf index 36d275a..63a6b10 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -17,7 +17,7 @@ stderr_logfile=%(ENV_LOG_PATH)s/openbox.stderr.log priority=2 [program:x11vnc] -command=/usr/bin/x11vnc -display %(ENV_DISPLAY)s -nopw -forever -shared +command=./src/vnc.sh stdout_logfile=%(ENV_LOG_PATH)s/x11vnc.stdout.log stderr_logfile=%(ENV_LOG_PATH)s/x11vnc.stderr.log priority=2