├── image ├── usr │ └── lib │ │ ├── web │ │ ├── log │ │ │ ├── __init__.py │ │ │ └── config.py │ │ ├── static │ │ │ ├── robots.txt │ │ │ ├── 6df2b309.favicon.ico │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ └── styles │ │ │ │ └── 536b3e9f.main.css │ │ ├── config │ │ │ └── __init__.py │ │ ├── requirements.txt │ │ ├── run.py │ │ └── lightop │ │ │ └── __init__.py │ │ └── noVNC │ │ ├── docs │ │ ├── VERSION │ │ ├── rfbproto-3.3.pdf │ │ ├── rfbproto-3.7.pdf │ │ ├── rfbproto-3.8.pdf │ │ ├── notes │ │ ├── flash_policy.txt │ │ ├── LICENSE.zlib │ │ ├── LICENSE.pako │ │ ├── release.txt │ │ ├── LICENSE.BSD-2-Clause │ │ ├── LICENSE.BSD-3-Clause │ │ ├── links │ │ └── rfb_notes │ │ ├── utils │ │ ├── websockify │ │ │ ├── websockify.py │ │ │ ├── tests │ │ │ │ ├── include │ │ │ │ ├── latency.py │ │ │ │ ├── test_auth_plugins.py │ │ │ │ ├── echo.rb │ │ │ │ ├── echo_client.py │ │ │ │ ├── simple.html │ │ │ │ └── echo.py │ │ │ ├── test-requirements.txt │ │ │ ├── MANIFEST.in │ │ │ ├── websockify │ │ │ │ ├── __init__.py │ │ │ │ ├── token_plugins.py │ │ │ │ ├── auth_plugins.py │ │ │ │ └── websocketserver.py │ │ │ ├── run │ │ │ ├── docs │ │ │ │ ├── TODO │ │ │ │ ├── flash_policy.txt │ │ │ │ ├── notes │ │ │ │ └── release.txt │ │ │ ├── Makefile │ │ │ ├── .travis.yml │ │ │ ├── other │ │ │ │ ├── js │ │ │ │ │ ├── README.md │ │ │ │ │ └── package.json │ │ │ │ ├── Makefile │ │ │ │ ├── wswrap │ │ │ │ ├── project.clj │ │ │ │ ├── README.md │ │ │ │ ├── websocket.h │ │ │ │ ├── launch.sh │ │ │ │ └── websockify.rb │ │ │ ├── rebind │ │ │ ├── Windows │ │ │ │ ├── noVNC Websocket Service Project │ │ │ │ │ ├── ProjectInstaller.cs │ │ │ │ │ ├── Program.cs │ │ │ │ │ ├── noVNC Websocket.sln │ │ │ │ │ ├── Service1.Designer.cs │ │ │ │ │ ├── Service1.cs │ │ │ │ │ ├── Properties │ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ │ ├── ProjectInstaller.Designer.cs │ │ │ │ │ └── noVNC Websocket.csproj │ │ │ │ └── Windows Service Readme.txt │ │ │ ├── tox.ini │ │ │ ├── LICENSE.txt │ │ │ ├── setup.py │ │ │ ├── wstelnet.html │ │ │ ├── CHANGES.txt │ │ │ ├── rebind.c │ │ │ └── wsirc.html │ │ ├── b64-to-binary.pl │ │ ├── README.md │ │ ├── make-module-transform.js │ │ ├── u2x11 │ │ ├── img2js.py │ │ └── parse.js │ │ ├── .gitlastcommit │ │ ├── app │ │ ├── sounds │ │ │ ├── bell.mp3 │ │ │ ├── bell.oga │ │ │ └── CREDITS │ │ ├── styles │ │ │ ├── Orbitron700.ttf │ │ │ ├── Orbitron700.woff │ │ │ └── auto.css │ │ ├── images │ │ │ ├── icons │ │ │ │ ├── novnc-16x16.png │ │ │ │ ├── novnc-24x24.png │ │ │ │ ├── novnc-32x32.png │ │ │ │ ├── novnc-48x48.png │ │ │ │ ├── novnc-60x60.png │ │ │ │ ├── novnc-64x64.png │ │ │ │ ├── novnc-72x72.png │ │ │ │ ├── novnc-76x76.png │ │ │ │ ├── novnc-96x96.png │ │ │ │ ├── novnc-120x120.png │ │ │ │ ├── novnc-144x144.png │ │ │ │ ├── novnc-152x152.png │ │ │ │ ├── novnc-192x192.png │ │ │ │ └── Makefile │ │ │ ├── handle.svg │ │ │ ├── tab.svg │ │ │ ├── expander.svg │ │ │ ├── settings.svg │ │ │ ├── error.svg │ │ │ ├── fullscreen.svg │ │ │ ├── info.svg │ │ │ ├── ctrlaltdel.svg │ │ │ ├── connect.svg │ │ │ ├── alt.svg │ │ │ ├── warning.svg │ │ │ ├── power.svg │ │ │ └── clipboard.svg │ │ └── locale │ │ │ ├── de.js │ │ │ ├── nl.js │ │ │ ├── sv.js │ │ │ └── el.js │ │ ├── .npmignore │ │ ├── .travis.yml │ │ ├── po │ │ ├── Makefile │ │ ├── po2js │ │ ├── de.po │ │ ├── nl.po │ │ └── xgettext-html │ │ ├── core │ │ ├── inflator.mod.js │ │ └── input │ │ │ └── xtscancodes.js │ │ ├── tests │ │ ├── test.base64.js │ │ ├── fake.websocket.js │ │ ├── run_from_console.zombie.js │ │ └── assertions.js │ │ ├── package.json │ │ ├── CONTRIBUTING.md │ │ └── LICENSE.txt ├── startup.sh └── etc │ ├── supervisor │ └── conf.d │ │ └── supervisord.conf │ └── nginx │ └── sites-enabled │ └── default ├── yml ├── ubuntu-desktop-service.yml ├── ubuntu-desktop-deployment.yml └── kapp-spring-petclinic.yaml ├── README.md └── Dockerfile /image/usr/lib/web/log/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/VERSION: -------------------------------------------------------------------------------- 1 | 0.6.1 2 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/websockify.py: -------------------------------------------------------------------------------- 1 | run -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/include: -------------------------------------------------------------------------------- 1 | ../include -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/latency.py: -------------------------------------------------------------------------------- 1 | echo.py -------------------------------------------------------------------------------- /image/usr/lib/noVNC/.gitlastcommit: -------------------------------------------------------------------------------- 1 | 56d97524807b125d047730331031ddd00f9c61f 2 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/test-requirements.txt: -------------------------------------------------------------------------------- 1 | mox3 2 | nose 3 | -------------------------------------------------------------------------------- /image/usr/lib/web/static/robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org/ 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGES.txt README.md LICENSE.txt 2 | graft include 3 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/sounds/bell.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/sounds/bell.mp3 -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/sounds/bell.oga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/sounds/bell.oga -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/websockify/__init__.py: -------------------------------------------------------------------------------- 1 | from websockify.websocket import * 2 | from websockify.websocketproxy import * 3 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/rfbproto-3.3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/docs/rfbproto-3.3.pdf -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/rfbproto-3.7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/docs/rfbproto-3.7.pdf -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/rfbproto-3.8.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/docs/rfbproto-3.8.pdf -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import websockify 4 | 5 | websockify.websocketproxy.websockify_init() 6 | -------------------------------------------------------------------------------- /image/usr/lib/web/static/6df2b309.favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/web/static/6df2b309.favicon.ico -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/styles/Orbitron700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/styles/Orbitron700.ttf -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/styles/Orbitron700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/styles/Orbitron700.woff -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-16x16.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-24x24.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-32x32.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-48x48.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-60x60.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-64x64.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-72x72.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-76x76.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-96x96.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-120x120.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-144x144.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-152x152.png -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/novnc-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/noVNC/app/images/icons/novnc-192x192.png -------------------------------------------------------------------------------- /image/usr/lib/web/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/web/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /image/usr/lib/web/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/web/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /image/usr/lib/web/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jmcdice/k8s-ubuntu-desktop/HEAD/image/usr/lib/web/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/notes: -------------------------------------------------------------------------------- 1 | Rebuilding inflator.js 2 | 3 | - Download pako from npm 4 | - Install browserify using npm 5 | - browserify core/inflator.mod.js -o core/inflator.js -s Inflator 6 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/sounds/CREDITS: -------------------------------------------------------------------------------- 1 | bell 2 | Copyright: Dr. Richard Boulanger et al 3 | URL: http://www.archive.org/details/Berklee44v12 4 | License: CC-BY Attribution 3.0 Unported 5 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/docs/TODO: -------------------------------------------------------------------------------- 1 | - Go implementation 2 | - Rust implementation 3 | - Add sub-protocol support to upstream einaros/ws module and use that 4 | instead of the patched module. 5 | - wstelnet: support CSI L and CSI M 6 | 7 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/flash_policy.txt: -------------------------------------------------------------------------------- 1 | Manual setup: 2 | 3 | DATA="echo \'\'" 4 | /usr/bin/socat -T 1 TCP-L:843,reuseaddr,fork,crlf SYSTEM:"$DATA" 5 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS=rebind.so 2 | CFLAGS += -fPIC 3 | 4 | all: $(TARGETS) 5 | 6 | rebind.so: rebind.o 7 | $(CC) $(LDFLAGS) $^ -shared -fPIC -ldl -o $@ 8 | 9 | clean: 10 | rm -f rebind.o rebind.so 11 | 12 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.6 4 | - 2.7 5 | - 3.3 6 | - 3.4 7 | 8 | install: pip install -r test-requirements.txt 9 | 10 | script: python setup.py nosetests --verbosity=3 11 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/docs/flash_policy.txt: -------------------------------------------------------------------------------- 1 | Manual setup: 2 | 3 | DATA="echo \'\'" 4 | /usr/bin/socat -T 1 TCP-L:843,reuseaddr,fork,crlf SYSTEM:"$DATA" 5 | -------------------------------------------------------------------------------- /image/usr/lib/web/static/styles/536b3e9f.main.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px}.container-block{padding-top:64px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:4px 0 0 4px}.btn-group>.btn{width:90%;text-align:left}.btn-group>.btn+.dropdown-toggle{width:10%} -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/js/README.md: -------------------------------------------------------------------------------- 1 | A JavaScript implementation of the websockify WebSocket-to-TCP bridge/proxy. 2 | 3 | Copyright (C) 2013 - Joel Martin (github.com/kanaka) 4 | 5 | Licensed under LGPL-3. 6 | 7 | See http://github.com/kanaka/websockify for more info. 8 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/docs/notes: -------------------------------------------------------------------------------- 1 | Building release tarball: 2 | - not really necessary since tagged revision can be downloaded 3 | from github as tarballs 4 | 5 | git archive --format=tar --prefix=websockify-${WVER}/ v${WVER} > websockify-${WVER}.tar 6 | gzip websockify-${WVER}.tar 7 | -------------------------------------------------------------------------------- /image/usr/lib/web/config/__init__.py: -------------------------------------------------------------------------------- 1 | class Default(object): 2 | DEBUG = True 3 | 4 | 5 | class Development(Default): 6 | PHASE = 'development' 7 | 8 | 9 | class Staging(Default): 10 | PHASE = 'staging' 11 | 12 | 13 | class Production(Default): 14 | PHASE = 'production' 15 | DEBUG = False 16 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/.npmignore: -------------------------------------------------------------------------------- 1 | app 2 | core 3 | .gitmodules 4 | node_modules 5 | .* 6 | *~ 7 | *.swp 8 | *.swo 9 | tests 10 | .travis.yml 11 | utils 12 | docs/notes 13 | docs/links 14 | docs/release.txt 15 | docs/rfb_notes 16 | docs/*.pdf 17 | vnc.html 18 | vnc_auto.html 19 | karma.conf.js 20 | docs/flash_policy.txt 21 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS=websockify 2 | CFLAGS += -fPIC 3 | 4 | all: $(TARGETS) 5 | 6 | websockify: websockify.o websocket.o 7 | $(CC) $(LDFLAGS) $^ -lssl -lcrypto -lresolv -o $@ 8 | 9 | websocket.o: websocket.c websocket.h 10 | websockify.o: websockify.c websocket.h 11 | 12 | clean: 13 | rm -f websockify *.o 14 | 15 | -------------------------------------------------------------------------------- /yml/ubuntu-desktop-service.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | labels: 6 | app: ubuntu-desktop 7 | name: ubuntu-desktop 8 | namespace: desktop 9 | spec: 10 | ports: 11 | - port: 80 12 | protocol: TCP 13 | targetPort: 80 14 | selector: 15 | app: ubuntu-desktop 16 | sessionAffinity: None 17 | type: ClusterIP 18 | -------------------------------------------------------------------------------- /image/usr/lib/web/requirements.txt: -------------------------------------------------------------------------------- 1 | Flask==0.10.1 2 | Flask-Login==0.2.11 3 | Jinja2==2.7.3 4 | MarkupSafe==0.23 5 | Werkzeug==0.9.6 6 | argparse==1.2.1 7 | backports.ssl-match-hostname==3.4.0.2 8 | docker-py==0.5.3 9 | gevent==1.0.1 10 | gevent-websocket==0.9.3 11 | greenlet==0.4.5 12 | itsdangerous==0.24 13 | peewee==2.4.1 14 | requests==2.4.3 15 | six==1.8.0 16 | websocket-client==0.21.0 17 | wsgiref==0.1.2 18 | -------------------------------------------------------------------------------- /image/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p /var/run/sshd 4 | mkdir -p /var/run/dbus 5 | service dbus restart 6 | 7 | chown -R root:root /root 8 | 9 | if [ -n "$VNC_PASSWORD" ]; then 10 | echo -n "$VNC_PASSWORD" > /.password1 11 | x11vnc -storepasswd $(cat /.password1) /.password2 12 | chmod 400 /.password* 13 | sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf 14 | export VNC_PASSWORD= 15 | fi 16 | 17 | /usr/bin/supervisord -n 18 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/b64-to-binary.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use MIME::Base64; 3 | 4 | for (<>) { 5 | unless (/^'([{}])(\d+)\1(.+?)',$/) { 6 | print; 7 | next; 8 | } 9 | 10 | my ($dir, $amt, $b64) = ($1, $2, $3); 11 | 12 | my $decoded = MIME::Base64::decode($b64) or die "Could not base64-decode line `$_`"; 13 | 14 | my $decoded_escaped = join "", map { "\\x$_" } unpack("(H2)*", $decoded); 15 | 16 | print "'${dir}${amt}${dir}${decoded_escaped}',\n"; 17 | } 18 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/rebind: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | usage() { 4 | echo "Usage: $(basename $0) OLD_PORT NEW_PORT COMMAND_LINE" 5 | echo 6 | echo "Launch COMMAND_LINE, but intercept system calls to bind" 7 | echo "to OLD_PORT and instead bind them to localhost:NEW_PORT" 8 | exit 2 9 | } 10 | 11 | # Parameter defaults 12 | mydir=$(readlink -f $(dirname ${0})) 13 | 14 | export REBIND_PORT_OLD="${1}"; shift 15 | export REBIND_PORT_NEW="${1}"; shift 16 | 17 | LD_PRELOAD=${mydir}/rebind.so "${@}" 18 | 19 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/docs/release.txt: -------------------------------------------------------------------------------- 1 | - Update setup.py, CHANGES.txt and other/package.json and commit 2 | - Create version tag and tarball from tag 3 | WVER=0.1.0 4 | git tag v${WVER} 5 | git push origin master 6 | git push origin v${WVER} 7 | - Register with pypi.python.org (once): 8 | python setup.py register 9 | - Upload the source distribution to pypi 10 | python setup.py sdist upload 11 | - Register with npmjs.org (once) 12 | - Upload websockify.js npmjs.org package 13 | npm publish other/js 14 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/wswrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | usage() { 4 | echo "Usage: $(basename $0) PORT CMDLINE" 5 | echo 6 | echo " PORT Port to wrap with WebSockets support" 7 | echo " CMDLINE Command line to wrap" 8 | exit 2 9 | } 10 | 11 | # Parameter defaults 12 | mydir=$(readlink -f $(dirname ${0})) 13 | 14 | # Process parameters 15 | #while [ "${1}" != "${1#-}" ]; do 16 | # param=$1; shift 17 | #done 18 | 19 | export WSWRAP_PORT="${1}"; shift 20 | 21 | LD_PRELOAD=${mydir}/wswrapper.so "${@}" 22 | 23 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Configuration.Install; 6 | using System.Linq; 7 | 8 | 9 | namespace MELT_Command_Websocket 10 | { 11 | [RunInstaller(true)] 12 | public partial class ProjectInstaller : System.Configuration.Install.Installer 13 | { 14 | public ProjectInstaller() 15 | { 16 | InitializeComponent(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/README.md: -------------------------------------------------------------------------------- 1 | ## WebSockets Proxy/Bridge 2 | 3 | Websockify has been forked out into its own project. `launch.sh` wil 4 | automatically download it here if it is not already present and not 5 | installed as system-wide. 6 | 7 | For more detailed description and usage information please refer to 8 | the [websockify README](https://github.com/kanaka/websockify/blob/master/README.md). 9 | 10 | The other versions of websockify (C, Node.js) and the associated test 11 | programs have been moved to 12 | [websockify](https://github.com/kanaka/websockify). Websockify was 13 | formerly named wsproxy. 14 | 15 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tox.ini: -------------------------------------------------------------------------------- 1 | # Tox (http://tox.testrun.org/) is a tool for running tests 2 | # in multiple virtualenvs. This configuration file will run the 3 | # test suite on all supported python versions. To use it, "pip install tox" 4 | # and then run "tox" from this directory. 5 | 6 | [tox] 7 | envlist = py24,py26,py27,py33,py34 8 | 9 | [testenv] 10 | commands = nosetests {posargs} 11 | deps = -r{toxinidir}/test-requirements.txt 12 | 13 | # At some point we should enable this since tox expects it to exist but 14 | # the code will need pep8ising first. 15 | #[testenv:pep8] 16 | #commands = flake8 17 | #dep = flake8 18 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/LICENSE.txt: -------------------------------------------------------------------------------- 1 | websockify is licensed under the LGPL version 3 (see docs/LICENSE.GPL-3 and 2 | docs/LICENSE.LGPL-3) with the following exceptions: 3 | 4 | include/websock.js : MPL 2.0 5 | 6 | include/des.js : Various BSD style licenses 7 | 8 | include/web-socket-js/ : New BSD license (3-clause). Source code at 9 | https://github.com/gimite/web-socket-js 10 | 11 | other/kumina.c : Simplified BSD license (2 clause). 12 | Original source at 13 | https://github.com/kumina/wsproxy 14 | 15 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.ServiceProcess; 5 | using System.Text; 6 | 7 | namespace MELT_Command_Websocket 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | static void Main() 15 | { 16 | ServiceBase[] ServicesToRun; 17 | ServicesToRun = new ServiceBase[] 18 | { 19 | new Service1() 20 | }; 21 | ServiceBase.Run(ServicesToRun); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Joel Martin (http://github.com/kanaka)", 3 | "name": "websockify", 4 | "description": "websockify is a WebSocket-to-TCP proxy/bridge", 5 | "license": "LGPL-3.0", 6 | "version": "0.8.0", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/kanaka/websockify.git" 10 | }, 11 | "files": ["../../docs/LICENSE.LGPL-3","websockify.js"], 12 | "bin": { 13 | "websockify": "./websockify.js" 14 | }, 15 | "engines": { 16 | "node": ">=0.8.9" 17 | }, 18 | "dependencies": { 19 | "ws": ">=0.4.27", 20 | "optimist": "latest", 21 | "policyfile": "latest" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/project.clj: -------------------------------------------------------------------------------- 1 | (defproject websockify "1.0.0-SNAPSHOT" 2 | :description "Clojure implementation of Websockify" 3 | :url "https://github.com/kanaka/websockify" 4 | :dependencies [[org.clojure/clojure "1.2.1"] 5 | [org.clojure/tools.cli "0.2.1"] 6 | [ring/ring-jetty-adapter "1.0.0-beta2"] 7 | [org.eclipse.jetty/jetty-websocket "7.5.4.v20111024"] 8 | [org.eclipse.jetty/jetty-server "7.5.4.v20111024"] 9 | [org.eclipse.jetty/jetty-servlet "7.5.4.v20111024"] 10 | [org.jboss.netty/netty "3.2.5.Final"]] 11 | ;:dev-dependencies [[swank-clojure "1.3.0-SNAPSHOT"]] 12 | :main websockify 13 | ) 14 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/locale/de.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Translations for de 3 | * 4 | * This file was autotomatically generated from de.po 5 | * DO NOT EDIT! 6 | */ 7 | 8 | Language = { 9 | "Connecting...": "Verbunden...", 10 | "Connected (encrypted) to ": "Verbunden mit (verschlüsselt) ", 11 | "Connected (unencrypted) to ": "Verbunden mit (unverschlüsselt) ", 12 | "Disconnecting...": "Verbindung trennen...", 13 | "Disconnected": "Verbindung zum Server getrennt", 14 | "Must set host and port": "Richten Sie Host und Port ein", 15 | "Password is required": "Passwort ist erforderlich", 16 | "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen": "'Clipping-Modus' aktiviert, Scrollbalken in 'IE-Vollbildmodus' werden nicht unterstützt", 17 | "Disconnect timeout": "Timeout beim trennen", 18 | }; 19 | -------------------------------------------------------------------------------- /yml/ubuntu-desktop-deployment.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | labels: 6 | app: ubuntu-desktop 7 | name: ubuntu-desktop 8 | namespace: desktop 9 | spec: 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: ubuntu-desktop 14 | template: 15 | metadata: 16 | labels: 17 | app: ubuntu-desktop 18 | spec: 19 | containers: 20 | #- image: jmcdice/k8s-ubuntu-desktop:latest 21 | - image: fredblgr/ubuntu-novnc:22.04 22 | imagePullPolicy: Always 23 | name: ubuntu-desktop 24 | ports: 25 | - containerPort: 6080 26 | protocol: TCP 27 | env: 28 | - name: VNC_PASSWORD 29 | valueFrom: 30 | secretKeyRef: 31 | name: vnc-password 32 | key: password 33 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/locale/nl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Translations for nl 3 | * 4 | * This file was autotomatically generated from nl.po 5 | * DO NOT EDIT! 6 | */ 7 | 8 | Language = { 9 | "Connecting...": "Verbinden...", 10 | "Connected (encrypted) to ": "Verbonden (versleuteld) met ", 11 | "Connected (unencrypted) to ": "Verbonden (onversleuteld) met ", 12 | "Disconnecting...": "Verbinding verbreken...", 13 | "Disconnected": "Verbinding verbroken", 14 | "Must set host and port": "Host en poort moeten worden ingesteld", 15 | "Password is required": "Wachtwoord is vereist", 16 | "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen": "''Clipping mode' ingeschakeld, omdat schuifbalken in volledige-scherm-modus in IE niet worden ondersteund", 17 | "Disconnect timeout": "Timeout tijdens verbreken van verbinding", 18 | }; 19 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/make-module-transform.js: -------------------------------------------------------------------------------- 1 | var through = require('through2'); 2 | 3 | var singleLineRe = /\/\* \[module\] ((.(?!\*\/))+) \*\//g; 4 | var multiLineRe = /\/\* \[module\]\n(( * .+\n)+) \*\//g; 5 | 6 | var skipAsModule = /\/\* \[begin skip-as-module\] \*\/(.|\n)+\/\* \[end skip-as-module\] \*\//g; 7 | 8 | module.exports = function (file) { 9 | var stream = through(function (buf, enc, next) { 10 | var bufStr = buf.toString('utf8'); 11 | bufStr = bufStr.replace(singleLineRe, "$1"); 12 | bufStr = bufStr.replace(multiLineRe, function (match, mainLines) { 13 | return mainLines.split(" * ").join(""); 14 | }); 15 | 16 | bufStr = bufStr.replace(skipAsModule, ""); 17 | 18 | this.push(bufStr); 19 | next(); 20 | }); 21 | 22 | stream._is_make_module = true; 23 | 24 | return stream; 25 | }; 26 | -------------------------------------------------------------------------------- /image/etc/supervisor/conf.d/supervisord.conf: -------------------------------------------------------------------------------- 1 | [program:xorg] 2 | priority=10 3 | command=Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile /var/log/xorg.log -config /etc/xorg.conf :1 4 | 5 | [program:mate] 6 | priority=15 7 | directory=/home/mate 8 | command=/usr/bin/mate-session 9 | user=mate 10 | autostart=true 11 | autorestart=true 12 | stopsignal=QUIT 13 | environment=DISPLAY=":1",HOME="/home/mate" 14 | stdout_logfile=/var/log/lxsession.log 15 | stderr_logfile=/var/log/lxsession.err 16 | 17 | 18 | [program:x11vnc] 19 | priority=20 20 | command=x11vnc -geometry 1600x960 -display :1 -xkb -forever -shared 21 | 22 | [program:lightop] 23 | priority=25 24 | directory=/usr/lib/web/ 25 | command=/usr/lib/web/run.py 26 | 27 | [program:nginx] 28 | priority=30 29 | command=nginx -c /etc/nginx/nginx.conf -g "daemon off;" 30 | 31 | [program:novnc] 32 | priority=35 33 | command=/usr/lib/noVNC/utils/launch.sh --listen 6081 34 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | cache: 4 | directories: 5 | - node_modules 6 | node_js: 7 | - '6.1' 8 | env: 9 | matrix: 10 | - TEST_BROWSER_NAME=PhantomJS 11 | - TEST_BROWSER_NAME=chrome TEST_BROWSER_OS='Windows 10,Linux,OS X 10.11' 12 | - TEST_BROWSER_NAME=firefox TEST_BROWSER_OS='Windows 10,Linux,OS X 10.11' 13 | - TEST_BROWSER_NAME='internet explorer' TEST_BROWSER_OS='Windows 10' 14 | - TEST_BROWSER_NAME=safari TEST_BROWSER_OS='OS X 10.11' 15 | global: 16 | - secure: QE5GqGd2hrpQsIgd8dlv3oRUUHqZayomzzQjNXOB81VQi241uz/ru+3GtBZLB5WLZCq/Gj89vbLnR0LN4ixlmPaWv3/WJQGyDGuRD/vMnccVl+rBUP/Hh2zdYwiISIGcrywNAE+KLus/lyt/ahVgzbaRaDSzrM1HaZFT/rndGck= 17 | - secure: g75sdctEwj0hoLW0Y08Tdv8s5scNzplB6a9EtaJ2vJD9S/bK+AsPqbWesGv1UlrFPCWdbV7Vg61vkmoUjcmb5xhqFIjcM9TlYJoKWeOTsOmnQoSIkIq6gMF1k02+LmKInbPgIzrp3m3jluS1qaOs/EzFpDnJp9hWBiAfXa12Jxk= 18 | before_script: npm install -g karma-cli 19 | addons: 20 | sauce_connect: true 21 | -------------------------------------------------------------------------------- /yml/kapp-spring-petclinic.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: spring-petclinic 6 | --- 7 | apiVersion: apps/v1 8 | kind: Deployment 9 | metadata: 10 | name: spring-petclinic 11 | namespace: spring-petclinic 12 | spec: 13 | selector: 14 | matchLabels: 15 | app: spring-petclinic 16 | replicas: 2 17 | template: 18 | metadata: 19 | labels: 20 | app: spring-petclinic 21 | spec: 22 | containers: 23 | - name: spring-petclinic 24 | image: springcommunity/spring-framework-petclinic 25 | ports: 26 | - name: http 27 | containerPort: 8080 28 | --- 29 | apiVersion: v1 30 | kind: Service 31 | metadata: 32 | name: spring-petclinic 33 | namespace: spring-petclinic 34 | labels: 35 | app: spring-petclinic 36 | spec: 37 | ports: 38 | - port: 80 39 | protocol: TCP 40 | targetPort: 8080 41 | selector: 42 | app: spring-petclinic 43 | type: ClusterIP 44 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "noVNC Websocket", "noVNC Websocket.csproj", "{6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}.Debug|x86.ActiveCfg = Debug|x86 13 | {6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}.Debug|x86.Build.0 = Debug|x86 14 | {6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}.Release|x86.ActiveCfg = Release|x86 15 | {6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/po/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | .PHONY: update-po update-js update-pot 3 | 4 | LINGUAS := de el nl sv 5 | 6 | VERSION := $(shell grep '"version"' ../package.json | cut -d '"' -f 4) 7 | 8 | POFILES := $(addsuffix .po,$(LINGUAS)) 9 | JSFILES := $(addprefix ../app/locale/,$(addsuffix .js,$(LINGUAS))) 10 | 11 | update-po: $(POFILES) 12 | update-js: $(JSFILES) 13 | 14 | %.po: noVNC.pot 15 | msgmerge --update --lang=$* $@ $< 16 | ../app/locale/%.js: %.po 17 | ./po2js $< $@ 18 | 19 | update-pot: 20 | xgettext --output=noVNC.js.pot \ 21 | --copyright-holder="Various Authors" \ 22 | --package-name="noVNC" \ 23 | --package-version="$(VERSION)" \ 24 | --msgid-bugs-address="novnc@googlegroups.com" \ 25 | --add-comments=TRANSLATORS: \ 26 | --sort-by-file \ 27 | ../app/*.js \ 28 | ../core/*.js \ 29 | ../core/input/*.js 30 | ./xgettext-html --output=noVNC.html.pot \ 31 | ../vnc.html 32 | msgcat --output-file=noVNC.pot \ 33 | --sort-by-file noVNC.js.pot noVNC.html.pot 34 | rm -f noVNC.js.pot noVNC.html.pot 35 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/LICENSE.zlib: -------------------------------------------------------------------------------- 1 | Copyright (c) , 2 | All rights reserved. 3 | 4 | This software is provided 'as-is', without any express 5 | or implied warranty. In no event will the authors be 6 | held liable for any damages arising from the use of 7 | this software. 8 | 9 | Permission is granted to anyone to use this software 10 | for any purpose, including commercial applications, 11 | and to alter it and redistribute it freely, subject to 12 | the following restrictions: 13 | 14 | 1. The origin of this software must not be 15 | misrepresented; you must not claim that you 16 | wrote the original software. If you use this 17 | software in a product, an acknowledgment in 18 | the product documentation would be appreciated 19 | but is not required. 20 | 21 | 2. Altered source versions must be plainly marked 22 | as such, and must not be misrepresented as 23 | being the original software. 24 | 25 | 3. This notice may not be removed or altered from 26 | any source distribution. 27 | 28 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/u2x11: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Convert "U+..." commented entries in /usr/include/X11/keysymdef.h 4 | # into JavaScript for use by noVNC. Note this is likely to produce 5 | # a few duplicate properties with clashing values, that will need 6 | # resolving manually. 7 | # 8 | # Colin Dean 9 | # 10 | 11 | regex="^#define[ \t]+XK_[A-Za-z0-9_]+[ \t]+0x([0-9a-fA-F]+)[ \t]+\/\*[ \t]+U\+([0-9a-fA-F]+)[ \t]+[^*]+.[ \t]+\*\/[ \t]*$" 12 | echo "unicodeTable = {" 13 | while read line; do 14 | if echo "${line}" | egrep -qs "${regex}"; then 15 | 16 | x11=$(echo "${line}" | sed -r "s/${regex}/\1/") 17 | vnc=$(echo "${line}" | sed -r "s/${regex}/\2/") 18 | 19 | if echo "${vnc}" | egrep -qs "^00[2-9A-F][0-9A-F]$"; then 20 | : # skip ISO Latin-1 (U+0020 to U+00FF) as 1-to-1 mapping 21 | else 22 | # note 1-to-1 is possible (e.g. for Euro symbol, U+20AC) 23 | echo " 0x${vnc} : 0x${x11}," 24 | fi 25 | fi 26 | done < /usr/include/X11/keysymdef.h | uniq 27 | echo "};" 28 | 29 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/icons/Makefile: -------------------------------------------------------------------------------- 1 | ICONS := \ 2 | novnc-16x16.png \ 3 | novnc-24x24.png \ 4 | novnc-32x32.png \ 5 | novnc-48x48.png \ 6 | novnc-64x64.png 7 | 8 | ANDROID_LAUNCHER := \ 9 | novnc-48x48.png \ 10 | novnc-72x72.png \ 11 | novnc-96x96.png \ 12 | novnc-144x144.png \ 13 | novnc-192x192.png 14 | 15 | IPHONE_LAUNCHER := \ 16 | novnc-60x60.png \ 17 | novnc-120x120.png 18 | 19 | IPAD_LAUNCHER := \ 20 | novnc-76x76.png \ 21 | novnc-152x152.png 22 | 23 | ALL_ICONS := $(ICONS) $(ANDROID_LAUNCHER) $(IPHONE_LAUNCHER) $(IPAD_LAUNCHER) 24 | 25 | all: $(ALL_ICONS) 26 | 27 | novnc-16x16.png: novnc-icon-sm.svg 28 | convert -density 90 \ 29 | -background transparent "$<" "$@" 30 | novnc-24x24.png: novnc-icon-sm.svg 31 | convert -density 135 \ 32 | -background transparent "$<" "$@" 33 | novnc-32x32.png: novnc-icon-sm.svg 34 | convert -density 180 \ 35 | -background transparent "$<" "$@" 36 | 37 | novnc-%.png: novnc-icon.svg 38 | convert -density $$[`echo $* | cut -d x -f 1` * 90 / 48] \ 39 | -background transparent "$<" "$@" 40 | 41 | clean: 42 | rm -f *.png 43 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/img2js.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # 4 | # Convert image to Javascript compatible base64 Data URI 5 | # Copyright 2011 Joel Martin 6 | # Licensed under MPL 2.0 (see docs/LICENSE.MPL-2.0) 7 | # 8 | 9 | import sys, base64 10 | 11 | try: 12 | from PIL import Image 13 | except: 14 | print "python PIL module required (python-imaging package)" 15 | sys.exit(1) 16 | 17 | 18 | if len(sys.argv) < 3: 19 | print "Usage: %s IMAGE JS_VARIABLE" % sys.argv[0] 20 | sys.exit(1) 21 | 22 | fname = sys.argv[1] 23 | var = sys.argv[2] 24 | 25 | ext = fname.lower().split('.')[-1] 26 | if ext == "png": mime = "image/png" 27 | elif ext in ["jpg", "jpeg"]: mime = "image/jpeg" 28 | elif ext == "gif": mime = "image/gif" 29 | else: 30 | print "Only PNG, JPEG and GIF images are supported" 31 | sys.exit(1) 32 | uri = "data:%s;base64," % mime 33 | 34 | im = Image.open(fname) 35 | w, h = im.size 36 | 37 | raw = open(fname).read() 38 | 39 | print '%s = {"width": %s, "height": %s, "data": "%s%s"};' % ( 40 | var, w, h, uri, base64.b64encode(raw)) 41 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/LICENSE.pako: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (C) 2014 by Vitaly Puzrin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | k8s-ubuntu-desktop 2 | ================== 3 | Docker image and k8s manifests for running a web-based Linux Desktop. 4 | 5 | [Docker Hub](https://hub.docker.com/r/jmcdice/k8s-ubuntu-desktop) 6 | 7 | Quick Start 8 | ------------------------- 9 | 10 | ### Create a NS and password secret 11 | ```console 12 | $ kubectl create ns desktop 13 | $ kubectl create secret generic -n desktop vnc-password --from-literal=password='my_password' 14 | ``` 15 | 16 | ### Deploy the container 17 | ```console 18 | $ kubectl create -f yml/ubuntu-desktop-deployment.yml 19 | ``` 20 | 21 | ### Optional: Create a service 22 | ```console 23 | $ kubectl create -f yml/ubuntu-desktop-service.yml 24 | ``` 25 | 26 | ### port-forward to the desktop service 27 | ```console 28 | kubectl port-forward service/ubuntu-desktop -n desktop 8080:80 29 | ``` 30 | 31 | ### Access the desktop UI 32 | http://localhost:8080/vnc.html 33 | 34 | ## Clean up 35 | ```console 36 | $ kubectl delete ns desktop 37 | ``` 38 | 39 | ## Run as a docker on localhost 40 | ```console 41 | $ docker run -p 6080:80 --name ubuntu-desktop -v $HOME:/home/mate/mount jmcdice/k8s-ubuntu-desktop:latest 42 | # Browse to: http://localhost:6080/vnc.html 43 | ``` 44 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/test_auth_plugins.py: -------------------------------------------------------------------------------- 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4 2 | 3 | """ Unit tests for Authentication plugins""" 4 | 5 | from websockify.auth_plugins import BasicHTTPAuth, AuthenticationError 6 | import unittest 7 | 8 | 9 | class BasicHTTPAuthTestCase(unittest.TestCase): 10 | 11 | def setUp(self): 12 | self.plugin = BasicHTTPAuth('Aladdin:open sesame') 13 | 14 | def test_no_auth(self): 15 | headers = {} 16 | self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234') 17 | 18 | def test_invalid_password(self): 19 | headers = {'Authorization': 'Basic QWxhZGRpbjpzZXNhbWUgc3RyZWV0'} 20 | self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234') 21 | 22 | def test_valid_password(self): 23 | headers = {'Authorization': 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='} 24 | self.plugin.authenticate(headers, 'localhost', '1234') 25 | 26 | def test_garbage_auth(self): 27 | headers = {'Authorization': 'Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxx'} 28 | self.assertRaises(AuthenticationError, self.plugin.authenticate, headers, 'localhost', '1234') 29 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/Service1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MELT_Command_Websocket 2 | { 3 | partial class Service1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | components = new System.ComponentModel.Container(); 32 | this.ServiceName = "Service1"; 33 | } 34 | 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/release.txt: -------------------------------------------------------------------------------- 1 | - Decide a new version number X.Y.Z (follow SemVer) 2 | - Update version in package.json 3 | - Update version in docs/VERSION 4 | - Commit the change with a commit like "Release X.Y.Z" 5 | - Add a new release on GitHub called "vX.Y.Z", and populate it with 6 | release notes of the following form (where A.B.C is the last release): 7 | 8 | Major Changes Since A.B.C 9 | ========================= 10 | 11 | *Insert warnings here about incompatibilities* 12 | 13 | *Thanks to all the contributors who filed bugs, added features, and fixed bugs 14 | during this release :tada:* 15 | 16 | App-visible Changes 17 | ------------------- 18 | 19 | - *feature* a feature which improves the app usage (#PRNUM) 20 | - *bugfix* a bug fix which fixes the app usage (#PRNUM) 21 | - *refactor* a refactor which changes the app usage (#PRNUM) 22 | 23 | Library-visible Changes 24 | ----------------------- 25 | 26 | - *feature* a feature which improves the noVNC APIs (#PRNUM) 27 | - *bugfix* a bug fix which fixes the noVNC APIs (#PRNUM) 28 | - *refactor* a refactor which changes the noVNC APIs (#PRNUM) 29 | 30 | App-internals Changes 31 | --------------------- 32 | 33 | - *bugfix* a bug fix with affects the internals of noVNC only (#PRNUM) 34 | - *refactor* a refactor which affects the internals of noVNC only (#PRNUM) 35 | -------------------------------------------------------------------------------- /image/etc/nginx/sites-enabled/default: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | #listen [::]:6080 default_server ipv6only=on; 4 | 5 | root /usr/share/nginx/html; 6 | index index.html index.htm; 7 | 8 | location / { 9 | try_files $uri @proxy; 10 | } 11 | 12 | location = / { 13 | try_files $uri @proxy2; 14 | } 15 | 16 | location = /redirect.html { 17 | try_files $uri @proxy2; 18 | } 19 | 20 | location @proxy2 { 21 | proxy_set_header X-Real-IP $remote_addr; 22 | proxy_set_header X-Forwarded-For $remote_addr; 23 | proxy_set_header Host $host; 24 | proxy_pass http://127.0.0.1:6079; 25 | max_ranges 0; 26 | } 27 | 28 | location @proxy { 29 | proxy_set_header X-Real-IP $remote_addr; 30 | proxy_set_header X-Forwarded-For $remote_addr; 31 | proxy_set_header Host $host; 32 | proxy_pass http://127.0.0.1:6081; 33 | max_ranges 0; 34 | } 35 | 36 | location = /websockify { 37 | proxy_http_version 1.1; 38 | proxy_set_header Upgrade $http_upgrade; 39 | proxy_set_header Connection "upgrade"; 40 | proxy_pass http://127.0.0.1:6081; 41 | 42 | # VNC connection timeout 43 | proxy_read_timeout 61s; 44 | 45 | # Disable cache 46 | proxy_buffering off; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/core/inflator.mod.js: -------------------------------------------------------------------------------- 1 | var zlib = require('pako/lib/zlib/inflate.js'); 2 | var ZStream = require('pako/lib/zlib/zstream.js'); 3 | 4 | function Inflate() { 5 | this.strm = new ZStream(); 6 | this.chunkSize = 1024 * 10 * 10; 7 | this.strm.output = new Uint8Array(this.chunkSize); 8 | this.windowBits = 5; 9 | 10 | zlib.inflateInit(this.strm, this.windowBits); 11 | }; 12 | 13 | Inflate.prototype = { 14 | inflate: function (data, flush, expected) { 15 | this.strm.input = data; 16 | this.strm.avail_in = this.strm.input.length; 17 | this.strm.next_in = 0; 18 | this.strm.next_out = 0; 19 | 20 | // resize our output buffer if it's too small 21 | // (we could just use multiple chunks, but that would cause an extra 22 | // allocation each time to flatten the chunks) 23 | if (expected > this.chunkSize) { 24 | this.chunkSize = expected; 25 | this.strm.output = new Uint8Array(this.chunkSize); 26 | } 27 | 28 | this.strm.avail_out = this.chunkSize; 29 | 30 | zlib.inflate(this.strm, flush); 31 | 32 | return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out); 33 | }, 34 | 35 | reset: function () { 36 | zlib.inflateReset(this.strm); 37 | } 38 | }; 39 | 40 | module.exports = { Inflate: Inflate }; 41 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/LICENSE.BSD-2-Clause: -------------------------------------------------------------------------------- 1 | Copyright (c) , 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 17 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/Service1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Diagnostics; 6 | using System.Linq; 7 | using System.ServiceProcess; 8 | using System.Text; 9 | using System.IO; 10 | 11 | namespace MELT_Command_Websocket 12 | { 13 | public partial class Service1 : ServiceBase 14 | { 15 | Process websockify; 16 | public Service1() 17 | { 18 | InitializeComponent(); 19 | } 20 | 21 | protected override void OnStart(string[] args) 22 | { 23 | 24 | string configpath = AppDomain.CurrentDomain.BaseDirectory + "\\noVNCConfig.ini"; 25 | string sockifypath = AppDomain.CurrentDomain.BaseDirectory + "\\websockify.exe"; 26 | //Load commandline arguements from config file. 27 | StreamReader streamReader = new StreamReader(configpath); 28 | string arguements = streamReader.ReadLine(); 29 | streamReader.Close(); 30 | 31 | //Start websockify. 32 | websockify = System.Diagnostics.Process.Start(sockifypath, arguements); 33 | } 34 | 35 | protected override void OnStop() 36 | { 37 | //Service stopped. Close websockify. 38 | websockify.Kill(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/tests/test.base64.js: -------------------------------------------------------------------------------- 1 | // requires local modules: base64 2 | var assert = chai.assert; 3 | var expect = chai.expect; 4 | 5 | describe('Base64 Tools', function() { 6 | "use strict"; 7 | 8 | var BIN_ARR = new Array(256); 9 | for (var i = 0; i < 256; i++) { 10 | BIN_ARR[i] = i; 11 | } 12 | 13 | var B64_STR = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="; 14 | 15 | 16 | describe('encode', function() { 17 | it('should encode a binary string into Base64', function() { 18 | var encoded = Base64.encode(BIN_ARR); 19 | expect(encoded).to.equal(B64_STR); 20 | }); 21 | }); 22 | 23 | describe('decode', function() { 24 | it('should decode a Base64 string into a normal string', function() { 25 | var decoded = Base64.decode(B64_STR); 26 | expect(decoded).to.deep.equal(BIN_ARR); 27 | }); 28 | 29 | it('should throw an error if we have extra characters at the end of the string', function() { 30 | expect(function () { Base64.decode(B64_STR+'abcdef'); }).to.throw(Error); 31 | }); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/LICENSE.BSD-3-Clause: -------------------------------------------------------------------------------- 1 | Copyright (c) , 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/README.md: -------------------------------------------------------------------------------- 1 | This directory contain alternate implementations of 2 | WebSockets-to-TCP-Socket proxies (for noVNC). 3 | 4 | ## websockify.c (C) 5 | 6 | ### Description 7 | 8 | This is a C version of the original websockify. It is more limited in 9 | functionality than the original. 10 | 11 | 12 | ## websockify.js 13 | 14 | ### Description 15 | 16 | This is a Node.JS (server-side event driven Javascript) implementation 17 | of websockify. 18 | 19 | 20 | ## kumina.c (C) 21 | 22 | ### Description 23 | 24 | The upstream source of the kumina proxy is [here](https://github.com/kumina/wsproxy). 25 | 26 | [This article](http://blog.kumina.nl/2011/06/proxying-and-multiplexing-novnc-using-wsproxy/) 27 | describes the kumina proxy. 28 | 29 | kumina is an application that is run from inetd, which allows noVNC 30 | to connect to an unmodified VNC server. Furthermore, it makes use of 31 | the recently added support in noVNC for file names. The file name is 32 | used to denote the port number. Say, you connect to: 33 | 34 | ws://host:41337/25900 35 | 36 | The kumina proxy opens a connection to: 37 | 38 | vnc://host:25900/ 39 | 40 | The address to which kumina connects, is the same as the address to 41 | which the client connected (using getsockname()). 42 | 43 | ### Configuration 44 | 45 | kumina can be enabled by adding the following line to inetd.conf: 46 | 47 | 41337 stream tcp nowait nobody /usr/sbin/kumina kumina 25900 25909 48 | 49 | The two parameters of kumina denote the minimum and the maximum allowed 50 | port numbers. This allows a single kumina instance to multiplex 51 | connections to multiple VNC servers. 52 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("MELT Command Websocket")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("MELT Command Websocket")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5ab831cb-6852-4ce1-849c-b26725b0e10b")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | version = '0.8.0' 4 | name = 'websockify' 5 | long_description = open("README.md").read() + "\n" + \ 6 | open("CHANGES.txt").read() + "\n" 7 | 8 | setup(name=name, 9 | version=version, 10 | description="Websockify.", 11 | long_description=long_description, 12 | classifiers=[ 13 | "Programming Language :: Python", 14 | "Programming Language :: Python :: 2", 15 | "Programming Language :: Python :: 2.6", 16 | "Programming Language :: Python :: 2.7", 17 | "Programming Language :: Python :: 3", 18 | "Programming Language :: Python :: 3.3", 19 | "Programming Language :: Python :: 3.4" 20 | ], 21 | data_files=[('share/websockify/include', 22 | ['include/util.js', 23 | 'include/base64.js', 24 | 'include/websock.js']), 25 | ('share/websockify/include/web-socket-js', 26 | ['include/web-socket-js/WebSocketMain.swf', 27 | 'include/web-socket-js/swfobject.js', 28 | 'include/web-socket-js/web_socket.js'])], 29 | keywords='noVNC websockify', 30 | license='LGPLv3', 31 | url="https://github.com/kanaka/websockify", 32 | author="Joel Martin", 33 | author_email="github@martintribe.org", 34 | 35 | packages=['websockify'], 36 | include_package_data=True, 37 | install_requires=['numpy'], 38 | zip_safe=False, 39 | entry_points={ 40 | 'console_scripts': [ 41 | 'websockify = websockify.websocketproxy:websockify_init', 42 | ] 43 | }, 44 | ) 45 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/echo.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # A WebSocket server that echos back whatever it receives from the client. 4 | # Copyright 2011 Joel Martin 5 | # Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3) 6 | 7 | require 'socket' 8 | $: << "other" 9 | $: << "../other" 10 | require 'websocket' 11 | 12 | class WebSocketEcho < WebSocketServer 13 | 14 | # Echo back whatever is received 15 | def new_websocket_client(client) 16 | 17 | cqueue = [] 18 | c_pend = 0 19 | rlist = [client] 20 | 21 | loop do 22 | wlist = [] 23 | 24 | if cqueue.length > 0 or c_pend 25 | wlist << client 26 | end 27 | 28 | ins, outs, excepts = IO.select(rlist, wlist, nil, 1) 29 | if excepts.length > 0 30 | raise Exception, "Socket exception" 31 | end 32 | 33 | if outs.include?(client) 34 | # Send queued data to the client 35 | c_pend = send_frames(cqueue) 36 | cqueue = [] 37 | end 38 | 39 | if ins.include?(client) 40 | # Receive client data, decode it, and send it back 41 | frames, closed = recv_frames 42 | cqueue += frames 43 | 44 | if closed 45 | raise EClose, closed 46 | end 47 | end 48 | 49 | end # loop 50 | end 51 | end 52 | 53 | port = ARGV[0].to_i || 8080 54 | puts "Starting server on port #{port}" 55 | server_cert = nil 56 | server_key = nil 57 | if ARGV.length > 2 58 | server_cert = ARGV[1] 59 | server_key = ARGV[2] 60 | end 61 | 62 | server = WebSocketEcho.new('listen_port' => port, 'verbose' => true, 63 | 'server_cert' => server_cert, 'server_key' => server_key) 64 | server.start 65 | server.join 66 | 67 | puts "Server has been terminated" 68 | 69 | # vim: sw=2 70 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/po/po2js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* 3 | * ps2js: gettext .po to noVNC .js converter 4 | * Copyright (C) 2016 Pierre Ossman 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | var getopt = require('node-getopt'); 21 | var fs = require('fs'); 22 | var po2json = require("po2json"); 23 | 24 | opt = getopt.create([ 25 | ['h' , 'help' , 'display this help'], 26 | ]).bindHelp().parseSystem(); 27 | 28 | if (opt.argv.length != 2) { 29 | console.error("Incorrect number of arguments given"); 30 | process.exit(1); 31 | } 32 | 33 | var data = po2json.parseFileSync(opt.argv[0]); 34 | 35 | var output = 36 | "/*\n" + 37 | " * Translations for " + data[""]["language"] + "\n" + 38 | " *\n" + 39 | " * This file was autotomatically generated from " + opt.argv[0] + "\n" + 40 | " * DO NOT EDIT!\n" + 41 | " */\n" + 42 | "\n" + 43 | "Language = {\n"; 44 | 45 | for (msgid in data) { 46 | if (msgid === "") 47 | continue; 48 | 49 | msgstr = data[msgid][1]; 50 | output += " " + JSON.stringify(msgid) + ": " + 51 | JSON.stringify(msgstr) + ",\n"; 52 | } 53 | 54 | output += "};\n"; 55 | 56 | fs.writeFileSync(opt.argv[1], output); 57 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/po/de.po: -------------------------------------------------------------------------------- 1 | # German translations for noVNC package 2 | # German translation for noVNC. 3 | # Copyright (C) 2016 Various Authors 4 | # This file is distributed under the same license as the noVNC package. 5 | # Loek Janssen , 2016. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: noVNC 0.6.1\n" 10 | "Report-Msgid-Bugs-To: novnc@googlegroups.com\n" 11 | "POT-Creation-Date: 2016-11-15 08:11+0100\n" 12 | "PO-Revision-Date: 2016-11-15 07:51+0100\n" 13 | "Last-Translator: Loek Janssen \n" 14 | "Language-Team: none\n" 15 | "Language: de\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: ../app/ui.js:402 22 | msgid "Connecting..." 23 | msgstr "Verbunden..." 24 | 25 | #: ../app/ui.js:409 26 | msgid "Connected (encrypted) to " 27 | msgstr "Verbunden mit (verschlüsselt) " 28 | 29 | #: ../app/ui.js:411 30 | msgid "Connected (unencrypted) to " 31 | msgstr "Verbunden mit (unverschlüsselt) " 32 | 33 | #: ../app/ui.js:416 34 | msgid "Disconnecting..." 35 | msgstr "Verbindung trennen..." 36 | 37 | #: ../app/ui.js:421 38 | msgid "Disconnected" 39 | msgstr "Verbindung zum Server getrennt" 40 | 41 | #: ../app/ui.js:1006 ../core/rfb.js:278 42 | msgid "Must set host and port" 43 | msgstr "Richten Sie Host und Port ein" 44 | 45 | #: ../app/ui.js:1059 46 | msgid "Password is required" 47 | msgstr "Passwort ist erforderlich" 48 | 49 | #: ../app/ui.js:1272 50 | msgid "" 51 | "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen" 52 | msgstr "" 53 | "'Clipping-Modus' aktiviert, Scrollbalken in 'IE-Vollbildmodus' werden nicht " 54 | "unterstützt" 55 | 56 | #: ../core/rfb.js:556 57 | msgid "Disconnect timeout" 58 | msgstr "Timeout beim trennen" 59 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/po/nl.po: -------------------------------------------------------------------------------- 1 | # Dutch translations for noVNC package 2 | # Nederlandse vertalingen voor het pakket noVNC. 3 | # Copyright (C) 2016 Various Authors 4 | # This file is distributed under the same license as the noVNC package. 5 | # Loek Janssen , 2016. 6 | # 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: noVNC 0.6.1\n" 10 | "Report-Msgid-Bugs-To: novnc@googlegroups.com\n" 11 | "POT-Creation-Date: 2016-11-15 08:11+0100\n" 12 | "PO-Revision-Date: 2016-11-15 07:51+0100\n" 13 | "Last-Translator: Loek Janssen \n" 14 | "Language-Team: none\n" 15 | "Language: nl\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 20 | 21 | #: ../app/ui.js:402 22 | msgid "Connecting..." 23 | msgstr "Verbinden..." 24 | 25 | #: ../app/ui.js:409 26 | msgid "Connected (encrypted) to " 27 | msgstr "Verbonden (versleuteld) met " 28 | 29 | #: ../app/ui.js:411 30 | msgid "Connected (unencrypted) to " 31 | msgstr "Verbonden (onversleuteld) met " 32 | 33 | #: ../app/ui.js:416 34 | msgid "Disconnecting..." 35 | msgstr "Verbinding verbreken..." 36 | 37 | #: ../app/ui.js:421 38 | msgid "Disconnected" 39 | msgstr "Verbinding verbroken" 40 | 41 | #: ../app/ui.js:1006 ../core/rfb.js:278 42 | msgid "Must set host and port" 43 | msgstr "Host en poort moeten worden ingesteld" 44 | 45 | #: ../app/ui.js:1059 46 | msgid "Password is required" 47 | msgstr "Wachtwoord is vereist" 48 | 49 | #: ../app/ui.js:1272 50 | msgid "" 51 | "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen" 52 | msgstr "" 53 | "''Clipping mode' ingeschakeld, omdat schuifbalken in volledige-scherm-modus " 54 | "in IE niet worden ondersteund" 55 | 56 | #: ../core/rfb.js:556 57 | msgid "Disconnect timeout" 58 | msgstr "Timeout tijdens verbreken van verbinding" 59 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/Windows Service Readme.txt: -------------------------------------------------------------------------------- 1 | ----------------------------------- 2 | Windows noVNC Websockify Service 3 | ----------------------------------- 4 | 5 | The "noVNC Websocket Service.exe" file is a windows service wrapper created with Visual Studio 2010 to create a windows service to start stop the noVNC Websocket Server. All files used to create the wrapper can be found in 'noVNC Websocket Service Project' folder. 6 | 7 | To download the precompiled executables please grab the zip in the downloads section of websockify project: 8 | https://github.com/kanaka/websockify 9 | 10 | --------------------------- 11 | Installation 12 | --------------------------- 13 | 14 | 1. This service requires websockify.exe be in the same directory. Instructions on how to compile websockify python script as a windows executable can be found here: 15 | https://github.com/kanaka/websockify/wiki/Compiling-Websockify-as-Windows-Executable 16 | 17 | 2.To add this service to a Windows PC you need to run the commandline as administrator and then run this line: 18 | 19 | sc create "noVNC Websocket Server" binPath= "PATH TO noVNC eg C:\noVNC\utils\Windows\Websocket Service.exe" DisplayName= "noVNC Websocket Server" 20 | 21 | 3 .Once this is run you will be able to access the service via Control Panel > Admin Tools > Services. In here you can specify whether you want the service to run automatically and start at stop the service. 22 | 23 | --------------------------- 24 | Configuration 25 | --------------------------- 26 | The file noVNCConfig.ini must be in the same directory as "noVNC Websocket Service.exe". 27 | 28 | This file contains a single line which is the websockify.exe statup arguements. An example is: 29 | 192.168.0.1:5901 192.168.0.1:5900 30 | 31 | All websockify supported arguements will work if added here. 32 | 33 | --------------------------- 34 | Deletion 35 | --------------------------- 36 | 37 | You can delete the service at any time by running the commandline as admin and using this command: 38 | sc delete "noVNC Websocket Server". 39 | 40 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "noVNC", 3 | "version": "0.6.1", 4 | "description": "An HTML5 VNC client", 5 | "main": "karma.conf.js", 6 | "directories": { 7 | "doc": "docs", 8 | "test": "tests" 9 | }, 10 | "scripts": { 11 | "test": "PATH=$PATH:node_modules/karma/bin karma start karma.conf.js", 12 | "prepublish": "node ./utils/use_require.js --as-require", 13 | "build-es6": "node ./utils/use_require.js" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "https://github.com/kanaka/noVNC.git" 18 | }, 19 | "author": "Joel Martin (https://github.com/kanaka)", 20 | "contributors": [ 21 | "Solly Ross (https://github.com/directxman12)", 22 | "Peter Åstrand (https://github.com/astrand)", 23 | "Samuel Mannehed (https://github.com/samhed)" 24 | ], 25 | "license": "MPL 2.0", 26 | "bugs": { 27 | "url": "https://github.com/kanaka/noVNC/issues" 28 | }, 29 | "homepage": "https://github.com/kanaka/noVNC", 30 | "devDependencies": { 31 | "ansi": "^0.3.1", 32 | "babel-plugin-add-module-exports": "^0.2.1", 33 | "babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", 34 | "babelify": "^7.3.0", 35 | "browserify": "^13.1.0", 36 | "casperjs": "^1.1.3", 37 | "chai": "^3.5.0", 38 | "commander": "^2.9.0", 39 | "fs-extra": "^1.0.0", 40 | "jsdom": "*", 41 | "karma": "^1.3.0", 42 | "karma-chai": "^0.1.0", 43 | "karma-mocha": "^1.3.0", 44 | "karma-mocha-reporter": "^2.2.0", 45 | "karma-phantomjs-launcher": "^1.0.2", 46 | "karma-sauce-launcher": "^1.0.0", 47 | "karma-sinon": "^1.0.5", 48 | "karma-sinon-chai-latest": "^0.1.0", 49 | "mocha": "^3.1.2", 50 | "node-getopt": "*", 51 | "open": "^0.0.5", 52 | "phantomjs-prebuilt": "^2.1.13", 53 | "po2json": "*", 54 | "sinon": "^1.17.6", 55 | "sinon-chai": "^2.8.0", 56 | "spooky": "^0.2.5", 57 | "temp": "^0.8.3", 58 | "through2": "^2.0.1" 59 | }, 60 | "dependencies": { 61 | "pako": "^1.0.3" 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | ENV DEBIAN_FRONTEND noninteractive 4 | 5 | RUN sed -i 's#http://archive.ubuntu.com/#http://ubuntu.mirrors.tds.net/ubuntu/#' /etc/apt/sources.list 6 | 7 | # built-in packages 8 | RUN apt-get update 9 | RUN apt-get -o Dpkg::Options::='--force-confold' --force-yes -fuy dist-upgrade 10 | RUN apt-get install -y python-apt 11 | RUN apt-get install -y --no-install-recommends software-properties-common curl 12 | RUN apt-get update 13 | RUN apt-get install -y --no-install-recommends --allow-unauthenticated supervisor openssh-server pwgen sudo vim-common net-tools \ 14 | x11vnc xserver-xorg-video-dummy ttf-ubuntu-font-family firefox \ 15 | nginx python-pip python-dev build-essential mesa-utils libgl1-mesa-dri \ 16 | dbus-x11 x11-utils wget tmux htop git dconf-editor 17 | RUN apt-get install -y --allow-unauthenticated ubuntu-mate-desktop ubuntu-mate-core mate-backgrounds ubuntu-mate-wallpapers 18 | 19 | # Create my user 20 | RUN useradd -ms /bin/bash mate 21 | RUN adduser mate sudo 22 | RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers 23 | 24 | # Install Chrome 25 | RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 26 | RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install 27 | 28 | # Install VSCode 29 | RUN wget -q "https://go.microsoft.com/fwlink/?LinkID=760868" -O code.deb 30 | RUN dpkg -i code.deb 31 | 32 | # Install Slack (Update: SlackApp Crashes, disabling) 33 | #RUN wget "https://downloads.slack-edge.com/linux_releases/slack-desktop-3.4.2-amd64.deb" 34 | #RUN dpkg -i slack-desktop-3.4.2-amd64.deb; apt-get -fy install 35 | 36 | RUN apt-get -y update && apt-get -y dist-upgrade 37 | RUN apt-get autoclean 38 | RUN apt-get autoremove 39 | 40 | # tini for subreap 41 | ENV TINI_VERSION v0.9.0 42 | ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/tini 43 | RUN chmod +x /bin/tini 44 | 45 | ADD image / 46 | RUN pip install setuptools wheel && pip install -r /usr/lib/web/requirements.txt 47 | 48 | EXPOSE 80 49 | WORKDIR /root 50 | 51 | ENTRYPOINT ["/startup.sh"] 52 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/echo_client.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import sys 5 | import optparse 6 | import select 7 | 8 | sys.path.insert(0,os.path.join(os.path.dirname(__file__), "..")) 9 | from websockify.websocket import WebSocket, \ 10 | WebSocketWantReadError, WebSocketWantWriteError 11 | 12 | parser = optparse.OptionParser(usage="%prog URL") 13 | (opts, args) = parser.parse_args() 14 | 15 | try: 16 | if len(args) != 1: raise 17 | URL = args[0] 18 | except: 19 | parser.error("Invalid arguments") 20 | 21 | sock = WebSocket() 22 | print("Connecting to %s..." % URL) 23 | sock.connect(URL) 24 | print("Connected.") 25 | 26 | def send(msg): 27 | while True: 28 | try: 29 | sock.sendmsg(msg) 30 | break 31 | except WebSocketWantReadError: 32 | msg = '' 33 | ins, outs, excepts = select.select([sock], [], []) 34 | if excepts: raise Exception("Socket exception") 35 | except WebSocketWantWriteError: 36 | msg = '' 37 | ins, outs, excepts = select.select([], [sock], []) 38 | if excepts: raise Exception("Socket exception") 39 | 40 | def read(): 41 | while True: 42 | try: 43 | return sock.recvmsg() 44 | except WebSocketWantReadError: 45 | ins, outs, excepts = select.select([sock], [], []) 46 | if excepts: raise Exception("Socket exception") 47 | except WebSocketWantWriteError: 48 | ins, outs, excepts = select.select([], [sock], []) 49 | if excepts: raise Exception("Socket exception") 50 | 51 | counter = 1 52 | while True: 53 | msg = "Message #%d" % counter 54 | counter += 1 55 | send(msg) 56 | print("Sent message: %r" % msg) 57 | 58 | while True: 59 | ins, outs, excepts = select.select([sock], [], [], 1.0) 60 | if excepts: raise Exception("Socket exception") 61 | 62 | if ins == []: 63 | break 64 | 65 | while True: 66 | msg = read() 67 | print("Received message: %r" % msg) 68 | 69 | if not sock.pending(): 70 | break 71 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/tests/simple.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Websock Simple Client 5 | 6 | 7 | 8 | 9 | 10 | WebSocket/websockify URI:   11 | 13 |

