[novnc] initial import (#822187)

Pádraig Brady pbrady at fedoraproject.org
Tue Jun 12 14:06:12 UTC 2012


commit 69cfe5640ac907f53db3bffc62a02f5dbf54c00b
Author: Pádraig Brady <P at draigBrady.com>
Date:   Tue Jun 12 15:04:46 2012 +0100

    initial import (#822187)

 .gitignore                        |    1 +
 novnc-0.3-call-websockify.patch   |   25 ++++++
 novnc-0.3-manpage.patch           |   84 ++++++++++++++++++++
 novnc-0.3-nova-wsproxy.patch      |   26 ++++++
 novnc.spec                        |  153 +++++++++++++++++++++++++++++++++++++
 openstack-nova-novncproxy.init    |  102 ++++++++++++++++++++++++
 openstack-nova-novncproxy.service |   11 +++
 sources                           |    1 +
 8 files changed, 403 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..cfd8481 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/noVNC-0.3.tar.gz
diff --git a/novnc-0.3-call-websockify.patch b/novnc-0.3-call-websockify.patch
new file mode 100644
index 0000000..7662696
--- /dev/null
+++ b/novnc-0.3-call-websockify.patch
@@ -0,0 +1,25 @@
+From 9abeb6faf34c6413398559a203f82e1de459191c Mon Sep 17 00:00:00 2001
+From: Adam Young <ayoung at redhat.com>
+Date: Fri, 8 Jun 2012 11:10:45 -0400
+Subject: [PATCH] call the websockify executable.
+
+---
+ utils/launch.sh |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/launch.sh b/utils/launch.sh
+index 8afd6e4..baaa472 100755
+--- a/utils/launch.sh
++++ b/utils/launch.sh
+@@ -92,7 +92,7 @@ else
+ fi
+ 
+ echo "Starting webserver and WebSockets proxy on port ${PORT}"
+-${HERE}/wsproxy.py --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
++${HERE}/websockify --web ${WEB} ${CERT:+--cert ${CERT}} ${PORT} ${VNC_DEST} &
+ proxy_pid="$!"
+ sleep 1
+ if ! ps -p ${proxy_pid} >/dev/null; then
+-- 
+1.7.10.2
+
diff --git a/novnc-0.3-manpage.patch b/novnc-0.3-manpage.patch
new file mode 100644
index 0000000..0f93e38
--- /dev/null
+++ b/novnc-0.3-manpage.patch
@@ -0,0 +1,84 @@
+From 42d5fa61a47fb156bf4e6bea7051c9198f8fb938 Mon Sep 17 00:00:00 2001
+From: Adam Young <ayoung at redhat.com>
+Date: Fri, 8 Jun 2012 10:34:38 -0400
+Subject: [PATCH] added Man pages.
+
+---
+ docs/nova-novncproxy.1 |   35 +++++++++++++++++++++++++++++++++++
+ docs/novnc_server.1    |   22 ++++++++++++++++++++++
+ 2 files changed, 57 insertions(+)
+ create mode 100644 docs/nova-novncproxy.1
+ create mode 100644 docs/novnc_server.1
+
+diff --git a/docs/nova-novncproxy.1 b/docs/nova-novncproxy.1
+new file mode 100644
+index 0000000..198b634
+--- /dev/null
++++ b/docs/nova-novncproxy.1
+@@ -0,0 +1,35 @@
++.TH nova-novncproxy 1  "June 8, 2012" "version 0.3" "USER COMMANDS"
++
++.SH NAME
++nova-novncproxy | noVNC proxy for Openstack Nova
++.SH SYNOPSIS
++.B nova-novncproxy [options]
++
++.SH OPTIONS
++.TP
++record : Record sessions to FILE.[session_number]
++.TP
++daemon : Become a daemon (background process)
++.TP
++ssl_only : Disallow non-encrypted connections'),
++.TP
++source_is_ipv6 : Source is ipv6
++.TP
++cert : SSL certificate file
++.TP
++key : SSL key file (if separate from cert)
++.TP
++web : Run webserver on same port. Serve files from DIR.
++.TP
++novncproxy_host : Host on which to listen for incoming requests.  
++			defaults to ='0.0.0.0'
++.TP
++novncproxy_port: Port on which to listen for incoming requests
++               defaults to 6080
++
++
++.SH AUTHOR
++Joel Martin (github at martintribe.org)
++
++.SH SEE ALSO
++websockify(1)
+diff --git a/docs/novnc_server.1 b/docs/novnc_server.1
+new file mode 100644
+index 0000000..5bcbd1b
+--- /dev/null
++++ b/docs/novnc_server.1
+@@ -0,0 +1,22 @@
++.TH novnc_server 1  "June 8, 2012" "version 0.3" "USER COMMANDS"
++
++.SH NAME
++novnc_server | noVNC proxy server
++.SH SYNOPSIS
++.B novnc_server [--listen PORT] [--vnc VNC_HOST:PORT] [--cert CERT]
++
++Starts the WebSockets proxy and a mini-webserver and 
++provides a cut-and-paste URL to go to.
++
++    --listen PORT         Port for proxy/webserver to listen on
++                          Default: 6080
++    --vnc VNC_HOST:PORT   VNC server host:port proxy target
++                          Default: localhost:5900
++    --cert CERT           Path to combined cert/key file
++                          Default: self.pem
++
++.SH AUTHOR
++Joel Martin (github at martintribe.org)
++
++.SH SEE ALSO
++websockify(1)
+-- 
+1.7.10.2
+
diff --git a/novnc-0.3-nova-wsproxy.patch b/novnc-0.3-nova-wsproxy.patch
new file mode 100644
index 0000000..4d00ece
--- /dev/null
+++ b/novnc-0.3-nova-wsproxy.patch
@@ -0,0 +1,26 @@
+From dec9511e0008c28462d7a98df0629479ab0c103d Mon Sep 17 00:00:00 2001
+From: Adam Young <ayoung at redhat.com>
+Date: Thu, 7 Jun 2012 10:10:41 -0400
+Subject: [PATCH] IN the final RPM, there is no wsproxy,  but rather just
+ websockify.
+
+---
+ utils/nova-novncproxy |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/nova-novncproxy b/utils/nova-novncproxy
+index a920492..a172212 100755
+--- a/utils/nova-novncproxy
++++ b/utils/nova-novncproxy
+@@ -26,7 +26,7 @@ import Cookie
+ import socket
+ import sys
+ 
+-import wsproxy
++import websockify as wsproxy
+ 
+ from nova import context
+ from nova import flags
+-- 
+1.7.10.2
+
diff --git a/novnc.spec b/novnc.spec
new file mode 100644
index 0000000..ee0ffd0
--- /dev/null
+++ b/novnc.spec
@@ -0,0 +1,153 @@
+# If neither fedora nor rhel was defined, try to guess them from %%{dist}
+%if !0%{?rhel} && !0%{?fedora}
+%{expand:%(echo "%{?dist}" | \
+  sed -ne 's/^\.el\([0-9]\+\).*/%%define rhel \1/p')}
+%{expand:%(echo "%{?dist}" | \
+  sed -ne 's/^\.fc\?\([0-9]\+\).*/%%define fedora \1/p')}
+%endif
+
+%if 0%{?fedora} >= 15  ||  0%{?rhel} >= 7
+%define with_systemd 1
+%else
+%define with_systemd 0
+%define _initdir  /etc/rc.d/init.d
+%endif
+
+Name:           novnc
+Version:        0.3
+Release:        6%{?dist}
+Summary:        VNC client using HTML5 (Web Sockets, Canvas) with encryption support
+
+License:        GPLv3
+URL:            https://github.com/kanaka/noVNC
+Source0:        https://github.com/downloads/kanaka/noVNC/noVNC-%{version}.tar.gz
+Source1:        openstack-nova-novncproxy.service
+Source2:        openstack-nova-novncproxy.init
+
+
+Patch0:         novnc-0.3-nova-wsproxy.patch
+Patch1:         novnc-0.3-manpage.patch
+Patch2:         novnc-0.3-call-websockify.patch
+BuildArch:      noarch
+BuildRequires:  python2-devel
+
+%description
+Websocket implementation of VNC client
+
+
+%package -n openstack-nova-novncproxy
+Summary:        Proxy server for noVNC traffic over Websockets
+Requires:       numpy
+Requires:       python-websockify
+
+%if %{with_systemd}
+Requires(post): systemd-units
+Requires(post): systemd-sysv
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%else
+Requires(post): chkconfig
+Requires(preun): chkconfig
+Requires(preun): initscripts
+%endif
+
+%description -n openstack-nova-novncproxy
+OpenStack Nova noVNC server that proxies VNC traffic over Websockets
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+
+%build
+
+
+%install
+mkdir -p %{buildroot}/%{_usr}/share/novnc/utils
+install -m 444 *html %{buildroot}/%{_usr}/share/novnc
+#provide an index file to prevent default directory browsing
+install -m 444 vnc.html %{buildroot}/%{_usr}/share/novnc/index.html
+
+mkdir -p %{buildroot}/%{_usr}/share/novnc/include/
+install -m 444 include/*.*  %{buildroot}/%{_usr}/share/novnc/include
+mkdir -p %{buildroot}/%{_usr}/share/novnc/images
+install -m 444 images/*.*  %{buildroot}/%{_usr}/share/novnc/images
+
+mkdir -p %{buildroot}/%{_bindir}
+install utils/launch.sh  %{buildroot}/%{_bindir}/novnc_server
+
+install utils/nova-novncproxy %{buildroot}/%{_bindir}
+
+mkdir -p %{buildroot}%{_mandir}/man1/
+install -m 444 docs/nova-novncproxy.1 %{buildroot}%{_mandir}/man1/
+install -m 444 docs/novnc_server.1 %{buildroot}%{_mandir}/man1/
+
+%if %{with_systemd}
+mkdir -p %{buildroot}%{_unitdir}
+install -p -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}
+%else
+mkdir -p %{buildroot}%{_initddir}
+install -p -D -m 755 %{SOURCE2} %{buildroot}%{_initddir}/openstack-nova-novncproxy
+%endif
+
+
+%post -n openstack-nova-novncproxy
+%if %{with_systemd}
+%else
+# This adds the proper /etc/rc*.d links for the script
+/sbin/chkconfig --add openstack-nova-novncproxy
+%endif
+
+%preun -n openstack-nova-novncproxy
+%if %{with_systemd}
+%else
+if [ $1 -eq 0 ] ; then
+    /sbin/service openstack-nova-novncproxy stop >/dev/null 2>&1
+    /sbin/chkconfig --del openstack-nova-novncproxy
+fi
+%endif
+
+
+%files
+%doc README.md LICENSE.txt
+
+%dir %{_usr}/share/novnc
+%{_usr}/share/novnc/*.*
+%dir %{_usr}/share/novnc/include
+%{_usr}/share/novnc/include/*
+%dir %{_usr}/share/novnc/images
+%{_usr}/share/novnc/images/*
+%{_bindir}/novnc_server
+%{_mandir}/man1/novnc_server.1*
+
+
+%files -n openstack-nova-novncproxy
+%{_bindir}/nova-novncproxy
+%{_mandir}/man1/nova-novncproxy.1*
+%if %{with_systemd}
+%{_unitdir}/openstack-nova-novncproxy.service
+%else
+%{_initdir}/openstack-nova-novncproxy
+%endif
+
+%changelog
+* Mon Jun 11 2012 Adam Young <ayoung at redhat.com> - 0.3-6
+- systemd initialization for Nova Proxy
+- system V init script
+- remove Flash binary supporting older browsers
+
+* Tue Jun 8 2012 Adam Young <ayoung at redhat.com> - 0.3-3
+- Added man pages
+- novnc_server usese the websockify executable, not wsproxy.py
+
+* Tue Jun 7 2012 Adam Young <ayoung at redhat.com> - 0.3-2
+- Make Javascript files non-executable, as they are not script files
+- Patch Nova noVNC proxy to use websockify directly
+
+* Tue May 15 2012 Adam Young <ayoung at redhat.com> - 0.3-1
+- Added in support for the Nova noVNC proxy
+- Added files for the images and inclues subdirectories
+
+* Thu May 10 2012 Adam Young <ayoung at redhat.com> - 0.2
+- Initial RPM release.
diff --git a/openstack-nova-novncproxy.init b/openstack-nova-novncproxy.init
new file mode 100644
index 0000000..e88db03
--- /dev/null
+++ b/openstack-nova-novncproxy.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# openstack-nova-novncproxy  OpenStack Nova Console noVNC Proxy
+#
+# chkconfig:   - 98 02
+# description: OpenStack Nova Console noVCN Proxy Server
+
+### BEGIN INIT INFO
+# Provides:
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Stop: 0 1 6
+# Short-Description: OpenStack Nova Console noVNC Proxy
+# Description: OpenStack Nova Console noVNC Proxy Server
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+suffix=novncproxy
+prog=openstack-nova-$suffix
+exec="/usr/bin/nova-$suffix"
+config="/etc/nova/nova.conf"
+pidfile="/var/run/nova/nova-$suffix.pid"
+logfile="/var/log/nova/$suffix.log"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user nova --pidfile $pidfile "$exec --flagfile=$config --web /usr/share/novnc/ &>/dev/null & echo \$! > $pidfile"
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -p $pidfile $prog
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    restart
+}
+
+force_reload() {
+    restart
+}
+
+rh_status() {
+    status -p $pidfile $prog
+}
+
+rh_status_q() {
+    rh_status >/dev/null 2>&1
+}
+
+
+case "$1" in
+    start)
+        rh_status_q && exit 0
+        $1
+        ;;
+    stop)
+        rh_status_q || exit 0
+        $1
+        ;;
+    restart)
+        $1
+        ;;
+    reload)
+        rh_status_q || exit 7
+        $1
+        ;;
+    force-reload)
+        force_reload
+        ;;
+    status)
+        rh_status
+        ;;
+    condrestart|try-restart)
+        rh_status_q || exit 0
+        restart
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $?
\ No newline at end of file
diff --git a/openstack-nova-novncproxy.service b/openstack-nova-novncproxy.service
new file mode 100644
index 0000000..04464b5
--- /dev/null
+++ b/openstack-nova-novncproxy.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenStack Nova NoVNC Proxy Server
+After=syslog.target network.target
+
+[Service]
+Type=simple
+User=nova
+ExecStart=/usr/bin/nova-novncproxy --flagfile=/etc/nova/nova.conf --web /usr/share/novnc/
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sources b/sources
index e69de29..aac5588 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+95d3c58921fa188c179491e8ef2acc12  noVNC-0.3.tar.gz


More information about the scm-commits mailing list