From a5c8b2326d88dcefa4f5e478f4a693b47c49efd5 Mon Sep 17 00:00:00 2001 From: vital987 Date: Thu, 11 Nov 2021 13:23:05 +0000 Subject: [PATCH] Update v1.4.3 --- Dockerfile | 19 +++++++++++-------- LICENSE | 0 README.md | 5 +++-- app.json | 24 ++++++++++++------------ assets/configs/1-xvfb.conf | 0 assets/configs/2-fluxbox.conf | 0 assets/configs/3-vnc.conf | 5 +++-- assets/configs/4-ngrok_tunnel.conf | 0 assets/configs/5-port-forward.conf | 5 +++-- assets/configs/ngrok_tunnel.py | 17 +++++++++++++++-- 10 files changed, 47 insertions(+), 28 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 assets/configs/1-xvfb.conf mode change 100755 => 100644 assets/configs/2-fluxbox.conf mode change 100755 => 100644 assets/configs/3-vnc.conf mode change 100755 => 100644 assets/configs/4-ngrok_tunnel.conf mode change 100644 => 100755 assets/configs/ngrok_tunnel.py diff --git a/Dockerfile b/Dockerfile index 50b5fb7..8691e2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM vital987/vubuntu:latest -LABEL AboutImage "Ubuntu20.04_Fluxbox_PureVNC" - LABEL Maintainer "Apoorv Vyavahare " ARG DEBIAN_FRONTEND=noninteractive @@ -9,7 +7,7 @@ ARG DEBIAN_FRONTEND=noninteractive #VNC Server Password ENV VNC_PASS="samplepass" \ #VNC Server Title(w/o spaces) - VNC_TITLE="Vubuntu_Desktop" \ + VNC_TITLE="Vubuntu-PureVNC" \ #VNC Resolution(720p is preferable) VNC_RESOLUTION="1280x720" \ #VNC Shared Mode (0=no, 1=yes) @@ -29,12 +27,17 @@ ENV VNC_PASS="samplepass" \ SHELL ["/bin/bash", "-c"] -RUN apt update && \ - apt install --no-install-recommends -y socat && \ - apt purge -y novnc && \ +RUN apt-get update && \ + apt-get install --no-install-recommends -y socat && \ + apt-get purge -y novnc && \ npm uninstall --global websockify && \ - pip install pyngrok && \ - rm -rf /app/.vubuntu/assets/configs/* + rm -rf /app/.vubuntu/assets/configs/* && \ + rm -rf /var/lib/apt/lists/* && \ + apt-get clean && \ + apt-get autoremove -y && \ + rm -rf /tmp/* && \ + pip install pyngrok PyYAML && \ + python3 -c 'from pyngrok import installer;installer.install_ngrok(ngrok_path="/usr/local/lib/python3.8/dist-packages/pyngrok/bin/ngrok")' COPY assets/configs/ /app/.vubuntu/assets/configs/ diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index d733f05..7b76191 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -# **Ubuntu Fluxbox with Direct VNC** -[![Ubuntu Version](https://img.shields.io/static/v1?label=Ubuntu&message=20.04&color=E95420&logo=ubuntu)]() [![Maintainer](https://img.shields.io/static/v1?label=Maintainer&message=apoorvvyavahare@pm.me&color=1e90ff)]() [![Maintainance](https://img.shields.io/badge/Maintenance%20Level-Active-success.svg)]() [![Docker Pulls](https://img.shields.io/docker/pulls/vital987/vubuntu.svg)](https://hub.docker.com/r/vital987/vubuntu) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)]()
[![Heroku](https://www.herokucdn.com/deploy/button.svg)](http://heroku.com/deploy?template=https://github.com/vital987/vubuntu/tree/purevnc)
+# VNC + Ubuntu = Vubuntu ¯\\_\(ツ\)\_\/¯ + +[![Ubuntu Version](https://img.shields.io/static/v1?label=Ubuntu&message=20.04&color=E95420&logo=ubuntu)]() [![Maintainer](https://img.shields.io/static/v1?label=Maintainer&message=apoorvvyavahare@pm.me&color=1e90ff)]() [![Maintainance](https://img.shields.io/badge/Maintenance%20Level-Active-success.svg)]() [![Docker Pulls](https://img.shields.io/docker/pulls/vital987/vubuntu.svg)](https://hub.docker.com/r/vital987/vubuntu) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)]()
[![PureVNC](https://raw.githubusercontent.com/vital987/vubuntu/master/assets/repo_files/button-purevnc.png)](https://heroku.com/deploy?template=https://github.com/vital987/vubuntu/tree/purevnc)
## **Introduction:** * **Vubuntu-PureVNC is a modified version of Vubuntu where one can connect to the server directly via VNC url without any web client like NoVNC.** diff --git a/app.json b/app.json index 0ae4597..432e203 100644 --- a/app.json +++ b/app.json @@ -1,18 +1,23 @@ { "name": "Vubuntu-PureVNC", - "description": "Fully fledged Ubuntu with pure VNC, refer readme for more info.", + "description": "Fully fledged Ubuntu with direct VNC, refer readme for more info.", "repository": "https://github.com/vital987/vubuntu.git", - "logo": "https://imgur.com/1qCGUwK.png", - "keywords": ["docker","ubuntu", "vscode", "purevnc", "pure", "firefox", "brave", "fluxbox", "linux", "remote", "ssh", "vnc", "vubuntu"], + "logo": "https://raw.githubusercontent.com/vital987/vubuntu/master/assets/icons/64x64.png", + "keywords": ["docker","ubuntu", "vscode", "purevnc", "pure", "firefox", "brave", "fluxbox", "linux", "remote", "ssh", "direct-vnc", "vnc", "vubuntu"], "stack": "container", "env": { + "APP_NAME" : { + "description": "Name of the app, same as mentioned above.", + "value" : "", + "required" : true + }, "VNC_TITLE" : { - "description": "VNC Session Title, w/o spaces.", + "description": "VNC Session Title, without spaces.", "value" : "Vubuntu-PureVNC", "required" : true - } , + }, "VNC_PASS": { - "description": "VNC server password w/o spaces.", + "description": "VNC server password without spaces.", "required" : true }, "VNC_RESOLUTION" : { @@ -29,11 +34,6 @@ "description": "Prevent app from sleeping, 1=on, 0=off", "value" : "0", "required" : true - }, - "APP_NAME" : { - "description": "Name of the app, same as mentioned above.", - "value" : "", - "required" : true } - } + } } diff --git a/assets/configs/1-xvfb.conf b/assets/configs/1-xvfb.conf old mode 100755 new mode 100644 diff --git a/assets/configs/2-fluxbox.conf b/assets/configs/2-fluxbox.conf old mode 100755 new mode 100644 diff --git a/assets/configs/3-vnc.conf b/assets/configs/3-vnc.conf old mode 100755 new mode 100644 index 7a1c890..cf544d8 --- a/assets/configs/3-vnc.conf +++ b/assets/configs/3-vnc.conf @@ -1,6 +1,7 @@ [program:VNC] command=bash -c 'if ((VNC_SHARED==0)); then x11vnc -storepasswd $VNC_PASS /app/.xpass && x11vnc -usepw -rfbport 5900 -rfbauth /app/.xpass -geometry $VNC_RESOLUTION -forever -alwaysshared -permitfiletransfer -bg -desktop $VNC_TITLE; else x11vnc -storepasswd $VNC_PASS /app/.xpass && x11vnc -usepw -rfbport 5900 -rfbauth /app/.xpass -geometry $VNC_RESOLUTION -forever -shared -alwaysshared -permitfiletransfer -bg -desktop $VNC_TITLE; fi' -autostart=true -autorestart=false +autorestart=unexpected +startsecs=0 +exitcodes=0,1 stderr_logfile=/var/log/x11vnc.stderr.log priority=3 diff --git a/assets/configs/4-ngrok_tunnel.conf b/assets/configs/4-ngrok_tunnel.conf old mode 100755 new mode 100644 diff --git a/assets/configs/5-port-forward.conf b/assets/configs/5-port-forward.conf index 9ab8333..7ff49f7 100644 --- a/assets/configs/5-port-forward.conf +++ b/assets/configs/5-port-forward.conf @@ -1,6 +1,7 @@ [program:portforward] command=bash -c 'socat TCP-LISTEN:$PORT,fork TCP:127.0.0.1:4040' stderr_logfile=/var/log/socat.err.log +autorestart=unexpected +exitcodes=0 +startseconds=0 priority=1 -autostart=true -autorestart=false diff --git a/assets/configs/ngrok_tunnel.py b/assets/configs/ngrok_tunnel.py old mode 100644 new mode 100755 index d4aec7d..882f59b --- a/assets/configs/ngrok_tunnel.py +++ b/assets/configs/ngrok_tunnel.py @@ -1,17 +1,25 @@ #!/usr/bin/python3 import os +import logging +from time import sleep + +logging.basicConfig(filename="/app/.vubuntu/assets/logs/ngrok_tunnel.py.log", format='%(asctime)s %(message)s', filemode='w') +logger=logging.getLogger() try: from pyngrok import ngrok, conf except: - os.system('pip3 install pyngrok') + logger.info('Pyngrok not installed, installing pyngrok...') + os.system('pip3 install pyngrok PyYAML') + logger.info('PyNgrok Installed') from pyngrok import ngrok, conf try: AUTH_TOKEN=os.environ['NGROK_AUTH_TOKEN'] except: print('[-] Ngrok token not found, assign the token to NGROK_AUTH_TOKEN environment variable & try again.\n[-] Terminating...') + logger.error('NGROK_AUTH_TOKEN environment variable not set, terminating...') exit() ngrok.set_auth_token(AUTH_TOKEN) @@ -19,16 +27,21 @@ ngrok.set_auth_token(AUTH_TOKEN) if "NGROK_REGION" in os.environ: conf.get_default().region = os.environ['NGROK_REGION'] else: - print("[!] NGROK_REGION unset, defaulting ngrok location to India.") + print("[!] NGROK_REGION unset, defaulting ngrok region to India.") + logger.warning('NGROK_REGION unset, defaulting ngrok region to India.') conf.get_default().region = "in" try: primary_tunnel = ngrok.connect(os.environ['NGROK_PORT'], os.environ['NGROK_METHOD'], bind_tls=bool(int(os.getenv('NGROK_BINDTLS', 1)))) except: + logger.warning('NGROK_PORT or/and NGROK_METHOD environment variable not set, terminating...') print('[-] NGROK_PORT or NGROK_METHOD environment variables has not been set properly, NGROK_METHOD should be http or tcp') +sleep(10) + url=primary_tunnel.public_url print(f'[>NGROK]: {url}') input() +