14 |   15 |   17 |

18 | Log:
19 | 20 | 21 | 22 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/websocket.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define BUFSIZE 65536 4 | #define DBUFSIZE (BUFSIZE * 3) / 4 - 20 5 | 6 | #define SERVER_HANDSHAKE_HIXIE "HTTP/1.1 101 Web Socket Protocol Handshake\r\n\ 7 | Upgrade: WebSocket\r\n\ 8 | Connection: Upgrade\r\n\ 9 | %sWebSocket-Origin: %s\r\n\ 10 | %sWebSocket-Location: %s://%s%s\r\n\ 11 | %sWebSocket-Protocol: %s\r\n\ 12 | \r\n%s" 13 | 14 | #define SERVER_HANDSHAKE_HYBI "HTTP/1.1 101 Switching Protocols\r\n\ 15 | Upgrade: websocket\r\n\ 16 | Connection: Upgrade\r\n\ 17 | Sec-WebSocket-Accept: %s\r\n\ 18 | Sec-WebSocket-Protocol: %s\r\n\ 19 | \r\n" 20 | 21 | #define HYBI_GUID "258EAFA5-E914-47DA-95CA-C5AB0DC85B11" 22 | 23 | #define HYBI10_ACCEPTHDRLEN 29 24 | 25 | #define HIXIE_MD5_DIGEST_LENGTH 16 26 | 27 | #define POLICY_RESPONSE "\n" 28 | 29 | typedef struct { 30 | char path[1024+1]; 31 | char host[1024+1]; 32 | char origin[1024+1]; 33 | char version[1024+1]; 34 | char connection[1024+1]; 35 | char protocols[1024+1]; 36 | char key1[1024+1]; 37 | char key2[1024+1]; 38 | char key3[8+1]; 39 | } headers_t; 40 | 41 | typedef struct { 42 | int sockfd; 43 | SSL_CTX *ssl_ctx; 44 | SSL *ssl; 45 | int hixie; 46 | int hybi; 47 | headers_t *headers; 48 | char *cin_buf; 49 | char *cout_buf; 50 | char *tin_buf; 51 | char *tout_buf; 52 | } ws_ctx_t; 53 | 54 | typedef struct { 55 | int verbose; 56 | char listen_host[256]; 57 | int listen_port; 58 | void (*handler)(ws_ctx_t*); 59 | int handler_id; 60 | char *cert; 61 | char *key; 62 | int ssl_only; 63 | int daemon; 64 | int run_once; 65 | } settings_t; 66 | 67 | 68 | ssize_t ws_recv(ws_ctx_t *ctx, void *buf, size_t len); 69 | 70 | ssize_t ws_send(ws_ctx_t *ctx, const void *buf, size_t len); 71 | 72 | /* base64.c declarations */ 73 | //int b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize); 74 | //int b64_pton(char const *src, u_char *target, size_t targsize); 75 | 76 | #define gen_handler_msg(stream, ...) \ 77 | if (! settings.daemon) { \ 78 | fprintf(stream, " %d: ", settings.handler_id); \ 79 | fprintf(stream, __VA_ARGS__); \ 80 | } 81 | 82 | #define handler_msg(...) gen_handler_msg(stdout, __VA_ARGS__); 83 | #define handler_emsg(...) gen_handler_msg(stderr, __VA_ARGS__); 84 | 85 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/links: -------------------------------------------------------------------------------- 1 | New tight PNG protocol: 2 | http://wiki.qemu.org/VNC_Tight_PNG 3 | http://xf.iksaif.net/blog/index.php?post/2010/06/14/QEMU:-Tight-PNG-and-some-profiling 4 | 5 | RFB protocol and extensions: 6 | http://tigervnc.org/cgi-bin/rfbproto 7 | 8 | Canvas Browser Compatibility: 9 | http://philip.html5.org/tests/canvas/suite/tests/results.html 10 | 11 | WebSockets API standard: 12 | http://www.whatwg.org/specs/web-apps/current-work/complete.html#websocket 13 | http://dev.w3.org/html5/websockets/ 14 | http://www.ietf.org/id/draft-ietf-hybi-thewebsocketprotocol-00.txt 15 | 16 | Browser Keyboard Events detailed: 17 | http://unixpapa.com/js/key.html 18 | 19 | ActionScript (Flash) WebSocket implementation: 20 | http://github.com/gimite/web-socket-js 21 | 22 | ActionScript (Flash) crypto/TLS library: 23 | http://code.google.com/p/as3crypto 24 | http://github.com/lyokato/as3crypto_patched 25 | 26 | TLS Protocol: 27 | http://en.wikipedia.org/wiki/Transport_Layer_Security 28 | 29 | Generate self-signed certificate: 30 | http://docs.python.org/dev/library/ssl.html#certificates 31 | 32 | Cursor appearance/style (for Cursor pseudo-encoding): 33 | http://en.wikipedia.org/wiki/ICO_(file_format) 34 | http://www.daubnet.com/en/file-format-cur 35 | https://developer.mozilla.org/en/Using_URL_values_for_the_cursor_property 36 | http://www.fileformat.info/format/bmp/egff.htm 37 | 38 | Icon/Cursor file format: 39 | http://msdn.microsoft.com/en-us/library/ms997538 40 | http://msdn.microsoft.com/en-us/library/aa921550.aspx 41 | http://msdn.microsoft.com/en-us/library/aa930622.aspx 42 | 43 | 44 | RDP Protocol specification: 45 | http://msdn.microsoft.com/en-us/library/cc240445(v=PROT.10).aspx 46 | 47 | 48 | Related projects: 49 | 50 | guacamole: http://guacamole.sourceforge.net/ 51 | 52 | - Web client, but Java servlet does pre-processing 53 | 54 | jsvnc: http://code.google.com/p/jsvnc/ 55 | 56 | - No releases 57 | 58 | webvnc: http://code.google.com/p/webvnc/ 59 | 60 | - Jetty web server gateway, no updates since April 2008. 61 | 62 | RealVNC Java applet: http://www.realvnc.com/support/javavncviewer.html 63 | 64 | - Java applet 65 | 66 | Flashlight-VNC: http://www.wizhelp.com/flashlight-vnc/ 67 | 68 | - Adobe Flash implementation 69 | 70 | FVNC: http://osflash.org/fvnc 71 | 72 | - Adbove Flash implementation 73 | 74 | CanVNC: http://canvnc.sourceforge.net/ 75 | 76 | - HTML client with REST to VNC python proxy. Mostly vapor. 77 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/ProjectInstaller.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace MELT_Command_Websocket 2 | { 3 | partial class ProjectInstaller 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); 32 | this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller(); 33 | // 34 | // serviceProcessInstaller1 35 | // 36 | this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.NetworkService; 37 | this.serviceProcessInstaller1.Installers.AddRange(new System.Configuration.Install.Installer[] { 38 | this.serviceInstaller1}); 39 | this.serviceProcessInstaller1.Password = null; 40 | this.serviceProcessInstaller1.Username = null; 41 | // 42 | // serviceInstaller1 43 | // 44 | this.serviceInstaller1.Description = "noVNC Websocket Service"; 45 | this.serviceInstaller1.DisplayName = "noVNC Websocket Service"; 46 | this.serviceInstaller1.ServiceName = "noVNC Websocket Service"; 47 | this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic; 48 | // 49 | // ProjectInstaller 50 | // 51 | this.Installers.AddRange(new System.Configuration.Install.Installer[] { 52 | this.serviceProcessInstaller1}); 53 | 54 | } 55 | 56 | #endregion 57 | 58 | private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; 59 | private System.ServiceProcess.ServiceInstaller serviceInstaller1; 60 | } 61 | } -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/websockify/token_plugins.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | class BasePlugin(object): 4 | def __init__(self, src): 5 | self.source = src 6 | 7 | def lookup(self, token): 8 | return None 9 | 10 | 11 | class ReadOnlyTokenFile(BasePlugin): 12 | # source is a token file with lines like 13 | # token: host:port 14 | # or a directory of such files 15 | def __init__(self, *args, **kwargs): 16 | super(ReadOnlyTokenFile, self).__init__(*args, **kwargs) 17 | self._targets = None 18 | 19 | def _load_targets(self): 20 | if os.path.isdir(self.source): 21 | cfg_files = [os.path.join(self.source, f) for 22 | f in os.listdir(self.source)] 23 | else: 24 | cfg_files = [self.source] 25 | 26 | self._targets = {} 27 | for f in cfg_files: 28 | for line in [l.strip() for l in open(f).readlines()]: 29 | if line and not line.startswith('#'): 30 | tok, target = line.split(': ') 31 | self._targets[tok] = target.strip().rsplit(':', 1) 32 | 33 | def lookup(self, token): 34 | if self._targets is None: 35 | self._load_targets() 36 | 37 | if token in self._targets: 38 | return self._targets[token] 39 | else: 40 | return None 41 | 42 | 43 | # the above one is probably more efficient, but this one is 44 | # more backwards compatible (although in most cases 45 | # ReadOnlyTokenFile should suffice) 46 | class TokenFile(ReadOnlyTokenFile): 47 | # source is a token file with lines like 48 | # token: host:port 49 | # or a directory of such files 50 | def lookup(self, token): 51 | self._load_targets() 52 | 53 | return super(TokenFile, self).lookup(token) 54 | 55 | 56 | class BaseTokenAPI(BasePlugin): 57 | # source is a url with a '%s' in it where the token 58 | # should go 59 | 60 | # we import things on demand so that other plugins 61 | # in this file can be used w/o unecessary dependencies 62 | 63 | def process_result(self, resp): 64 | return resp.text.split(':') 65 | 66 | def lookup(self, token): 67 | import requests 68 | 69 | resp = requests.get(self.source % token) 70 | 71 | if resp.ok: 72 | return self.process_result(resp) 73 | else: 74 | return None 75 | 76 | 77 | class JSONTokenApi(BaseTokenAPI): 78 | # source is a url with a '%s' in it where the token 79 | # should go 80 | 81 | def process_result(self, resp): 82 | resp_json = resp.json() 83 | return (resp_json['host'], resp_json['port']) 84 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/wstelnet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Telnet client using WebSockets 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Host:   23 | Port:   24 | Encrypt:   25 |   27 | 28 |

