From 9cffd48e69e042da7f02a882bc55ab6578cff39b Mon Sep 17 00:00:00 2001 From: Yuchen Jin <32186723+cainmagi@users.noreply.github.com> Date: Tue, 2 Feb 2021 17:02:22 -0600 Subject: [PATCH] 1.45 Add openssl supports. --- .gitattributes | 2 ++ .gitignore | 9 +++++++++ README.md | 14 +++++++------- dockerfiles.code-workspace | 7 +++++++ noVNC | 35 +++++++++++++++++++++++++++++++---- noVNCbin | 2 +- 6 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 dockerfiles.code-workspace diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..156593e --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Datafolder and zipped files + +/datafiles +*.tar.gz +*.tar.xz +*.tar +*.zip +*.rar +*.7z \ No newline at end of file diff --git a/README.md b/README.md index 45edd55..92a5b13 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ To make use of this service, just copy this branch to your `/usr/local/bin/` lik And you could use such simple command on your Bash: ```Bash -$ noVNC IP=192.168.127.128:5901 PORT=6080 +noVNC IP=192.168.127.128:5901 PORT=6080 ``` where `5901` is the entry (input) port and `6080` is the service (output) port. @@ -35,19 +35,19 @@ Here is the list of each dockerfile: 1. xubuntu at the branch [**xubuntu**](https://github.com/cainmagi/Dockerfiles/tree/xubuntu) Run such a command to build the newest image online: - + ```Bash - $ nvidia-docker build -t xubuntu:1.12 https://github.com/cainmagi/Dockerfiles.git#xubuntu + nvidia-docker build -t xubuntu:1.0 https://github.com/cainmagi/Dockerfiles.git#xubuntu ``` - -2. xubuntu-tf at the branch [**xubuntu-tf**](https://github.com/cainmagi/Dockerfiles/tree/xubuntu-tf) + +2. jupyterlab at the branch [**jupyterlab**](https://github.com/cainmagi/Dockerfiles/tree/jupyterlab) Run such a command to build the newest image online: ```Bash - $ nvidia-docker build -t xubuntu-tf:1.25 https://github.com/cainmagi/Dockerfiles.git#xubuntu-tf + nvidia-docker build -t jlab:1.0 https://github.com/cainmagi/Dockerfiles.git#jupyterlab ``` - + ## Update records See the update records in [docs-DGX branch](https://github.com/cainmagi/Dockerfiles/blob/docs-DGX/index.md#update-records). diff --git a/dockerfiles.code-workspace b/dockerfiles.code-workspace new file mode 100644 index 0000000..ef9f5d2 --- /dev/null +++ b/dockerfiles.code-workspace @@ -0,0 +1,7 @@ +{ + "folders": [ + { + "path": "." + } + ] +} \ No newline at end of file diff --git a/noVNC b/noVNC index 16b6d60..61b8f8a 100644 --- a/noVNC +++ b/noVNC @@ -2,6 +2,8 @@ PORT=0 IP=192.168.127.128:5901 +PEM="" +GEN="" for ARGUMENT in "$@" do @@ -9,7 +11,9 @@ do VALUE=$(echo $ARGUMENT | cut -f2 -d=) case "$KEY" in PORT) PORT=${VALUE} ;; - IP) IP=${VALUE} ;; + IP) IP=${VALUE} ;; + PEM) PEM=${VALUE} ;; + GEN) GEN=${VALUE} ;; *) esac done @@ -35,9 +39,32 @@ echo "Note that you need to replace \"$HOSTNAME\" with \"$MACHINE_IP\" in the UR echo " http://$MACHINE_IP:$SHOWPORT/vnc.html?host=$MACHINE_IP&port=$SHOWPORT" echo "---------------------" -if [ "$PORT" = "0" ] +if [ "$PORT" != "0" ] +then + PORT_OPTION="--listen $PORT" +else + PORT_OPTION="" +fi + +if [ "x${GEN}" != "x" ] +then + openssl req -new -x509 -days 365 -nodes -out ${GEN} -keyout ${GEN} + if [ "x${PEM}" = "x" ] + then + PEM=${GEN} + fi +fi + +if [ "x${PEM}" = "x" ] && [ "x${GEN}" != "x" ] +then + PEM=${GEN} +fi + +if [ "x${PEM}" != "x" ] then - /usr/local/bin/noVNCbin/utils/launch.sh --vnc $IP + SSL_OPTION="--cert ${PEM} --key ${PEM}" else - /usr/local/bin/noVNCbin/utils/launch.sh --vnc $IP --listen $PORT + SSL_OPTION="" fi + +/usr/local/bin/noVNCbin/utils/launch.sh --vnc $IP ${PORT_OPTION} ${SSL_OPTION} diff --git a/noVNCbin b/noVNCbin index 4a319c4..5a0cceb 160000 --- a/noVNCbin +++ b/noVNCbin @@ -1 +1 @@ -Subproject commit 4a319c414da3a5e47dd3974ad3b859396ab7ac51 +Subproject commit 5a0cceb8156926fe125ca541adae60754ecd3698