Update v1.4.3

This commit is contained in:
vital987 2021-11-11 13:23:05 +00:00
parent dede11f84b
commit a5c8b2326d
10 changed files with 47 additions and 28 deletions

View File

@ -1,7 +1,5 @@
FROM vital987/vubuntu:latest
LABEL AboutImage "Ubuntu20.04_Fluxbox_PureVNC"
LABEL Maintainer "Apoorv Vyavahare <apoorvvyavahare@pm.me>"
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/

0
LICENSE Executable file → Normal file
View File

5
README.md Executable file → Normal file
View File

@ -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)]()<br>[![Heroku](https://www.herokucdn.com/deploy/button.svg)](http://heroku.com/deploy?template=https://github.com/vital987/vubuntu/tree/purevnc)<br>
# 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)]()<br>[![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)<br>
## **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.**

View File

@ -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
}
}
}
}

0
assets/configs/1-xvfb.conf Executable file → Normal file
View File

0
assets/configs/2-fluxbox.conf Executable file → Normal file
View File

5
assets/configs/3-vnc.conf Executable file → Normal file
View File

@ -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

0
assets/configs/4-ngrok_tunnel.conf Executable file → Normal file
View File

View File

@ -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

17
assets/configs/ngrok_tunnel.py Normal file → Executable file
View File

@ -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()