29 | 30 |

31 | 
32 |         
70 | 
71 |     
72 | 
73 | 
74 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/tests/echo.py:
--------------------------------------------------------------------------------
 1 | #!/usr/bin/env python
 2 | 
 3 | '''
 4 | A WebSocket server that echos back whatever it receives from the client.
 5 | Copyright 2010 Joel Martin
 6 | Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
 7 | 
 8 | You can make a cert/key with openssl using:
 9 | openssl req -new -x509 -days 365 -nodes -out self.pem -keyout self.pem
10 | as taken from http://docs.python.org/dev/library/ssl.html#certificates
11 | '''
12 | 
13 | import os, sys, select, optparse, logging
14 | sys.path.insert(0,os.path.join(os.path.dirname(__file__), ".."))
15 | from websockify.websockifyserver import WebSockifyServer, WebSockifyRequestHandler
16 | 
17 | class WebSocketEcho(WebSockifyRequestHandler):
18 |     """
19 |     WebSockets server that echos back whatever is received from the
20 |     client.  """
21 |     buffer_size = 8096
22 | 
23 |     def new_websocket_client(self):
24 |         """
25 |         Echo back whatever is received.
26 |         """
27 | 
28 |         cqueue = []
29 |         c_pend = 0
30 |         cpartial = ""
31 |         rlist = [self.request]
32 | 
33 |         while True:
34 |             wlist = []
35 | 
36 |             if cqueue or c_pend: wlist.append(self.request)
37 |             ins, outs, excepts = select.select(rlist, wlist, [], 1)
38 |             if excepts: raise Exception("Socket exception")
39 | 
40 |             if self.request in outs:
41 |                 # Send queued target data to the client
42 |                 c_pend = self.send_frames(cqueue)
43 |                 cqueue = []
44 | 
45 |             if self.request in ins:
46 |                 # Receive client data, decode it, and send it back
47 |                 frames, closed = self.recv_frames()
48 |                 cqueue.extend(frames)
49 | 
50 |                 if closed:
51 |                     break
52 | 
53 | if __name__ == '__main__':
54 |     parser = optparse.OptionParser(usage="%prog [options] listen_port")
55 |     parser.add_option("--verbose", "-v", action="store_true",
56 |             help="verbose messages and per frame traffic")
57 |     parser.add_option("--cert", default="self.pem",
58 |             help="SSL certificate file")
59 |     parser.add_option("--key", default=None,
60 |             help="SSL key file (if separate from cert)")
61 |     parser.add_option("--ssl-only", action="store_true",
62 |             help="disallow non-encrypted connections")
63 |     (opts, args) = parser.parse_args()
64 | 
65 |     try:
66 |         if len(args) != 1: raise
67 |         opts.listen_port = int(args[0])
68 |     except:
69 |         parser.error("Invalid arguments")
70 | 
71 |     logging.basicConfig(level=logging.INFO)
72 | 
73 |     opts.web = "."
74 |     server = WebSockifyServer(WebSocketEcho, **opts.__dict__)
75 |     server.start_server()
76 | 
77 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/CONTRIBUTING.md:
--------------------------------------------------------------------------------
 1 | How to contribute to noVNC
 2 | ==========================
 3 | 
 4 | We accept code via pull requests on GitHub.  There are several guidelines that
 5 | we expect contributors submitting code requests to follow.  If you have issues
 6 | following any of these guidelines, feel free to drop us a line by leaving a
 7 | comment in the code request or sending us an email.
 8 | 
 9 | Contributing Guidelines
10 | -----------------------
11 | 
12 | * While we don't have an official coding style guide, please try to follow
13 |   the general coding style of the existing code.
14 | ** Use four spaces instead of tabs 
15 | ** prefix private variables and functions with an `_`
16 | 
17 | * Please try to include unit tests for your code.  For instance, if you
18 |   introduce a new encoding, add a test to `tests/test.rfb.js` under the
19 |   "Encoding Handlers" section (basically, input a small pattern in your
20 |   encoding and make sure the pattern gets displayed correctly).  If you
21 |   fix a bug, try to add a unit test that would have caught that bug
22 |   (if possible -- some bugs, especially visual ones, are hard to test for).
23 | 
24 | * Squash your commits down in to a clean commit history.  For instance, there
25 |   should not be "cleanup" commits where you fix issues in previous commits in
26 |   the same pull request.  Before you go to commit, use `git rebase -i` to
27 |   squash these changes into the relevant commits.  For instance, a good commit
28 |   history might look like "Added support for FOO encoding, Added support for
29 |   BAR message, Placed Button in UI to Trigger BAR" (where each comma denotes
30 |   a separate commit).
31 | 
32 | * Add both a title and description to your commit, if possible.  Place more
33 |   detail on what you did in the description.
34 | 
35 | Running the unit tests
36 | ----------------------
37 | 
38 | There are two ways to run the unit tests.  For both ways, you should first run
39 | `npm install` (not as root).
40 | 
41 | The first way to run the tests is to run `npm test`.  This will run all the
42 | tests in the headless PhantomJS browser (which uses WebKit).
43 | 
44 | The second way to run the tests is using the `tests/run_from_console.js` file.
45 | This way is a bit more flexible, and can provide more information about what
46 | went wrong.  To run all the tests, simply run `tests/run_from_console.js`.
47 | To run a specific test file, you can use the `-t path/to/test/file.js` option.
48 | If you wish to simply generate the HTML for the test, use the `-g` option, and
49 | the path to the temporary HTML file will be written to standard out.  To open
50 | this file in your default browser automatically, pass the `-o` option as well.
51 | More information can be found by passing the `--help` or `-h` option.
52 | 
53 | 
54 | Thanks, and happy coding!
55 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/handle.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
54 |     
57 |   
58 |   
60 |     
61 |       
63 |         image/svg+xml
64 |         
66 |         
67 |       
68 |     
69 |   
70 |   
75 |     
81 |   
82 | 
83 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/LICENSE.txt:
--------------------------------------------------------------------------------
 1 | noVNC is Copyright (C) 2011 Joel Martin 
 2 | 
 3 | The noVNC core library files are licensed under the MPL 2.0 (Mozilla
 4 | Public License 2.0). The noVNC core library is composed of the
 5 | Javascript code necessary for full noVNC operation. This includes (but
 6 | is not limited to):
 7 | 
 8 |     core/base64.js
 9 |     core/des.js
10 |     core/display.js
11 |     core/input/devices.js
12 |     core/input/keysym.js
13 |     core/logo.js
14 |     core/playback.js
15 |     core/rfb.js
16 |     app/ui.js
17 |     core/util.js
18 |     core/websock.js
19 |     app/webutil.js
20 |     core/input/xtscancodes.js
21 | 
22 | The HTML, CSS, font and images files that included with the noVNC
23 | source distibution (or repository) are not considered part of the
24 | noVNC core library and are licensed under more permissive licenses.
25 | The intent is to allow easy integration of noVNC into existing web
26 | sites and web applications.
27 | 
28 | The HTML, CSS, font and image files are licensed as follows:
29 | 
30 |     *.html                     : 2-Clause BSD license
31 | 
32 |     app/styles/*.css           : 2-Clause BSD license
33 | 
34 |     app/styles/Orbitron*       : SIL Open Font License 1.1
35 |                                  (Copyright 2009 Matt McInerney)
36 | 
37 |     app/images/                : Creative Commons Attribution-ShareAlike
38 |                                  http://creativecommons.org/licenses/by-sa/3.0/
39 | 
40 | Some portions of noVNC are copyright to their individual authors.
41 | Please refer to the individual source files and/or to the noVNC commit
42 | history: https://github.com/kanaka/noVNC/commits/master
43 | 
44 | The are several files and projects that have been incorporated into
45 | the noVNC core library. Here is a list of those files and the original
46 | licenses (all MPL 2.0 compatible):
47 | 
48 |     core/base64.js          : MPL 2.0
49 | 
50 |     core/des.js             : Various BSD style licenses
51 | 
52 |     utils/inflator.mod.js
53 |     include/inflator.js     : MIT (for pako)
54 | 
55 | Any other files not mentioned above are typically marked with
56 | a copyright/license header at the top of the file. The default noVNC
57 | license is MPL-2.0.
58 | 
59 | The following license texts are included:
60 | 
61 |     docs/LICENSE.MPL-2.0
62 |     docs/LICENSE.LGPL-3 and
63 |     docs/LICENSE.GPL-3
64 |     docs/LICENSE.OFL-1.1
65 |     docs/LICENSE.BSD-3-Clause (New BSD)
66 |     docs/LICENSE.BSD-2-Clause (Simplified BSD / FreeBSD)
67 |     docs/LICENSE.zlib
68 |     docs/LICENSE.Apache-2.0
69 |     docs/LICENSE.pako
70 | 
71 | Or alternatively the license texts may be found here:
72 | 
73 |     http://www.mozilla.org/MPL/2.0/
74 |     http://www.gnu.org/licenses/lgpl.html and
75 |     http://www.gnu.org/licenses/gpl.html
76 |     http://scripts.sil.org/OFL
77 |     http://en.wikipedia.org/wiki/BSD_licenses
78 |     http://www.gzip.org/zlib/zlib_license.html
79 |     http://www.apache.org/licenses/LICENSE-2.0.html
80 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/tests/fake.websocket.js:
--------------------------------------------------------------------------------
 1 | var FakeWebSocket;
 2 | 
 3 | (function () {
 4 |     // PhantomJS can't create Event objects directly, so we need to use this
 5 |     function make_event(name, props) {
 6 |         var evt = document.createEvent('Event');
 7 |         evt.initEvent(name, true, true);
 8 |         if (props) {
 9 |             for (var prop in props) {
10 |                 evt[prop] = props[prop];
11 |             }
12 |         }
13 |         return evt;
14 |     }
15 | 
16 |     FakeWebSocket = function (uri, protocols) {
17 |         this.url = uri;
18 |         this.binaryType = "arraybuffer";
19 |         this.extensions = "";
20 | 
21 |         if (!protocols || typeof protocols === 'string') {
22 |             this.protocol = protocols;
23 |         } else {
24 |             this.protocol = protocols[0];
25 |         }
26 | 
27 |         this._send_queue = new Uint8Array(20000);
28 | 
29 |         this.readyState = FakeWebSocket.CONNECTING;
30 |         this.bufferedAmount = 0;
31 | 
32 |         this.__is_fake = true;
33 |     };
34 | 
35 |     FakeWebSocket.prototype = {
36 |         close: function (code, reason) {
37 |             this.readyState = FakeWebSocket.CLOSED;
38 |             if (this.onclose) {
39 |                 this.onclose(make_event("close", { 'code': code, 'reason': reason, 'wasClean': true }));
40 |             }
41 |         },
42 | 
43 |         send: function (data) {
44 |             if (this.protocol == 'base64') {
45 |                 data = Base64.decode(data);
46 |             } else {
47 |                 data = new Uint8Array(data);
48 |             }
49 |             this._send_queue.set(data, this.bufferedAmount);
50 |             this.bufferedAmount += data.length;
51 |         },
52 | 
53 |         _get_sent_data: function () {
54 |             var res = new Uint8Array(this._send_queue.buffer, 0, this.bufferedAmount);
55 |             this.bufferedAmount = 0;
56 |             return res;
57 |         },
58 | 
59 |         _open: function (data) {
60 |             this.readyState = FakeWebSocket.OPEN;
61 |             if (this.onopen) {
62 |                 this.onopen(make_event('open'));
63 |             }
64 |         },
65 | 
66 |         _receive_data: function (data) {
67 |             this.onmessage(make_event("message", { 'data': data }));
68 |         }
69 |     };
70 | 
71 |     FakeWebSocket.OPEN = WebSocket.OPEN;
72 |     FakeWebSocket.CONNECTING = WebSocket.CONNECTING;
73 |     FakeWebSocket.CLOSING = WebSocket.CLOSING;
74 |     FakeWebSocket.CLOSED = WebSocket.CLOSED;
75 | 
76 |     FakeWebSocket.__is_fake = true;
77 | 
78 |     FakeWebSocket.replace = function () {
79 |         if (!WebSocket.__is_fake) {
80 |             var real_version = WebSocket;
81 |             WebSocket = FakeWebSocket;
82 |             FakeWebSocket.__real_version = real_version;
83 |         }
84 |     };
85 | 
86 |     FakeWebSocket.restore = function () {
87 |         if (WebSocket.__is_fake) {
88 |             WebSocket = WebSocket.__real_version;
89 |         }
90 |     };
91 | })();
92 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/locale/sv.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Translations for sv
 3 |  *
 4 |  * This file was autotomatically generated from sv.po
 5 |  * DO NOT EDIT!
 6 |  */
 7 | 
 8 | Language = {
 9 |     "Connecting...": "Ansluter...",
10 |     "Connected (encrypted) to ": "Ansluten (krypterat) till ",
11 |     "Connected (unencrypted) to ": "Ansluten (okrypterat) till ",
12 |     "Disconnecting...": "Kopplar ner...",
13 |     "Disconnected": "Frånkopplad",
14 |     "Must set host and port": "Du måste specifiera en host och port",
15 |     "Password is required": "Lösenord krävs",
16 |     "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen": "Tvingar 'Clipping mode' eftersom skrollning inte stödjs av IE i fullskärm",
17 |     "Disconnect timeout": "Det tog för lång tid att koppla ner",
18 |     "noVNC encountered an error:": "noVNC stötte på ett problem:",
19 |     "Hide/Show the control bar": "Göm/Visa kontrollbaren",
20 |     "Move/Drag Viewport": "Flytta/Dra Vyn",
21 |     "viewport drag": "dra vy",
22 |     "Active Mouse Button": "Aktiv musknapp",
23 |     "No mousebutton": "Ingen musknapp",
24 |     "Left mousebutton": "Vänster musknapp",
25 |     "Middle mousebutton": "Mitten-musknapp",
26 |     "Right mousebutton": "Höger musknapp",
27 |     "Keyboard": "Tangentbord",
28 |     "Show Keyboard": "Visa Tangentbord",
29 |     "Extra keys": "Extraknappar",
30 |     "Show Extra Keys": "Visa Extraknappar",
31 |     "Ctrl": "Ctrl",
32 |     "Toggle Ctrl": "Växla Ctrl",
33 |     "Alt": "Alt",
34 |     "Toggle Alt": "Växla Alt",
35 |     "Send Tab": "Skicka Tab",
36 |     "Tab": "Tab",
37 |     "Esc": "Esc",
38 |     "Send Escape": "Skicka Escape",
39 |     "Ctrl+Alt+Del": "Ctrl+Alt+Del",
40 |     "Send Ctrl-Alt-Del": "Skicka Ctrl-Alt-Del",
41 |     "Shutdown/Reboot": "Stäng av/Boota om",
42 |     "Shutdown/Reboot...": "Stäng av/Boota om...",
43 |     "Power": "Ström",
44 |     "Shutdown": "Stäng av",
45 |     "Reboot": "Boota om",
46 |     "Reset": "Återställ",
47 |     "Clipboard": "Urklipp",
48 |     "Clear": "Rensa",
49 |     "Fullscreen": "Fullskärm",
50 |     "Settings": "Inställningar",
51 |     "Encrypt": "Kryptera",
52 |     "True Color": "Fullfärg",
53 |     "Local Cursor": "Lokal Muspekare",
54 |     "Clip to Window": "Begränsa till Fönster",
55 |     "Shared Mode": "Delat Läge",
56 |     "View Only": "Endast Visning",
57 |     "Path:": "Sökväg:",
58 |     "Scaling Mode:": "Skalningsläge:",
59 |     "None": "Ingen",
60 |     "Local Scaling": "Lokal Skalning",
61 |     "Local Downscaling": "Lokal Nedskalning",
62 |     "Remote Resizing": "Ändra Storlek",
63 |     "Repeater ID:": "Repeater-ID:",
64 |     "Style:": "Stil:",
65 |     "default": "standard",
66 |     "Logging:": "Loggning:",
67 |     "Apply": "Verkställ",
68 |     "Connect": "Anslut",
69 |     "Disconnect": "Koppla från",
70 |     "Connection": "Uppkoppling",
71 |     "Host:": "Värd:",
72 |     "Port:": "Port:",
73 |     "Password:": "Lösenord:",
74 |     "Token:": "Token:",
75 |     "Send Password": "Skicka Lösenord",
76 |     "Canvas not supported.": "Canvas stöds ej",
77 | };
78 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/tests/run_from_console.zombie.js:
--------------------------------------------------------------------------------
 1 | var Browser = require('zombie');
 2 | var path = require('path');
 3 | var EventEmitter = require('events').EventEmitter;
 4 | var Q = require('q');
 5 | 
 6 | var provide_emitter = function(file_paths) {
 7 |   var emitter = new EventEmitter();
 8 | 
 9 |   file_paths.reduce(function(prom, file_path, path_ind) {
10 |     return prom.then(function(browser) {
11 |       browser.visit('file://'+file_path, function() {
12 |         if (browser.error) throw new Error(browser.errors);
13 | 
14 |         var res_json = {};
15 |         res_json.file_ind = path_ind;
16 | 
17 |         res_json.num_tests = browser.querySelectorAll('li.test').length;
18 |         res_json.num_fails = browser.querySelectorAll('li.test.fail').length;
19 |         res_json.num_passes = browser.querySelectorAll('li.test.pass').length;
20 |         res_json.num_slow = browser.querySelectorAll('li.test.pass:not(.fast)').length;
21 |         res_json.num_skipped = browser.querySelectorAll('li.test.pending').length;
22 |         res_json.duration = browser.text('li.duration em');
23 | 
24 |         var traverse_node = function(elem) {
25 |           var classList = elem.className.split(' ');
26 |           var res;
27 |           if (classList.indexOf('suite') > -1) {
28 |             res = {
29 |               type: 'suite',
30 |               name: elem.querySelector('h1').textContent,
31 |               has_subfailures: elem.querySelectorAll('li.test.fail').length > 0
32 |             };
33 | 
34 |             var child_elems = elem.querySelector('ul').children;
35 |             res.children = Array.prototype.map.call(child_elems, traverse_node);
36 |             return res;
37 |           }
38 |           else {
39 |             var h2_content = elem.querySelector('h2').childNodes;
40 |             res = {
41 |               type: 'test',
42 |               text: h2_content[0].textContent
43 |             };
44 | 
45 |             if (classList.indexOf('pass') > -1) {
46 |               res.pass = true;
47 |               if (classList.indexOf('pending') > -1) {
48 |                 res.slow = false;
49 |                 res.skipped = true;
50 |               }
51 |               else {
52 |                 res.slow = classList.indexOf('fast') < 0;
53 |                 res.skipped = false;
54 |                 res.duration = h2_content[1].textContent;
55 |               }
56 |             }
57 |             else {
58 |               res.error = elem.querySelector('pre.error').textContent;
59 |             }
60 | 
61 |             return res;
62 |           }
63 |         };
64 | 
65 |         var top_suites = browser.querySelectorAll('#mocha-report > li.suite');
66 |         res_json.suites = Array.prototype.map.call(top_suites, traverse_node);
67 |         res_json.replay = browser.querySelector('a.replay').textContent;
68 | 
69 |         emitter.emit('test_ready', res_json);
70 |       });
71 | 
72 |       return new Browser();
73 |     });
74 |   }, Q(new Browser()));
75 | 
76 |   return emitter;
77 | };
78 | 
79 | module.exports = {
80 |   provide_emitter: provide_emitter,
81 |   name: 'ZombieJS'
82 | };
83 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/CHANGES.txt:
--------------------------------------------------------------------------------
 1 | Changes
 2 | =======
 3 | 
 4 | 0.8.0
 5 | -----
 6 | 
 7 | * Make websockify properly terminate children on SIGTERM (#226)
 8 | * Remove logging in signal handlers (this can cause Python to hang under certain conditions) (#219)
 9 | * Make it easier to log to a file (#205)
10 | * Add support for IPv6 addresses in tokens in the TokenFile token plugins (#197)
11 | * Improve auth plugin framework to enable better support for HTTP auth (#194, #201)
12 | * Fix bug in JSONTokenAPI token plugin (#192)
13 | * Fix a missing variable in the exception handler (#178)
14 | 
15 | 0.7.0
16 | -----
17 | 
18 | * Python 3 support fixes (#140, #155, #159)
19 | * Generic token-parsing plugins support (#162)
20 | * Generic authentication plugins support (#172)
21 | * Fixed frame corruption on big-endian systems (#161)
22 | * Support heartbeats (via PING) and automatic responses to PONG (#169)
23 | * Automatically reject unmasked client frames by default (strict mode) (#174)
24 | * Automatically restart interrupted select calls (#175)
25 | * Make 'run' respect environment settings (including virtualenv) (#176)
26 | 
27 | 0.6.1 - May 11, 2015
28 | --------------------
29 | 
30 | * **PATCH RELEASE**: Fixes a bug causing file_only to not be passed properly
31 | 
32 | 0.6.0 - Feb 18, 2014
33 | --------------------
34 | 
35 | * **NOTE** : 0.6.0 will break existing code that sub-classes WebsocketProxy
36 | * Refactor to use standard SocketServer RequestHandler design
37 | * Fix zombie process bug on certain systems when using multiprocessing
38 | * Add better unit tests
39 | * Log information via python `logging` module
40 | 
41 | 0.5.1 - Jun 27, 2013
42 | --------------------
43 | 
44 |  * use upstream einaros/ws (>=0.4.27) with websockify.js
45 |  * file_only and no_parent security options for WSRequestHandler
46 |  * Update build of web-socket-js (c0855c6cae)
47 |  * add include/web-socket-js-project submodule to gimite/web-socket-js
48 |    for DSFG compliance.
49 |  * drop Hixie protocol support
50 | 
51 | 0.4.1 - Mar 12, 2013
52 | --------------------
53 | 
54 |  * ***NOTE*** : 0.5.0 will drop Hixie protocol support
55 |  * add include/ directory and remove some dev files from source
56 |    distribution.
57 | 
58 | 0.4.0 - Mar 12, 2013
59 | --------------------
60 | 
61 |  * ***NOTE*** : 0.5.0 will drop Hixie protocol support
62 |  * use Buffer base64 support in Node.js implementation
63 | 
64 | 0.3.0 - Jan 15, 2013
65 | --------------------
66 | 
67 |  * refactor into modules: websocket, websocketproxy
68 |  * switch to web-socket-js that uses IETF 6455
69 |  * change to MPL 2.0 license for include/*.js
70 |  * fix session recording
71 | 
72 | 0.2.1 - Oct 15, 2012
73 | --------------------
74 | 
75 |  * re-released with updated version number
76 | 
77 | 0.2.0 - Sep 17, 2012
78 | --------------------
79 | 
80 |  * Binary data support in websock.js
81 |  * Target config file/dir and multiple targets with token selector
82 |  * IPv6 fixes
83 |  * SSL target support
84 |  * Proxy to/from unix socket
85 | 
86 | 
87 | 0.1.0 - May 11, 2012
88 | --------------------
89 | 
90 |  * Initial versioned release.
91 | 
92 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/websockify/auth_plugins.py:
--------------------------------------------------------------------------------
 1 | class BasePlugin(object):
 2 |     def __init__(self, src=None):
 3 |         self.source = src
 4 | 
 5 |     def authenticate(self, headers, target_host, target_port):
 6 |         pass
 7 | 
 8 | 
 9 | class AuthenticationError(Exception):
10 |     def __init__(self, log_msg=None, response_code=403, response_headers={}, response_msg=None):
11 |         self.code = response_code
12 |         self.headers = response_headers
13 |         self.msg = response_msg
14 | 
15 |         if log_msg is None:
16 |             log_msg = response_msg
17 | 
18 |         super(AuthenticationError, self).__init__('%s %s' % (self.code, log_msg))
19 | 
20 | 
21 | class InvalidOriginError(AuthenticationError):
22 |     def __init__(self, expected, actual):
23 |         self.expected_origin = expected
24 |         self.actual_origin = actual
25 | 
26 |         super(InvalidOriginError, self).__init__(
27 |             response_msg='Invalid Origin',
28 |             log_msg="Invalid Origin Header: Expected one of "
29 |                     "%s, got '%s'" % (expected, actual))
30 | 
31 | 
32 | class BasicHTTPAuth(object):
33 |     """Verifies Basic Auth headers. Specify src as username:password"""
34 | 
35 |     def __init__(self, src=None):
36 |         self.src = src
37 | 
38 |     def authenticate(self, headers, target_host, target_port):
39 |         import base64
40 |         auth_header = headers.get('Authorization')
41 |         if auth_header:
42 |             if not auth_header.startswith('Basic '):
43 |                 raise AuthenticationError(response_code=403)
44 | 
45 |             try:
46 |                 user_pass_raw = base64.b64decode(auth_header[6:])
47 |             except TypeError:
48 |                 raise AuthenticationError(response_code=403)
49 | 
50 |             try:
51 |                 # http://stackoverflow.com/questions/7242316/what-encoding-should-i-use-for-http-basic-authentication
52 |                 user_pass_as_text = user_pass_raw.decode('ISO-8859-1')
53 |             except UnicodeDecodeError:
54 |                 raise AuthenticationError(response_code=403)
55 | 
56 |             user_pass = user_pass_as_text.split(':', 1)
57 |             if len(user_pass) != 2:
58 |                 raise AuthenticationError(response_code=403)
59 | 
60 |             if not self.validate_creds(*user_pass):
61 |                 raise AuthenticationError(response_code=403)
62 | 
63 |         else:
64 |             raise AuthenticationError(response_code=401,
65 |                                       response_headers={'WWW-Authenticate': 'Basic realm="Websockify"'})
66 | 
67 |     def validate_creds(self, username, password):
68 |         if '%s:%s' % (username, password) == self.src:
69 |             return True
70 |         else:
71 |             return False
72 | 
73 | class ExpectOrigin(object):
74 |     def __init__(self, src=None):
75 |         if src is None:
76 |             self.source = []
77 |         else:
78 |             self.source = src.split()
79 | 
80 |     def authenticate(self, headers, target_host, target_port):
81 |         origin = headers.get('Origin', None)
82 |         if origin is None or origin not in self.source:
83 |             raise InvalidOriginError(expected=self.source, actual=origin)
84 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/locale/el.js:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Translations for el
 3 |  *
 4 |  * This file was autotomatically generated from el.po
 5 |  * DO NOT EDIT!
 6 |  */
 7 | 
 8 | Language = {
 9 |     "Connecting...": "Συνδέεται...",
10 |     "Connected (encrypted) to ": "Συνδέθηκε (κρυπτογραφημένα) με το ",
11 |     "Connected (unencrypted) to ": "Συνδέθηκε (μη κρυπτογραφημένα) με το ",
12 |     "Disconnecting...": "Aποσυνδέεται...",
13 |     "Disconnected": "Αποσυνδέθηκε",
14 |     "Must set host and port": "Πρέπει να οριστεί το όνομα και η πόρτα του διακομιστή",
15 |     "Password is required": "Απαιτείται ο κωδικός πρόσβασης",
16 |     "Forcing clipping mode since scrollbars aren't supported by IE in fullscreen": "Εφαρμογή λειτουργίας αποκοπής αφού δεν υποστηρίζονται οι λωρίδες κύλισης σε πλήρη οθόνη στον IE",
17 |     "Disconnect timeout": "Παρέλευση χρονικού ορίου αποσύνδεσης",
18 |     "noVNC encountered an error:": "το noVNC αντιμετώπισε ένα σφάλμα",
19 |     "Hide/Show the control bar": "Απόκρυψη/Εμφάνιση γραμμής ελέγχου",
20 |     "Move/Drag Viewport": "Μετακίνηση/Σύρσιμο Θεατού πεδίου",
21 |     "viewport drag": "σύρσιμο θεατού πεδίου",
22 |     "Active Mouse Button": "Ενεργό Πλήκτρο Ποντικιού",
23 |     "No mousebutton": "Χωρίς Πλήκτρο Ποντικιού",
24 |     "Left mousebutton": "Αριστερό Πλήκτρο Ποντικιού",
25 |     "Middle mousebutton": "Μεσαίο Πλήκτρο Ποντικιού",
26 |     "Right mousebutton": "Δεξί Πλήκτρο Ποντικιού",
27 |     "Keyboard": "Πληκτρολόγιο",
28 |     "Show Keyboard": "Εμφάνιση Πληκτρολογίου",
29 |     "Extra keys": "Επιπλέον πλήκτρα",
30 |     "Show Extra Keys": "Εμφάνιση Επιπλέον Πλήκτρων",
31 |     "Ctrl": "Ctrl",
32 |     "Toggle Ctrl": "Εναλλαγή Ctrl",
33 |     "Alt": "Alt",
34 |     "Toggle Alt": "Εναλλαγή Alt",
35 |     "Send Tab": "Αποστολή Tab",
36 |     "Tab": "Tab",
37 |     "Esc": "Esc",
38 |     "Send Escape": "Αποστολή Escape",
39 |     "Ctrl+Alt+Del": "Ctrl+Alt+Del",
40 |     "Send Ctrl-Alt-Del": "Αποστολή Ctrl-Alt-Del",
41 |     "Shutdown/Reboot": "Κλείσιμο/Επανεκκίνηση",
42 |     "Shutdown/Reboot...": "Κλείσιμο/Επανεκκίνηση...",
43 |     "Power": "Απενεργοποίηση",
44 |     "Shutdown": "Κλείσιμο",
45 |     "Reboot": "Επανεκκίνηση",
46 |     "Reset": "Επαναφορά",
47 |     "Clipboard": "Πρόχειρο",
48 |     "Clear": "Καθάρισμα",
49 |     "Fullscreen": "Πλήρης Οθόνη",
50 |     "Settings": "Ρυθμίσεις",
51 |     "Encrypt": "Κρυπτογράφηση",
52 |     "True Color": "Πραγματικά Χρώματα",
53 |     "Local Cursor": "Τοπικός Δρομέας",
54 |     "Clip to Window": "Αποκοπή στο όριο του Παράθυρου",
55 |     "Shared Mode": "Κοινόχρηστη Λειτουργία",
56 |     "View Only": "Μόνο Θέαση",
57 |     "Path:": "Διαδρομή:",
58 |     "Scaling Mode:": "Λειτουργία Κλιμάκωσης:",
59 |     "None": "Καμία",
60 |     "Local Scaling": "Τοπική Κλιμάκωση",
61 |     "Local Downscaling": "Τοπική Συρρίκνωση",
62 |     "Remote Resizing": "Απομακρυσμένη Αλλαγή μεγέθους",
63 |     "Repeater ID:": "Repeater ID:",
64 |     "Style:": "Στυλ:",
65 |     "default": "προεπιλεγμένο",
66 |     "Logging:": "Καταγραφή:",
67 |     "Apply": "Εφαρμογή",
68 |     "Host:": "Όνομα διακομιστή:",
69 |     "Port:": "Πόρτα διακομιστή:",
70 |     "Password:": "Κωδικός Πρόσβασης:",
71 |     "Token:": "Διακριτικό:",
72 |     "Send Password": "Αποστολή Κωδικού Πρόσβασης",
73 |     "Canvas not supported.": "Δεν υποστηρίζεται το στοιχείο Canvas",
74 | };
75 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/rebind.c:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * rebind: Intercept bind calls and bind to a different port
 3 |  * Copyright 2010 Joel Martin
 4 |  * Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
 5 |  *
 6 |  * Overload (LD_PRELOAD) bind system call. If REBIND_PORT_OLD and
 7 |  * REBIND_PORT_NEW environment variables are set then bind on the new
 8 |  * port (of localhost) instead of the old port. 
 9 |  *
10 |  * This allows a bridge/proxy (such as websockify) to run on the old port and
11 |  * translate traffic to/from the new port.
12 |  *
13 |  * Usage:
14 |  *     LD_PRELOAD=./rebind.so \
15 |  *     REBIND_PORT_OLD=23 \
16 |  *     REBIND_PORT_NEW=2023 \
17 |  *     program
18 |  */
19 | 
20 | //#define DO_DEBUG 1
21 | 
22 | #include 
23 | #include 
24 | 
25 | #define __USE_GNU 1  // Pull in RTLD_NEXT
26 | #include 
27 | 
28 | #include 
29 | #include 
30 | 
31 | 
32 | #if defined(DO_DEBUG)
33 | #define DEBUG(...) \
34 |     fprintf(stderr, "rebind: "); \
35 |     fprintf(stderr, __VA_ARGS__);
36 | #else
37 | #define DEBUG(...)
38 | #endif
39 | 
40 | 
41 | int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
42 | {
43 |     static void * (*func)();
44 |     int do_move = 0;
45 |     struct sockaddr_in * addr_in = (struct sockaddr_in *)addr;
46 |     struct sockaddr_in addr_tmp;
47 |     socklen_t addrlen_tmp;
48 |     char * PORT_OLD, * PORT_NEW, * end1, * end2;
49 |     int ret, oldport, newport, askport = htons(addr_in->sin_port);
50 |     uint32_t askaddr = htons(addr_in->sin_addr.s_addr);
51 |     if (!func) func = (void *(*)()) dlsym(RTLD_NEXT, "bind");
52 | 
53 |     DEBUG(">> bind(%d, _, %d), askaddr %d, askport %d\n",
54 |           sockfd, addrlen, askaddr, askport);
55 | 
56 |     /* Determine if we should move this socket */
57 |     if (addr_in->sin_family == AF_INET) {
58 |         // TODO: support IPv6
59 |         PORT_OLD = getenv("REBIND_OLD_PORT");
60 |         PORT_NEW = getenv("REBIND_NEW_PORT");
61 |         if (PORT_OLD && (*PORT_OLD != '\0') &&
62 |             PORT_NEW && (*PORT_NEW != '\0')) {
63 |             oldport = strtol(PORT_OLD, &end1, 10);
64 |             newport = strtol(PORT_NEW, &end2, 10);
65 |             if (oldport && (*end1 == '\0') &&
66 |                 newport && (*end2 == '\0') &&
67 |                 (oldport == askport)) {
68 |                 do_move = 1;
69 |             }
70 |         }
71 |     }
72 | 
73 |     if (! do_move) {
74 |         /* Just pass everything right through to the real bind */
75 |         ret = (long) func(sockfd, addr, addrlen);
76 |         DEBUG("<< bind(%d, _, %d) ret %d\n", sockfd, addrlen, ret);
77 |         return ret;
78 |     }
79 | 
80 |     DEBUG("binding fd %d on localhost:%d instead of 0x%x:%d\n",
81 |         sockfd, newport, ntohl(addr_in->sin_addr.s_addr), oldport);
82 | 
83 |     /* Use a temporary location for the new address information */
84 |     addrlen_tmp = sizeof(addr_tmp);
85 |     memcpy(&addr_tmp, addr, addrlen_tmp);
86 | 
87 |     /* Bind to other port on the loopback instead */
88 |     addr_tmp.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
89 |     addr_tmp.sin_port = htons(newport);
90 |     ret = (long) func(sockfd, &addr_tmp, addrlen_tmp);
91 | 
92 |     DEBUG("<< bind(%d, _, %d) ret %d\n", sockfd, addrlen, ret);
93 |     return ret;
94 | }
95 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/tab.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
54 |     
57 |   
58 |   
60 |     
61 |       
63 |         image/svg+xml
64 |         
66 |         
67 |       
68 |     
69 |   
70 |   
75 |     
80 |     
85 |   
86 | 
87 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/expander.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
19 |   
21 |   
42 |     
45 |   
46 |   
48 |     
49 |       
51 |         image/svg+xml
52 |         
54 |         
55 |       
56 |     
57 |   
58 |   
63 |     
68 |   
69 | 
70 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/settings.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
49 |     
52 |   
53 |   
55 |     
56 |       
58 |         image/svg+xml
59 |         
61 |         
62 |       
63 |     
64 |   
65 |   
70 |     
75 |   
76 | 
77 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/Windows/noVNC Websocket Service Project/noVNC Websocket.csproj:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |   
 4 |     Debug
 5 |     x86
 6 |     8.0.30703
 7 |     2.0
 8 |     {6B86AE7B-6BBD-4E74-8802-5995E8B6D27D}
 9 |     WinExe
10 |     Properties
11 |     noVNC_Websocket_Service
12 |     noVNC Websocket Service
13 |     v3.5
14 |     512
15 |   
16 |   
17 |     x86
18 |     true
19 |     full
20 |     false
21 |     bin\Debug\
22 |     DEBUG;TRACE
23 |     prompt
24 |     4
25 |   
26 |   
27 |     x86
28 |     pdbonly
29 |     true
30 |     bin\Release\
31 |     TRACE
32 |     prompt
33 |     4
34 |   
35 |   
36 |     
37 |     
38 |     
39 |     
40 |     
41 |     
42 |     
43 |     
44 |     
45 |   
46 |   
47 |     
48 |       Component
49 |     
50 |     
51 |       ProjectInstaller.cs
52 |     
53 |     
54 |       Component
55 |     
56 |     
57 |       Service1.cs
58 |     
59 |     
60 |     
61 |   
62 |   
63 |     
64 |       ProjectInstaller.cs
65 |     
66 |   
67 |   
68 |   
75 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/error.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
54 |     
57 |   
58 |   
60 |     
61 |       
63 |         image/svg+xml
64 |         
66 |         
67 |       
68 |     
69 |   
70 |   
75 |     
80 |   
81 | 
82 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/websockify/websocketserver.py:
--------------------------------------------------------------------------------
 1 | #!/usr/bin/env python
 2 | 
 3 | '''
 4 | Python WebSocket server base
 5 | Copyright 2011 Joel Martin
 6 | Copyright 2016 Pierre Ossman
 7 | Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3)
 8 | '''
 9 | 
10 | import sys
11 | 
12 | # python 3.0 differences
13 | try:    from http.server import BaseHTTPRequestHandler, HTTPServer
14 | except: from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
15 | 
16 | from websockify.websocket import WebSocket, WebSocketWantReadError, WebSocketWantWriteError
17 | 
18 | class WebSocketRequestHandler(BaseHTTPRequestHandler):
19 |     """WebSocket request handler base class.
20 | 
21 |     This class forms the base for a server that wishes to handle
22 |     WebSocket requests. It functions exactly as BastHTTPRequestHandler,
23 |     except that WebSocket requests are intercepted and the methods
24 |     handle_upgrade() and handle_websocket() are called. The standard
25 |     do_GET() will be called for normal requests.
26 | 
27 |     The class instance SocketClass can be overridden with the class to
28 |     use for the WebSocket connection.
29 |     """
30 | 
31 |     SocketClass = WebSocket
32 | 
33 |     def __init__(self, request, client_address, server):
34 |         BaseHTTPRequestHandler.__init__(self, request, client_address, server)
35 | 
36 |     def handle_one_request(self):
37 |         """Extended request handler
38 | 
39 |         This is where WebSocketRequestHandler redirects requests to the
40 |         new methods. Any sub-classes must call this method in order for
41 |         the calls to function.
42 |         """
43 |         self._real_do_GET = self.do_GET
44 |         self.do_GET = self._websocket_do_GET
45 |         try:
46 |             BaseHTTPRequestHandler.handle_one_request(self)
47 |         finally:
48 |             self.do_GET = self._real_do_GET
49 | 
50 |     def _websocket_do_GET(self):
51 |         # Checks if it is a websocket request and redirects
52 |         self.do_GET = self._real_do_GET
53 | 
54 |         if (self.headers.get('upgrade') and
55 |             self.headers.get('upgrade').lower() == 'websocket'):
56 |             self.handle_upgrade()
57 |         else:
58 |             self.do_GET()
59 | 
60 |     def handle_upgrade(self):
61 |         """Initial handler for a WebSocket request
62 | 
63 |         This method is called when a WebSocket is requested. By default
64 |         it will create a WebSocket object and perform the negotiation.
65 |         The WebSocket object will then replace the request object and
66 |         handle_websocket() will be called.
67 |         """
68 |         websocket = self.SocketClass()
69 |         try:
70 |             websocket.accept(self.request, self.headers)
71 |         except Exception:
72 |             exc = sys.exc_info()[1]
73 |             self.send_error(400, str(exc))
74 |             return
75 | 
76 |         self.log_request(101)
77 | 
78 |         self.request = websocket
79 | 
80 |         # Other requests cannot follow Websocket data
81 |         self.close_connection = True
82 | 
83 |         self.handle_websocket()
84 | 
85 |     def handle_websocket(self):
86 |         """Handle a WebSocket connection.
87 |         
88 |         This is called when the WebSocket is ready to be used. A
89 |         sub-class should perform the necessary communication here and
90 |         return once done.
91 |         """
92 |         pass
93 | 
94 | class WebSocketServer(HTTPServer):
95 |     pass
96 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/fullscreen.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
53 |     
56 |   
57 |   
59 |     
60 |       
62 |         image/svg+xml
63 |         
65 |         
66 |       
67 |     
68 |   
69 |   
74 |     
82 |     
87 |     
92 |   
93 | 
94 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/app/images/info.svg:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | 
 4 | 
22 |   
24 |   
54 |     
57 |   
58 |   
60 |     
61 |       
63 |         image/svg+xml
64 |         
66 |         
67 |       
68 |     
69 |   
70 |   
75 |     
80 |   
81 | 
82 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/parse.js:
--------------------------------------------------------------------------------
  1 | // Utility to parse keysymdef.h to produce mappings from Unicode codepoints to keysyms
  2 | "use strict";
  3 | 
  4 | var fs = require('fs');
  5 | 
  6 | var show_help = process.argv.length === 2;
  7 | var use_keynames = false;
  8 | var filename;
  9 | 
 10 | for (var i = 2; i < process.argv.length; ++i) {
 11 |   switch (process.argv[i]) {
 12 |     case "--help":
 13 |     case "-h":
 14 |       show_help = true;
 15 |       break;
 16 |     case "--debug-names":
 17 |     case "-d":
 18 |       use_keynames = true;
 19 |       break;
 20 |     case "--file":
 21 |     case "-f":
 22 |     default:
 23 |       filename = process.argv[i];
 24 |   }
 25 | }
 26 | 
 27 | if (!filename) {
 28 |   show_help = true;
 29 |   console.log("Error: No filename specified\n");
 30 | }
 31 | 
 32 | if (show_help) {
 33 |   console.log("Parses a *nix keysymdef.h to generate Unicode code point mappings");
 34 |   console.log("Usage: node parse.js [options] filename:");
 35 |   console.log("  -h [ --help ]                 Produce this help message");
 36 |   console.log("  -d [ --debug-names ]          Preserve keysym names for debugging (Increases file size by ~40KB)");
 37 |   console.log("  filename                      The keysymdef.h file to parse");
 38 |   return;
 39 | }
 40 | 
 41 | // Set this to false to omit key names from the generated keysymdef.js
 42 | // This reduces the file size by around 40kb, but may hinder debugging
 43 | 
 44 | var buf = fs.readFileSync(filename);
 45 | var str = buf.toString('utf8');
 46 | 
 47 | var re = /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-fA-F]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/m;
 48 | 
 49 | var arr = str.split('\n');
 50 | 
 51 | var keysyms = {};
 52 | var codepoints = {};
 53 | 
 54 | for (var i = 0; i < arr.length; ++i) {
 55 |     var result = re.exec(arr[i]);
 56 |     if (result){
 57 |         var keyname = result[1];
 58 |         var keysym = parseInt(result[2], 16);
 59 |         var remainder = result[3];
 60 | 
 61 |         keysyms[keysym] = keyname;
 62 | 
 63 |         var unicodeRes = /U\+([0-9a-fA-F]+)/.exec(remainder);
 64 |         if (unicodeRes) {
 65 |             var unicode = parseInt(unicodeRes[1], 16);
 66 |             if (!codepoints[unicode]){
 67 |                 codepoints[unicode] = keysym;
 68 |             }
 69 |         }
 70 |         else {
 71 |             console.log("no unicode codepoint found:", arr[i]);
 72 |         }
 73 |     }
 74 |     else {
 75 |         console.log("line is not a keysym:", arr[i]);
 76 |     }
 77 | }
 78 | 
 79 | var out = "// This file describes mappings from Unicode codepoints to the keysym values\n" +
 80 | "// (and optionally, key names) expected by the RFB protocol\n" +
 81 | "// How this file was generated:\n" +
 82 | "// " + process.argv.join(" ") + "\n" +
 83 | "var keysyms = (function(){\n" +
 84 | "    \"use strict\";\n" +
 85 | "    var keynames = {keysyms};\n" +
 86 | "    var codepoints = {codepoints};\n" +
 87 | "\n" +
 88 | "    function lookup(k) { return k ? {keysym: k, keyname: keynames ? keynames[k] : k} : undefined; }\n" +
 89 | "    return {\n" +
 90 | "        fromUnicode : function(u) {\n" +
 91 | "            var keysym = codepoints[u];\n" +
 92 | "            if (keysym === undefined) {\n" +
 93 | "                keysym = 0x01000000 | u;\n" +
 94 | "            }\n" +
 95 | "            return lookup(keysym);\n" +
 96 | "        },\n" +
 97 | "        lookup : lookup\n" +
 98 | "    };\n" +
 99 | "})();\n";
100 | out = out.replace('{keysyms}', use_keynames ? JSON.stringify(keysyms) : "null");
101 | out = out.replace('{codepoints}', JSON.stringify(codepoints));
102 | 
103 | fs.writeFileSync("keysymdef.js", out);
104 | 


--------------------------------------------------------------------------------
/image/usr/lib/noVNC/utils/websockify/wsirc.html:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 |     
 4 |         IRC Client using WebSockets
 5 |         
 6 |         
 7 |          
 8 |          
 9 |          
10 |          
11 |         
12 |         
16 | 
17 | 
18 |     
19 | 
20 |     
21 | 
22 |         Host:  
23 |         Port:  
24 |         Encrypt:  
25 |         
26 |         
27 | Nick:   28 |
29 | Channel: #  30 | 31 |

32 | 33 |
34 | > 35 | 36 | 37 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/ctrlaltdel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 83 | 91 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /image/usr/lib/web/log/config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | import logging 4 | import logging.handlers 5 | 6 | 7 | #The terminal has 8 colors with codes from 0 to 7 8 | BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) 9 | 10 | #These are the sequences need to get colored ouput 11 | RESET_SEQ = "\033[0m" 12 | COLOR_SEQ = "\033[1;%dm" 13 | BOLD_SEQ = "\033[1m" 14 | 15 | #The background is set with 40 plus the number of the color, 16 | #and the foreground with 30 17 | COLORS = { 18 | 'WARNING': COLOR_SEQ % (30 + YELLOW) + 'WARN ' + RESET_SEQ, 19 | 'INFO': COLOR_SEQ % (30 + WHITE) + 'INFO ' + RESET_SEQ, 20 | 'DEBUG': COLOR_SEQ % (30 + BLUE) + 'DEBUG' + RESET_SEQ, 21 | 'CRITICAL': COLOR_SEQ % (30 + YELLOW) + 'CRITI' + RESET_SEQ, 22 | 'ERROR': COLOR_SEQ % (30 + RED) + 'ERROR' + RESET_SEQ, 23 | } 24 | 25 | 26 | class ColoredFormatter(logging.Formatter): 27 | def __init__(self, msg, use_color=True): 28 | logging.Formatter.__init__(self, msg) 29 | self.use_color = use_color 30 | 31 | def format(self, record): 32 | if self.use_color: 33 | record.levelname = COLORS.get(record.levelname, record.levelname) 34 | return logging.Formatter.format(self, record) 35 | 36 | 37 | class LoggingConfiguration(object): 38 | COLOR_FORMAT = "[%(asctime)s" + \ 39 | "][%(threadName)-22s][%(levelname)s] %(message)s " + \ 40 | "(" + BOLD_SEQ + "%(filename)s" + RESET_SEQ + ":%(lineno)d)" 41 | NO_COLOR_FORMAT = "[%(asctime)s][%(threadName)-22s][%(levelname)s] " + \ 42 | "%(message)s " + \ 43 | "(%(filename)s:%(lineno)d)" 44 | FILE_FORMAT = "[%(asctime)s][%(threadName)-22s][%(levelname)s] " + \ 45 | "%(message)s " 46 | 47 | @classmethod 48 | def set(cls, log_level, log_filename, append=None, **kwargs): 49 | """ Configure a rotating file logging 50 | """ 51 | logger = logging.getLogger() 52 | logger.setLevel(log_level) 53 | 54 | COLOR_FORMAT = cls.COLOR_FORMAT 55 | NO_COLOR_FORMAT = cls.NO_COLOR_FORMAT 56 | FILE_FORMAT = cls.FILE_FORMAT 57 | if 'name' in kwargs: 58 | COLOR_FORMAT = COLOR_FORMAT.replace('%(threadName)-22s', 59 | '%-22s' % (kwargs['name'])) 60 | NO_COLOR_FORMAT = NO_COLOR_FORMAT.replace( 61 | '%(threadName)-22s', '%-22s' % (kwargs['name'])) 62 | FILE_FORMAT = FILE_FORMAT.replace( 63 | '%(threadName)-22s', '%s' % (kwargs['name'])) 64 | 65 | # Log to rotating file 66 | try: 67 | fh = logging.handlers.RotatingFileHandler(log_filename, 68 | mode='a+', 69 | backupCount=3) 70 | fh = logging.FileHandler(log_filename, mode='a+') 71 | fh.setFormatter(ColoredFormatter(FILE_FORMAT, False)) 72 | fh.setLevel(log_level) 73 | logger.addHandler(fh) 74 | if not append: 75 | # Create a new log file on every new 76 | fh.doRollover() 77 | except: 78 | pass 79 | 80 | # Log to sys.stderr using log level passed through command line 81 | if log_level != logging.NOTSET: 82 | log_handler = logging.StreamHandler(sys.stdout) 83 | if sys.platform.find('linux') >= 0: 84 | formatter = ColoredFormatter(COLOR_FORMAT) 85 | else: 86 | formatter = ColoredFormatter(NO_COLOR_FORMAT, False) 87 | log_handler.setFormatter(formatter) 88 | log_handler.setLevel(log_level) 89 | logger.addHandler(log_handler) 90 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/connect.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 53 | 56 | 57 | 59 | 60 | 62 | image/svg+xml 63 | 65 | 66 | 67 | 68 | 69 | 74 | 77 | 83 | 89 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/launch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | usage() { 4 | if [ "$*" ]; then 5 | echo "$*" 6 | echo 7 | fi 8 | echo "Usage: ${NAME} [--listen PORT] [--vnc VNC_HOST:PORT] [--cert CERT]" 9 | echo 10 | echo "Starts the WebSockets proxy and a mini-webserver and " 11 | echo "provides a cut-and-paste URL to go to." 12 | echo 13 | echo " --listen PORT Port for proxy/webserver to listen on" 14 | echo " Default: 6080" 15 | echo " --vnc VNC_HOST:PORT VNC server host:port proxy target" 16 | echo " Default: localhost:5900" 17 | echo " --cert CERT Path to combined cert/key file" 18 | echo " Default: self.pem" 19 | echo " --web WEB Path to web files (e.g. vnc.html)" 20 | echo " Default: ./" 21 | exit 2 22 | } 23 | 24 | NAME="$(basename $0)" 25 | HERE="$(cd "$(dirname "$0")" && pwd)" 26 | PORT="6080" 27 | VNC_DEST="localhost:5900" 28 | CERT="" 29 | WEB="" 30 | proxy_pid="" 31 | 32 | die() { 33 | echo "$*" 34 | exit 1 35 | } 36 | 37 | cleanup() { 38 | trap - TERM QUIT INT EXIT 39 | trap "true" CHLD # Ignore cleanup messages 40 | echo 41 | if [ -n "${proxy_pid}" ]; then 42 | echo "Terminating WebSockets proxy (${proxy_pid})" 43 | kill ${proxy_pid} 44 | fi 45 | } 46 | 47 | # Process Arguments 48 | 49 | # Arguments that only apply to chrooter itself 50 | while [ "$*" ]; do 51 | param=$1; shift; OPTARG=$1 52 | case $param in 53 | --listen) PORT="${OPTARG}"; shift ;; 54 | --vnc) VNC_DEST="${OPTARG}"; shift ;; 55 | --cert) CERT="${OPTARG}"; shift ;; 56 | --web) WEB="${OPTARG}"; shift ;; 57 | -h|--help) usage ;; 58 | -*) usage "Unknown chrooter option: ${param}" ;; 59 | *) break ;; 60 | esac 61 | done 62 | 63 | # Sanity checks 64 | which netstat >/dev/null 2>&1 \ 65 | || die "Must have netstat installed" 66 | 67 | netstat -ltn | grep -qs "${PORT} .*LISTEN" \ 68 | && die "Port ${PORT} in use. Try --listen PORT" 69 | 70 | trap "cleanup" TERM QUIT INT EXIT 71 | 72 | # Find vnc.html 73 | if [ -n "${WEB}" ]; then 74 | if [ ! -e "${WEB}/vnc.html" ]; then 75 | die "Could not find ${WEB}/vnc.html" 76 | fi 77 | elif [ -e "$(pwd)/vnc.html" ]; then 78 | WEB=$(pwd) 79 | elif [ -e "${HERE}/../vnc.html" ]; then 80 | WEB=${HERE}/../ 81 | elif [ -e "${HERE}/vnc.html" ]; then 82 | WEB=${HERE} 83 | elif [ -e "${HERE}/../share/novnc/vnc.html" ]; then 84 | WEB=${HERE}/../share/novnc/ 85 | else 86 | die "Could not find vnc.html" 87 | fi 88 | 89 | # Find self.pem 90 | if [ -n "${CERT}" ]; then 91 | if [ ! -e "${CERT}" ]; then 92 | die "Could not find ${CERT}" 93 | fi 94 | elif [ -e "$(pwd)/self.pem" ]; then 95 | CERT="$(pwd)/self.pem" 96 | elif [ -e "${HERE}/../self.pem" ]; then 97 | CERT="${HERE}/../self.pem" 98 | elif [ -e "${HERE}/self.pem" ]; then 99 | CERT="${HERE}/self.pem" 100 | else 101 | echo "Warning: could not find self.pem" 102 | fi 103 | 104 | echo "Starting webserver and WebSockets proxy on port ${PORT}" 105 | ${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} & 106 | proxy_pid="$!" 107 | sleep 1 108 | if ! ps -p ${proxy_pid} >/dev/null; then 109 | proxy_pid= 110 | echo "Failed to start WebSockets proxy" 111 | exit 1 112 | fi 113 | 114 | echo -e "\n\nNavigate to this URL:\n" 115 | echo -e " http://$(hostname):${PORT}/vnc.html?host=$(hostname)&port=${PORT}\n" 116 | echo -e "Press Ctrl-C to exit\n\n" 117 | 118 | wait ${proxy_pid} 119 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/styles/auto.css: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC auto CSS 3 | * Copyright (C) 2012 Joel Martin 4 | * Copyright (C) 2016 Samuel Mannehed for Cendio AB 5 | * noVNC is licensed under the MPL 2.0 (see LICENSE.txt) 6 | * This file is licensed under the 2-Clause BSD license (see LICENSE.txt). 7 | */ 8 | 9 | body { 10 | margin:0; 11 | padding:0; 12 | font-family: Helvetica; 13 | /*Background image with light grey curve.*/ 14 | background-color:#494949; 15 | background-repeat:no-repeat; 16 | background-position:right bottom; 17 | height:100%; 18 | } 19 | 20 | html { 21 | height:100%; 22 | } 23 | 24 | #noVNC_container { 25 | display: table; 26 | width:100%; 27 | height:100%; 28 | background-color:#313131; 29 | border-bottom-right-radius: 800px 600px; 30 | /*border-top-left-radius: 800px 600px;*/ 31 | } 32 | 33 | #noVNC_status { 34 | font-size: 12px; 35 | padding-top: 4px; 36 | height:32px; 37 | text-align: center; 38 | font-weight: bold; 39 | color: #fff; 40 | z-index: 0; 41 | position: absolute; 42 | width: 100%; 43 | margin-left: 0px; 44 | } 45 | 46 | .noVNC_status_normal { 47 | background: #b2bdcd; /* Old browsers */ 48 | background: -moz-linear-gradient(top, #b2bdcd 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 49 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b2bdcd), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 50 | background: -webkit-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 51 | background: -o-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 52 | background: -ms-linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 53 | background: linear-gradient(top, #b2bdcd 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 54 | } 55 | 56 | .noVNC_status_error { 57 | background: #f04040; /* Old browsers */ 58 | background: -moz-linear-gradient(top, #f04040 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 59 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f04040), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 60 | background: -webkit-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 61 | background: -o-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 62 | background: -ms-linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 63 | background: linear-gradient(top, #f04040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 64 | } 65 | 66 | .noVNC_status_warn { 67 | background: #f0f040; /* Old browsers */ 68 | background: -moz-linear-gradient(top, #f0f040 0%, #899cb3 49%, #7e93af 51%, #6e84a3 100%); /* FF3.6+ */ 69 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f0f040), color-stop(49%,#899cb3), color-stop(51%,#7e93af), color-stop(100%,#6e84a3)); /* Chrome,Safari4+ */ 70 | background: -webkit-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Chrome10+,Safari5.1+ */ 71 | background: -o-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* Opera11.10+ */ 72 | background: -ms-linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* IE10+ */ 73 | background: linear-gradient(top, #f0f040 0%,#899cb3 49%,#7e93af 51%,#6e84a3 100%); /* W3C */ 74 | } 75 | 76 | #noVNC_buttons { 77 | white-space: nowrap; 78 | } 79 | 80 | /* Do not set width/height for VNC_canvas or incorrect 81 | * scaling will occur. Canvas size depends on remote VNC 82 | * settings and noVNC settings. */ 83 | #noVNC_canvas { 84 | position: absolute; 85 | left: 0; 86 | right: 0; 87 | margin-left: auto; 88 | margin-right: auto; 89 | } 90 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/alt.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 78 | 82 | 86 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/po/xgettext-html: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* 3 | * xgettext-html: HTML gettext parser 4 | * Copyright (C) 2016 Pierre Ossman 5 | * Licensed under MPL 2.0 (see LICENSE.txt) 6 | */ 7 | 8 | var getopt = require('node-getopt'); 9 | 10 | var jsdom = require("jsdom"); 11 | var fs = require("fs"); 12 | 13 | opt = getopt.create([ 14 | ['o' , 'output=FILE' , 'write output to specified file'], 15 | ['h' , 'help' , 'display this help'], 16 | ]).bindHelp().parseSystem(); 17 | 18 | var strings = {}; 19 | 20 | function addString(str, location) { 21 | if (str.length == 0) { 22 | return; 23 | } 24 | 25 | if (strings[str] === undefined) { 26 | strings[str] = {} 27 | } 28 | strings[str][location] = null; 29 | } 30 | 31 | // See https://html.spec.whatwg.org/multipage/dom.html#attr-translate 32 | function process(elem, locator, enabled) { 33 | function isAnyOf(searchElement, items) { 34 | return items.indexOf(searchElement) !== -1; 35 | } 36 | 37 | if (elem.hasAttribute("translate")) { 38 | if (isAnyOf(elem.getAttribute("translate"), ["", "yes"])) { 39 | enabled = true; 40 | } else if (isAnyOf(elem.getAttribute("translate"), ["no"])) { 41 | enabled = false; 42 | } 43 | } 44 | 45 | if (enabled) { 46 | if (elem.hasAttribute("abbr") && 47 | elem.tagName === "TH") { 48 | addString(elem.getAttribute("abbr"), locator(elem)); 49 | } 50 | if (elem.hasAttribute("alt") && 51 | isAnyOf(elem.tagName, ["AREA", "IMG", "INPUT"])) { 52 | addString(elem.getAttribute("alt"), locator(elem)); 53 | } 54 | if (elem.hasAttribute("download") && 55 | isAnyOf(elem.tagName, ["A", "AREA"])) { 56 | addString(elem.getAttribute("download"), locator(elem)); 57 | } 58 | if (elem.hasAttribute("label") && 59 | isAnyOf(elem.tagName, ["MENUITEM", "MENU", "OPTGROUP", 60 | "OPTION", "TRACK"])) { 61 | addString(elem.getAttribute("label"), locator(elem)); 62 | } 63 | if (elem.hasAttribute("placeholder") && 64 | isAnyOf(elem.tagName in ["INPUT", "TEXTAREA"])) { 65 | addString(elem.getAttribute("placeholder"), locator(elem)); 66 | } 67 | if (elem.hasAttribute("title")) { 68 | addString(elem.getAttribute("title"), locator(elem)); 69 | } 70 | if (elem.hasAttribute("value") && 71 | elem.tagName === "INPUT" && 72 | isAnyOf(elem.getAttribute("type"), ["reset", "button"])) { 73 | addString(elem.getAttribute("value"), locator(elem)); 74 | } 75 | } 76 | 77 | for (var i = 0;i < elem.childNodes.length;i++) { 78 | node = elem.childNodes[i]; 79 | if (node.nodeType === node.ELEMENT_NODE) { 80 | process(node, locator, enabled); 81 | } else if (node.nodeType === node.TEXT_NODE && enabled) { 82 | addString(node.data.trim(), locator(node)); 83 | } 84 | } 85 | } 86 | 87 | for (var i = 0;i < opt.argv.length;i++) { 88 | var file; 89 | 90 | fn = opt.argv[i]; 91 | file = fs.readFileSync(fn, "utf8"); 92 | doc = jsdom.jsdom(file); 93 | 94 | locator = function (elem) { 95 | offset = jsdom.nodeLocation(elem).start; 96 | line = file.slice(0, offset).split("\n").length; 97 | return fn + ":" + line; 98 | }; 99 | 100 | process(doc.body, locator, true); 101 | } 102 | 103 | var output = ""; 104 | 105 | for (str in strings) { 106 | output += "#:"; 107 | for (location in strings[str]) { 108 | output += " " + location; 109 | } 110 | output += "\n"; 111 | 112 | output += "msgid " + JSON.stringify(str) + "\n"; 113 | output += "msgstr \"\"\n"; 114 | output += "\n"; 115 | } 116 | 117 | fs.writeFileSync(opt.options.output, output); 118 | -------------------------------------------------------------------------------- /image/usr/lib/web/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import os 4 | import time 5 | import sys 6 | import subprocess 7 | import signal 8 | 9 | 10 | def run_with_reloader(main_func, extra_files=None, interval=1): 11 | """Run the given function in an independent python interpreter.""" 12 | def find_files(directory="./"): 13 | for root, dirs, files in os.walk(directory): 14 | for basename in files: 15 | if basename.endswith('.py'): 16 | filename = os.path.join(root, basename) 17 | yield filename 18 | 19 | if os.environ.get('WERKZEUG_RUN_MAIN') == 'true': 20 | try: 21 | os.setpgid(0, 0) 22 | main_func() 23 | except KeyboardInterrupt: 24 | pass 25 | return 26 | 27 | procs = None 28 | try: 29 | while True: 30 | print('* Restarting with reloader ' + str(sys.executable)) 31 | args = [sys.executable] + sys.argv 32 | new_environ = os.environ.copy() 33 | new_environ['WERKZEUG_RUN_MAIN'] = 'true' 34 | 35 | procs = subprocess.Popen(args, env=new_environ) 36 | mtimes = {} 37 | restart = False 38 | while not restart: 39 | for filename in find_files(): 40 | try: 41 | mtime = os.stat(filename).st_mtime 42 | except OSError: 43 | continue 44 | 45 | old_time = mtimes.get(filename) 46 | if old_time is None: 47 | mtimes[filename] = mtime 48 | continue 49 | elif mtime > old_time: 50 | print('* Detected change in %r, reloading' % filename) 51 | restart = True 52 | break 53 | time.sleep(interval) 54 | 55 | killpg(procs.pid, signal.SIGTERM) 56 | except KeyboardInterrupt: 57 | pass 58 | finally: 59 | killpg(procs.pid, signal.SIGTERM) 60 | 61 | 62 | def killpg(pgid, send_signal=signal.SIGKILL): 63 | print('kill PGID {}'.format(pgid)) 64 | try: 65 | os.killpg(pgid, send_signal) 66 | #os.killpg(pgid, signal.SIGKILL) 67 | except: 68 | pass 69 | 70 | 71 | def main(): 72 | def run_server(): 73 | import socket 74 | 75 | os.environ['CONFIG'] = CONFIG 76 | from lightop import app 77 | 78 | # websocket conflict: WebSocketHandler 79 | if DEBUG or STAGING: 80 | # from werkzeug.debug import DebuggedApplication 81 | app.debug = True 82 | # app = DebuggedApplication(app, evalex=True) 83 | 84 | print('Fork monitor programs') 85 | pgid = os.getpgid(0) 86 | procs = [] 87 | procs.extend([subprocess.Popen(program, close_fds=True, shell=True) 88 | for program in PROGRAMS]) 89 | signal.signal(signal.SIGTERM, lambda *args: killpg(pgid)) 90 | signal.signal(signal.SIGHUP, lambda *args: killpg(pgid)) 91 | signal.signal(signal.SIGINT, lambda *args: killpg(pgid)) 92 | 93 | print('Running on port ' + str(PORT)) 94 | try: 95 | app.run(host='', port=PORT) 96 | except socket.error as e: 97 | print(e) 98 | 99 | DEBUG = True if '--debug' in sys.argv else False 100 | STAGING = True if '--staging' in sys.argv else False 101 | CONFIG = 'config.Development' if DEBUG else 'config.Production' 102 | CONFIG = 'config.Staging' if STAGING else CONFIG 103 | PORT = 6079 104 | PROGRAMS = tuple() 105 | signal.signal(signal.SIGCHLD, signal.SIG_IGN) 106 | 107 | if DEBUG or STAGING: 108 | main = lambda: run_with_reloader(run_server) 109 | else: 110 | main = run_server 111 | main() 112 | 113 | 114 | if __name__ == "__main__": 115 | main() 116 | -------------------------------------------------------------------------------- /image/usr/lib/web/lightop/__init__.py: -------------------------------------------------------------------------------- 1 | from flask import (Flask, 2 | request, 3 | abort, 4 | ) 5 | import os 6 | 7 | 8 | # Flask app 9 | app = Flask(__name__, 10 | static_folder='static', static_url_path='', 11 | instance_relative_config=True) 12 | CONFIG = os.environ.get('CONFIG') or 'config.Development' 13 | app.config.from_object('config.Default') 14 | app.config.from_object(CONFIG) 15 | 16 | # logging 17 | import logging 18 | from log.config import LoggingConfiguration 19 | LoggingConfiguration.set( 20 | logging.DEBUG if os.getenv('DEBUG') else logging.INFO, 21 | 'lightop.log', name='Web') 22 | 23 | 24 | import json 25 | from functools import wraps 26 | import subprocess 27 | import time 28 | 29 | 30 | FIRST = True 31 | 32 | 33 | def exception_to_json(func): 34 | @wraps(func) 35 | def wrapper(*args, **kwargs): 36 | try: 37 | result = func(*args, **kwargs) 38 | return result 39 | except (BadRequest, 40 | KeyError, 41 | ValueError, 42 | ) as e: 43 | result = {'error': {'code': 400, 44 | 'message': str(e)}} 45 | except PermissionDenied as e: 46 | result = {'error': {'code': 403, 47 | 'message': ', '.join(e.args)}} 48 | except (NotImplementedError, RuntimeError, AttributeError) as e: 49 | result = {'error': {'code': 500, 50 | 'message': ', '.join(e.args)}} 51 | return json.dumps(result) 52 | return wrapper 53 | 54 | 55 | class PermissionDenied(Exception): 56 | pass 57 | 58 | 59 | class BadRequest(Exception): 60 | pass 61 | 62 | 63 | HTML_INDEX = ''' 64 | 73 | Page Redirection 74 | ''' 75 | 76 | 77 | HTML_REDIRECT = ''' 78 | 84 | Page Redirection 85 | ''' 86 | 87 | 88 | @app.route('/') 89 | def index(): 90 | return HTML_INDEX 91 | 92 | 93 | @app.route('/redirect.html') 94 | def redirectme(): 95 | global FIRST 96 | 97 | if not FIRST: 98 | return HTML_REDIRECT 99 | 100 | env = {'width': 1024, 'height': 768} 101 | if 'width' in request.args: 102 | env['width'] = request.args['width'] 103 | if 'height' in request.args: 104 | env['height'] = request.args['height'] 105 | 106 | # sed 107 | subprocess.check_call(r"sed -i 's#^command=/usr/bin/Xvfb.*$#command=/usr/bin/Xvfb :1 -screen 0 {width}x{height}x16#' /etc/supervisor/conf.d/supervisord.conf".format(**env), 108 | shell=True) 109 | # supervisorctrl reload 110 | subprocess.check_call(r"supervisorctl reload", shell=True) 111 | 112 | # check all running 113 | for i in xrange(20): 114 | output = subprocess.check_output(r"supervisorctl status | grep RUNNING | wc -l", shell=True) 115 | if output.strip() == "6": 116 | FIRST = False 117 | return HTML_REDIRECT 118 | time.sleep(2) 119 | abort(500, 'service is not ready, please restart container') 120 | 121 | 122 | if __name__ == '__main__': 123 | app.run(host=app.config['ADDRESS'], port=app.config['PORT']) 124 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/docs/rfb_notes: -------------------------------------------------------------------------------- 1 | 5.1.1 ProtocolVersion: 12, 12 bytes 2 | 3 | - Sent by server, max supported 4 | 12 ascii - "RFB 003.008\n" 5 | - Response by client, version to use 6 | 12 ascii - "RFB 003.003\n" 7 | 8 | 5.1.2 Authentication: >=4, [16, 4] bytes 9 | 10 | - Sent by server 11 | CARD32 - authentication-scheme 12 | 0 - connection failed 13 | CARD32 - length 14 | length - reason 15 | 1 - no authentication 16 | 17 | 2 - VNC authentication 18 | 16 CARD8 - challenge (random bytes) 19 | 20 | - Response by client (if VNC authentication) 21 | 16 CARD8 - client encrypts the challenge with DES, using user 22 | password as key, sends resulting 16 byte response 23 | 24 | - Response by server (if VNC authentication) 25 | CARD32 - 0 - OK 26 | 1 - failed 27 | 2 - too-many 28 | 29 | 5.1.3 ClientInitialisation: 1 byte 30 | - Sent by client 31 | CARD8 - shared-flag, 0 exclusive, non-zero shared 32 | 33 | 5.1.4 ServerInitialisation: >=24 bytes 34 | - Sent by server 35 | CARD16 - framebuffer-width 36 | CARD16 - framebuffer-height 37 | 16 byte PIXEL_FORMAT - server-pixel-format 38 | CARD8 - bits-per-pixel 39 | CARD8 - depth 40 | CARD8 - big-endian-flag, non-zero is big endian 41 | CARD8 - true-color-flag, non-zero then next 6 apply 42 | CARD16 - red-max 43 | CARD16 - green-max 44 | CARD16 - blue-max 45 | CARD8 - red-shift 46 | CARD8 - green-shift 47 | CARD8 - blue-shift 48 | 3 bytes - padding 49 | CARD32 - name-length 50 | 51 | CARD8[length] - name-string 52 | 53 | 54 | 55 | Client to Server Messages: 56 | 57 | 5.2.1 SetPixelFormat: 20 bytes 58 | CARD8: 0 - message-type 59 | ... 60 | 61 | 5.2.2 FixColourMapEntries: >=6 bytes 62 | CARD8: 1 - message-type 63 | ... 64 | 65 | 5.2.3 SetEncodings: >=8 bytes 66 | CARD8: 2 - message-type 67 | CARD8 - padding 68 | CARD16 - numer-of-encodings 69 | 70 | CARD32 - encoding-type in preference order 71 | 0 - raw 72 | 1 - copy-rectangle 73 | 2 - RRE 74 | 4 - CoRRE 75 | 5 - hextile 76 | 77 | 5.2.4 FramebufferUpdateRequest (10 bytes) 78 | CARD8: 3 - message-type 79 | CARD8 - incremental (0 for full-update, non-zero for incremental) 80 | CARD16 - x-position 81 | CARD16 - y-position 82 | CARD16 - width 83 | CARD16 - height 84 | 85 | 86 | 5.2.5 KeyEvent: 8 bytes 87 | CARD8: 4 - message-type 88 | CARD8 - down-flag 89 | 2 bytes - padding 90 | CARD32 - key (X-Windows keysym values) 91 | 92 | 5.2.6 PointerEvent: 6 bytes 93 | CARD8: 5 - message-type 94 | CARD8 - button-mask 95 | CARD16 - x-position 96 | CARD16 - y-position 97 | 98 | 5.2.7 ClientCutText: >=9 bytes 99 | CARD8: 6 - message-type 100 | ... 101 | 102 | 103 | Server to Client Messages: 104 | 105 | 5.3.1 FramebufferUpdate 106 | CARD8: 0 - message-type 107 | 1 byte - padding 108 | CARD16 - number-of-rectangles 109 | 110 | CARD16 - x-position 111 | CARD16 - y-position 112 | CARD16 - width 113 | CARD16 - height 114 | CARD16 - encoding-type: 115 | 0 - raw 116 | 1 - copy rectangle 117 | 2 - RRE 118 | 4 - CoRRE 119 | 5 - hextile 120 | 121 | raw: 122 | - width x height pixel values 123 | 124 | copy rectangle: 125 | CARD16 - src-x-position 126 | CARD16 - src-y-position 127 | 128 | RRE: 129 | CARD32 - N number-of-subrectangles 130 | Nxd bytes - background-pixel-value (d bits-per-pixel) 131 | 132 | ... 133 | 134 | 5.3.2 SetColourMapEntries (no support) 135 | CARD8: 1 - message-type 136 | ... 137 | 138 | 5.3.3 Bell 139 | CARD8: 2 - message-type 140 | 141 | 5.3.4 ServerCutText 142 | CARD8: 3 - message-type 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/power.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 80 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/core/input/xtscancodes.js: -------------------------------------------------------------------------------- 1 | var XtScancode = { 2 | "Escape": 0x0001, 3 | "Digit1": 0x0002, 4 | "Digit2": 0x0003, 5 | "Digit3": 0x0004, 6 | "Digit4": 0x0005, 7 | "Digit5": 0x0006, 8 | "Digit6": 0x0007, 9 | "Digit7": 0x0008, 10 | "Digit8": 0x0009, 11 | "Digit9": 0x000A, 12 | "Digit0": 0x000B, 13 | "Minus": 0x000C, 14 | "Equal": 0x000D, 15 | "Backspace": 0x000E, 16 | "Tab": 0x000F, 17 | "KeyQ": 0x0010, 18 | "KeyW": 0x0011, 19 | "KeyE": 0x0012, 20 | "KeyR": 0x0013, 21 | "KeyT": 0x0014, 22 | "KeyY": 0x0015, 23 | "KeyU": 0x0016, 24 | "KeyI": 0x0017, 25 | "KeyO": 0x0018, 26 | "KeyP": 0x0019, 27 | "BracketLeft": 0x001A, 28 | "BracketRight": 0x001B, 29 | "Enter": 0x001C, 30 | "ControlLeft": 0x001D, 31 | "KeyA": 0x001E, 32 | "KeyS": 0x001F, 33 | "KeyD": 0x0020, 34 | "KeyF": 0x0021, 35 | "KeyG": 0x0022, 36 | "KeyH": 0x0023, 37 | "KeyJ": 0x0024, 38 | "KeyK": 0x0025, 39 | "KeyL": 0x0026, 40 | "Semicolon": 0x0027, 41 | "Quote": 0x0028, 42 | "Backquote": 0x0029, 43 | "ShiftLeft": 0x002A, 44 | "Backslash": 0x002B, 45 | "KeyZ": 0x002C, 46 | "KeyX": 0x002D, 47 | "KeyC": 0x002E, 48 | "KeyV": 0x002F, 49 | "KeyB": 0x0030, 50 | "KeyN": 0x0031, 51 | "KeyM": 0x0032, 52 | "Comma": 0x0033, 53 | "Period": 0x0034, 54 | "Slash": 0x0035, 55 | "ShiftRight": 0x0036, 56 | "NumpadMultiply": 0x0037, 57 | "AltLeft": 0x0038, 58 | "Space": 0x0039, 59 | "CapsLock": 0x003A, 60 | "F1": 0x003B, 61 | "F2": 0x003C, 62 | "F3": 0x003D, 63 | "F4": 0x003E, 64 | "F5": 0x003F, 65 | "F6": 0x0040, 66 | "F7": 0x0041, 67 | "F8": 0x0042, 68 | "F9": 0x0043, 69 | "F10": 0x0044, 70 | "Pause": 0xE045, 71 | "ScrollLock": 0x0046, 72 | "Numpad7": 0x0047, 73 | "Numpad8": 0x0048, 74 | "Numpad9": 0x0049, 75 | "NumpadSubtract": 0x004A, 76 | "Numpad4": 0x004B, 77 | "Numpad5": 0x004C, 78 | "Numpad6": 0x004D, 79 | "NumpadAdd": 0x004E, 80 | "Numpad1": 0x004F, 81 | "Numpad2": 0x0050, 82 | "Numpad3": 0x0051, 83 | "Numpad0": 0x0052, 84 | "NumpadDecimal": 0x0053, 85 | "IntlBackslash": 0x0056, 86 | "F11": 0x0057, 87 | "F12": 0x0058, 88 | "IntlYen": 0x007D, 89 | "MediaTrackPrevious": 0xE010, 90 | "MediaTrackNext": 0xE019, 91 | "NumpadEnter": 0xE01C, 92 | "ControlRight": 0xE01D, 93 | "VolumeMute": 0xE020, 94 | "MediaPlayPause": 0xE022, 95 | "MediaStop": 0xE024, 96 | "VolumeDown": 0xE02E, 97 | "VolumeUp": 0xE030, 98 | "BrowserHome": 0xE032, 99 | "NumpadDivide": 0xE035, 100 | "PrintScreen": 0xE037, 101 | "AltRight": 0xE038, 102 | "NumLock": 0x0045, 103 | "Home": 0xE047, 104 | "ArrowUp": 0xE048, 105 | "PageUp": 0xE049, 106 | "ArrowLeft": 0xE04B, 107 | "ArrowRight": 0xE04D, 108 | "End": 0xE04F, 109 | "ArrowDown": 0xE050, 110 | "PageDown": 0xE051, 111 | "Insert": 0xE052, 112 | "Delete": 0xE053, 113 | "MetaLeft": 0xE05B, 114 | "MetaRight": 0xE05C, 115 | "OSLeft": 0xE05B, // OSLeft and OSRight are kept for compatability since 116 | "OSRight": 0xE05C, // Firefox haven't updated to MetaLeft and MetaRight yet 117 | "ContextMenu": 0xE05D, 118 | "BrowserSearch": 0xE065, 119 | "BrowserFavorites": 0xE066, 120 | "BrowserRefresh": 0xE067, 121 | "BrowserStop": 0xE068, 122 | "BrowserForward": 0xE069, 123 | "BrowserBack": 0xE06A, 124 | "NumpadComma": 0x007E, 125 | "NumpadEqual": 0x0059, 126 | "F13": 0x0064, 127 | "F14": 0x0065, 128 | "F15": 0x0066, 129 | "F16": 0x0067, 130 | "F17": 0x0068, 131 | "F18": 0x0069, 132 | "F19": 0x006A, 133 | "F20": 0x006B, 134 | "F21": 0x006C, 135 | "F22": 0x006D, 136 | "F23": 0x006E, 137 | "F24": 0x0076, 138 | "KanaMode": 0x0070, 139 | "Lang2": 0x0071, 140 | "Lang1": 0x0072, 141 | "IntlRo": 0x0073, 142 | "Convert": 0x0079, 143 | "NonConvert": 0x007B, 144 | "LaunchApp2": 0xE021, 145 | "Power": 0xE05E, 146 | "LaunchApp1": 0xE06B, 147 | "LaunchMail": 0xE06C, 148 | "MediaSelect": 0xE06D, 149 | }; 150 | 151 | /* [module] export default XtScancode */ 152 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/tests/assertions.js: -------------------------------------------------------------------------------- 1 | // some useful assertions for noVNC 2 | chai.use(function (_chai, utils) { 3 | _chai.Assertion.addMethod('displayed', function (target_data) { 4 | var obj = this._obj; 5 | var ctx = obj._target.getContext('2d'); 6 | var data_cl = ctx.getImageData(0, 0, obj._target.width, obj._target.height).data; 7 | // NB(directxman12): PhantomJS 1.x doesn't implement Uint8ClampedArray, so work around that 8 | var data = new Uint8Array(data_cl); 9 | var same = true; 10 | var len = data_cl.length; 11 | if (len != target_data.length) { 12 | same = false; 13 | } else { 14 | for (var i = 0; i < len; i++) { 15 | if (data[i] != target_data[i]) { 16 | same = false; 17 | break; 18 | } 19 | } 20 | } 21 | if (!same) { 22 | console.log("expected data: %o, actual data: %o", target_data, data); 23 | } 24 | this.assert(same, 25 | "expected #{this} to have displayed the image #{exp}, but instead it displayed #{act}", 26 | "expected #{this} not to have displayed the image #{act}", 27 | target_data, 28 | data); 29 | }); 30 | 31 | _chai.Assertion.addMethod('sent', function (target_data) { 32 | var obj = this._obj; 33 | obj.inspect = function () { 34 | var res = { _websocket: obj._websocket, rQi: obj._rQi, _rQ: new Uint8Array(obj._rQ.buffer, 0, obj._rQlen), 35 | _sQ: new Uint8Array(obj._sQ.buffer, 0, obj._sQlen) }; 36 | res.prototype = obj; 37 | return res; 38 | }; 39 | var data = obj._websocket._get_sent_data(); 40 | var same = true; 41 | if (data.length != target_data.length) { 42 | same = false; 43 | } else { 44 | for (var i = 0; i < data.length; i++) { 45 | if (data[i] != target_data[i]) { 46 | same = false; 47 | break; 48 | } 49 | } 50 | } 51 | if (!same) { 52 | console.log("expected data: %o, actual data: %o", target_data, data); 53 | } 54 | this.assert(same, 55 | "expected #{this} to have sent the data #{exp}, but it actually sent #{act}", 56 | "expected #{this} not to have sent the data #{act}", 57 | Array.prototype.slice.call(target_data), 58 | Array.prototype.slice.call(data)); 59 | }); 60 | 61 | _chai.Assertion.addProperty('array', function () { 62 | utils.flag(this, 'array', true); 63 | }); 64 | 65 | _chai.Assertion.overwriteMethod('equal', function (_super) { 66 | return function assertArrayEqual(target) { 67 | if (utils.flag(this, 'array')) { 68 | var obj = this._obj; 69 | 70 | var i; 71 | var same = true; 72 | 73 | if (utils.flag(this, 'deep')) { 74 | for (i = 0; i < obj.length; i++) { 75 | if (!utils.eql(obj[i], target[i])) { 76 | same = false; 77 | break; 78 | } 79 | } 80 | 81 | this.assert(same, 82 | "expected #{this} to have elements deeply equal to #{exp}", 83 | "expected #{this} not to have elements deeply equal to #{exp}", 84 | Array.prototype.slice.call(target)); 85 | } else { 86 | for (i = 0; i < obj.length; i++) { 87 | if (obj[i] != target[i]) { 88 | same = false; 89 | break; 90 | } 91 | } 92 | 93 | this.assert(same, 94 | "expected #{this} to have elements equal to #{exp}", 95 | "expected #{this} not to have elements equal to #{exp}", 96 | Array.prototype.slice.call(target)); 97 | } 98 | } else { 99 | _super.apply(this, arguments); 100 | } 101 | }; 102 | }); 103 | }); 104 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/app/images/clipboard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 82 | 90 | 95 | 100 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /image/usr/lib/noVNC/utils/websockify/other/websockify.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # A WebSocket to TCP socket proxy 4 | # Copyright 2011 Joel Martin 5 | # Licensed under LGPL version 3 (see docs/LICENSE.LGPL-3) 6 | 7 | require 'socket' 8 | $: << "other" 9 | $: << "../other" 10 | require 'websocket' 11 | require 'optparse' 12 | 13 | # Proxy traffic to and from a WebSockets client to a normal TCP 14 | # socket server target. All traffic to/from the client is base64 15 | # encoded/decoded to allow binary data to be sent/received to/from 16 | # the target. 17 | class WebSocketProxy < WebSocketServer 18 | 19 | @@Traffic_legend = " 20 | Traffic Legend: 21 | } - Client receive 22 | }. - Client receive partial 23 | { - Target receive 24 | 25 | > - Target send 26 | >. - Target send partial 27 | < - Client send 28 | <. - Client send partial 29 | " 30 | 31 | 32 | def initialize(opts) 33 | vmsg "in WebSocketProxy.initialize" 34 | 35 | super(opts) 36 | 37 | @target_host = opts["target_host"] 38 | @target_port = opts["target_port"] 39 | end 40 | 41 | # Echo back whatever is received 42 | def new_websocket_client(client) 43 | 44 | msg "connecting to: %s:%s" % [@target_host, @target_port] 45 | tsock = TCPSocket.open(@target_host, @target_port) 46 | 47 | if @verbose then puts @@Traffic_legend end 48 | 49 | begin 50 | do_proxy(client, tsock) 51 | rescue 52 | tsock.shutdown(Socket::SHUT_RDWR) 53 | tsock.close 54 | raise 55 | end 56 | end 57 | 58 | # Proxy client WebSocket to normal target socket. 59 | def do_proxy(client, target) 60 | cqueue = [] 61 | c_pend = 0 62 | tqueue = [] 63 | rlist = [client, target] 64 | 65 | loop do 66 | wlist = [] 67 | 68 | if tqueue.length > 0 69 | wlist << target 70 | end 71 | if cqueue.length > 0 || c_pend > 0 72 | wlist << client 73 | end 74 | 75 | ins, outs, excepts = IO.select(rlist, wlist, nil, 0.001) 76 | if excepts && excepts.length > 0 77 | raise Exception, "Socket exception" 78 | end 79 | 80 | # Send queued client data to the target 81 | if outs && outs.include?(target) 82 | dat = tqueue.shift 83 | sent = target.send(dat, 0) 84 | if sent == dat.length 85 | traffic ">" 86 | else 87 | tqueue.unshift(dat[sent...dat.length]) 88 | traffic ".>" 89 | end 90 | end 91 | 92 | # Receive target data and queue for the client 93 | if ins && ins.include?(target) 94 | buf = target.recv(@@Buffer_size) 95 | if buf.length == 0 96 | raise EClose, "Target closed" 97 | end 98 | 99 | cqueue << buf 100 | traffic "{" 101 | end 102 | 103 | # Encode and send queued data to the client 104 | if outs && outs.include?(client) 105 | c_pend = send_frames(cqueue) 106 | cqueue = [] 107 | end 108 | 109 | # Receive client data, decode it, and send it back 110 | if ins && ins.include?(client) 111 | frames, closed = recv_frames 112 | tqueue += frames 113 | 114 | if closed 115 | send_close 116 | raise EClose, closed 117 | end 118 | end 119 | 120 | end # loop 121 | end 122 | end 123 | 124 | # Parse parameters 125 | opts = {} 126 | parser = OptionParser.new do |o| 127 | o.on('--verbose', '-v') { |b| opts['verbose'] = b } 128 | o.parse! 129 | end 130 | 131 | if ARGV.length < 2 132 | puts "Too few arguments" 133 | exit 2 134 | end 135 | 136 | # Parse host:port and convert ports to numbers 137 | if ARGV[0].count(":") > 0 138 | opts['listen_host'], _, opts['listen_port'] = ARGV[0].rpartition(':') 139 | else 140 | opts['listen_host'], opts['listen_port'] = nil, ARGV[0] 141 | end 142 | 143 | begin 144 | opts['listen_port'] = opts['listen_port'].to_i 145 | rescue 146 | puts "Error parsing listen port" 147 | exit 2 148 | end 149 | 150 | if ARGV[1].count(":") > 0 151 | opts['target_host'], _, opts['target_port'] = ARGV[1].rpartition(':') 152 | else 153 | puts "Error parsing target" 154 | exit 2 155 | end 156 | 157 | begin 158 | opts['target_port'] = opts['target_port'].to_i 159 | rescue 160 | puts "Error parsing target port" 161 | exit 2 162 | end 163 | 164 | puts "Starting server on #{opts['listen_host']}:#{opts['listen_port']}" 165 | server = WebSocketProxy.new(opts) 166 | server.start(100) 167 | server.join 168 | 169 | puts "Server has been terminated" 170 | 171 | # vim: sw=2 172 | --------------------------------------------------------------------------------