From e37dd15bbf8683bab8454ea0eec8e9968ce982b2 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 28 Mar 2008 22:57:29 -0400 Subject: [PATCH 01/16] Moved sipb-xen-www into a package svn path=/trunk/web; revision=303 --- Makefile => code/Makefile | 0 cache_acls.py => code/cache_acls.py | 0 controls.py => code/controls.py | 0 getafsgroups.py => code/getafsgroups.py | 0 code/iptables.rules | 17 --- main.py => code/main.py | 0 {static => code/static}/VncViewer.jar | 0 {static => code/static}/about.html | 0 {static => code/static}/layout.css | 0 {static => code/static}/prototype.js | 0 {static => code/static}/style.css | 0 {templates => code/templates}/Makefile | 0 {templates => code/templates}/__init__.py | 0 {templates => code/templates}/command.tmpl | 0 {templates => code/templates}/create.tmpl | 0 {templates => code/templates}/error.tmpl | 0 {templates => code/templates}/functions.tmpl | 0 {templates => code/templates}/help.tmpl | 0 {templates => code/templates}/info.tmpl | 0 {templates => code/templates}/invalid.tmpl | 0 {templates => code/templates}/list.tmpl | 0 {templates => code/templates}/skeleton.tmpl | 0 {templates => code/templates}/vnc.tmpl | 0 validation.py => code/validation.py | 0 webcommon.py => code/webcommon.py | 0 xen-ips => code/xen-ips | 0 debian/changelog | 4 +- debian/control | 8 +- debian/rules | 4 +- debian/sipb-xen-iptables.init | 112 -------------------- ...b-xen-iptables.install => sipb-xen-www.install} | 0 debian/sipb-xen-www.postinst | 43 ++++++++ 32 files changed, 51 insertions(+), 137 deletions(-) rename Makefile => code/Makefile (100%) rename cache_acls.py => code/cache_acls.py (100%) rename controls.py => code/controls.py (100%) rename getafsgroups.py => code/getafsgroups.py (100%) delete mode 100644 code/iptables.rules rename main.py => code/main.py (100%) rename {static => code/static}/VncViewer.jar (100%) rename {static => code/static}/about.html (100%) rename {static => code/static}/layout.css (100%) rename {static => code/static}/prototype.js (100%) rename {static => code/static}/style.css (100%) rename {templates => code/templates}/Makefile (100%) rename {templates => code/templates}/__init__.py (100%) rename {templates => code/templates}/command.tmpl (100%) rename {templates => code/templates}/create.tmpl (100%) rename {templates => code/templates}/error.tmpl (100%) rename {templates => code/templates}/functions.tmpl (100%) rename {templates => code/templates}/help.tmpl (100%) rename {templates => code/templates}/info.tmpl (100%) rename {templates => code/templates}/invalid.tmpl (100%) rename {templates => code/templates}/list.tmpl (100%) rename {templates => code/templates}/skeleton.tmpl (100%) rename {templates => code/templates}/vnc.tmpl (100%) rename validation.py => code/validation.py (100%) rename webcommon.py => code/webcommon.py (100%) rename xen-ips => code/xen-ips (100%) delete mode 100644 debian/sipb-xen-iptables.init rename debian/{sipb-xen-iptables.install => sipb-xen-www.install} (100%) create mode 100755 debian/sipb-xen-www.postinst diff --git a/Makefile b/code/Makefile similarity index 100% rename from Makefile rename to code/Makefile diff --git a/cache_acls.py b/code/cache_acls.py similarity index 100% rename from cache_acls.py rename to code/cache_acls.py diff --git a/controls.py b/code/controls.py similarity index 100% rename from controls.py rename to code/controls.py diff --git a/getafsgroups.py b/code/getafsgroups.py similarity index 100% rename from getafsgroups.py rename to code/getafsgroups.py diff --git a/code/iptables.rules b/code/iptables.rules deleted file mode 100644 index 15b079a..0000000 --- a/code/iptables.rules +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by iptables-save v1.3.6 on Mon Oct 8 01:59:16 2007 -*filter -:INPUT ACCEPT [366:44912] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [292:53151] --A FORWARD -d 18.181.0.60 -i eth0 -o eth0 -p tcp -m tcp --dport 10003 -j ACCEPT -COMMIT -# Completed on Mon Oct 8 01:59:16 2007 -# Generated by iptables-save v1.3.6 on Mon Oct 8 01:59:16 2007 -*nat -:PREROUTING ACCEPT [5:300] -:POSTROUTING ACCEPT [8:674] -:OUTPUT ACCEPT [8:674] --A PREROUTING -s ! 18.181.0.60 -i eth0 -p tcp -m tcp --dport 10003 -j DNAT --to-destination 18.181.0.60:10003 --A POSTROUTING -d 18.181.0.60 -o eth0 -p tcp -m tcp --dport 10003 -j SNAT --to-source 18.181.0.62 -COMMIT -# Completed on Mon Oct 8 01:59:16 2007 diff --git a/main.py b/code/main.py similarity index 100% rename from main.py rename to code/main.py diff --git a/static/VncViewer.jar b/code/static/VncViewer.jar similarity index 100% rename from static/VncViewer.jar rename to code/static/VncViewer.jar diff --git a/static/about.html b/code/static/about.html similarity index 100% rename from static/about.html rename to code/static/about.html diff --git a/static/layout.css b/code/static/layout.css similarity index 100% rename from static/layout.css rename to code/static/layout.css diff --git a/static/prototype.js b/code/static/prototype.js similarity index 100% rename from static/prototype.js rename to code/static/prototype.js diff --git a/static/style.css b/code/static/style.css similarity index 100% rename from static/style.css rename to code/static/style.css diff --git a/templates/Makefile b/code/templates/Makefile similarity index 100% rename from templates/Makefile rename to code/templates/Makefile diff --git a/templates/__init__.py b/code/templates/__init__.py similarity index 100% rename from templates/__init__.py rename to code/templates/__init__.py diff --git a/templates/command.tmpl b/code/templates/command.tmpl similarity index 100% rename from templates/command.tmpl rename to code/templates/command.tmpl diff --git a/templates/create.tmpl b/code/templates/create.tmpl similarity index 100% rename from templates/create.tmpl rename to code/templates/create.tmpl diff --git a/templates/error.tmpl b/code/templates/error.tmpl similarity index 100% rename from templates/error.tmpl rename to code/templates/error.tmpl diff --git a/templates/functions.tmpl b/code/templates/functions.tmpl similarity index 100% rename from templates/functions.tmpl rename to code/templates/functions.tmpl diff --git a/templates/help.tmpl b/code/templates/help.tmpl similarity index 100% rename from templates/help.tmpl rename to code/templates/help.tmpl diff --git a/templates/info.tmpl b/code/templates/info.tmpl similarity index 100% rename from templates/info.tmpl rename to code/templates/info.tmpl diff --git a/templates/invalid.tmpl b/code/templates/invalid.tmpl similarity index 100% rename from templates/invalid.tmpl rename to code/templates/invalid.tmpl diff --git a/templates/list.tmpl b/code/templates/list.tmpl similarity index 100% rename from templates/list.tmpl rename to code/templates/list.tmpl diff --git a/templates/skeleton.tmpl b/code/templates/skeleton.tmpl similarity index 100% rename from templates/skeleton.tmpl rename to code/templates/skeleton.tmpl diff --git a/templates/vnc.tmpl b/code/templates/vnc.tmpl similarity index 100% rename from templates/vnc.tmpl rename to code/templates/vnc.tmpl diff --git a/validation.py b/code/validation.py similarity index 100% rename from validation.py rename to code/validation.py diff --git a/webcommon.py b/code/webcommon.py similarity index 100% rename from webcommon.py rename to code/webcommon.py diff --git a/xen-ips b/code/xen-ips similarity index 100% rename from xen-ips rename to code/xen-ips diff --git a/debian/changelog b/debian/changelog index e17189a..cdc7a10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ -sipb-xen-iptables (1) unstable; urgency=low +sipb-xen-www (1) unstable; urgency=low * Initial Release. - -- SIPB Xen Project Sun, 25 Feb 2008 00:05:12 -0500 + -- SIPB Xen Project Sun, 28 Mar 2008 22:43:12 -0500 diff --git a/debian/control b/debian/control index 2f7912d..0f156c5 100644 --- a/debian/control +++ b/debian/control @@ -1,11 +1,11 @@ -Source: sipb-xen-iptables +Source: sipb-xen-www Section: base Priority: extra Maintainer: SIPB Xen Project Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), subversion Standards-Version: 3.7.2 -Package: sipb-xen-iptables +Package: sipb-xen-www Architecture: all -Depends: ${misc:Depends}, iptables -Description: Configure at boot the iptables rules for the VNC proxy client +Depends: ${misc:Depends}, python-cheetah, python-simple-json, sipb-xen-database-client, sipb-xen-vnc-client +Description: Install the sipb-xen-dev website diff --git a/debian/rules b/debian/rules index 3f9af0f..6e66d75 100755 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,5 @@ include /usr/share/cdbs/1/rules/debhelper.mk -binary-fixup/sipb-xen-iptables:: - svn co https://sipb-xen-dev.mit.edu:1111/trunk/packages/sipb-xen-iptables/code/ $(DEB_DESTDIR)/usr/local/share/sipb-xen-iptables +binary-fixup/sipb-xen-dhcp:: + svn co https://sipb-xen-dev.mit.edu:1111/trunk/packages/sipb-xen-www/code/ $(DEB_DESTDIR)/var/www/sipb-xen-www diff --git a/debian/sipb-xen-iptables.init b/debian/sipb-xen-iptables.init deleted file mode 100644 index 49f92d3..0000000 --- a/debian/sipb-xen-iptables.init +++ /dev/null @@ -1,112 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: sipb-xen-iptables -# Required-Start: $local_fs $remote_fs -# Required-Stop: $local_fs $remote_fs -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: sipb-xen iptables rules -# Description: -### END INIT INFO - -# Author: SIPB Xen Project - -# Do NOT "set -e" - -# PATH should only include /usr/* if it runs after the mountnfs.sh script -PATH=/sbin:/usr/sbin:/bin:/usr/bin -DESC="Load the sipb-xen iptables rules" -NAME=sipb-xen-iptables -RULES=/usr/local/share/sipb-xen-iptables/iptables.rules - -# Read configuration variable file if it is present -[ -r /etc/default/$NAME ] && . /etc/default/$NAME - -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - -# Define LSB log_* functions. -# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. -. /lib/lsb/init-functions - -# -# Function that starts the daemon/service -# -do_start() -{ - # Return - # 0 if daemon has been started - # 1 if daemon was already running - # 2 if daemon could not be started - /sbin/iptables-restore < $RULES -} - -# -# Function that stops the daemon/service -# -do_stop() -{ - # Return - # 0 if daemon has been stopped - # 1 if daemon was already stopped - # 2 if daemon could not be stopped - # other if a failure occurred - return 0 -} - -case "$1" in - start) - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" - do_stop - case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; - esac - ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # - log_daemon_msg "Restarting $DESC" "$NAME" - do_stop - case "$?" in - 0|1) - do_start - case "$?" in - 0) log_end_msg 0 ;; - 1) log_end_msg 1 ;; # Old process is still running - *) log_end_msg 1 ;; # Failed to start - esac - ;; - *) - # Failed to stop - log_end_msg 1 - ;; - esac - ;; - *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 - exit 3 - ;; -esac - -: diff --git a/debian/sipb-xen-iptables.install b/debian/sipb-xen-www.install similarity index 100% rename from debian/sipb-xen-iptables.install rename to debian/sipb-xen-www.install diff --git a/debian/sipb-xen-www.postinst b/debian/sipb-xen-www.postinst new file mode 100755 index 0000000..e4d526b --- /dev/null +++ b/debian/sipb-xen-www.postinst @@ -0,0 +1,43 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + cd /var/www/sipb-xen-www + make clean && make all + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + -- 1.7.9.5 From 03ec8cfff08c8a3c507425d9ecdc95a48ac9bc81 Mon Sep 17 00:00:00 2001 From: Eric Price Date: Fri, 28 Mar 2008 23:09:08 -0400 Subject: [PATCH 02/16] Fix the Makefile to recursively apply make. svn path=/trunk/packages/sipb-xen-www/; revision=304 --- code/Makefile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/code/Makefile b/code/Makefile index aa083e2..582293f 100644 --- a/code/Makefile +++ b/code/Makefile @@ -1,13 +1,11 @@ -TEMPLATES=$(wildcard *.tmpl) -OUTPUTS=$(TEMPLATES:.tmpl=.py) +DIRS = templates -all: ${OUTPUTS} - -%.py: %.tmpl - cheetah compile $< - -#${OUTPUTS}:${TEMPLATES} -# cheetah compile $^ +all: + for dir in $(DIRS); do \ + (cd $$dir; $(MAKE) all); \ + done clean: - @rm -f ${OUTPUTS} *.pyo *.pyc *.py.bak + for dir in $(DIRS); do \ + (cd $$dir; $(MAKE) clean); \ + done -- 1.7.9.5 From aafb2e4ddf4ce67cbaa037593d12aa106dd616ca Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 28 Mar 2008 23:18:23 -0400 Subject: [PATCH 03/16] If I'm lucky, I might have a sipb-xen-vnc-client package, too svn path=/trunk/packages/sipb-xen-www/; revision=305 --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 6e66d75..4ffbc7d 100755 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,5 @@ include /usr/share/cdbs/1/rules/debhelper.mk -binary-fixup/sipb-xen-dhcp:: +binary-fixup/sipb-xen-www:: svn co https://sipb-xen-dev.mit.edu:1111/trunk/packages/sipb-xen-www/code/ $(DEB_DESTDIR)/var/www/sipb-xen-www -- 1.7.9.5 From 839debc6d4ce067b109e1300c9fdf8fdee768844 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 28 Mar 2008 23:31:01 -0400 Subject: [PATCH 04/16] Today is, in fact, not a Sunday svn path=/trunk/packages/sipb-xen-iptables/; revision=306 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index cdc7a10..7fff681 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,5 @@ sipb-xen-www (1) unstable; urgency=low * Initial Release. - -- SIPB Xen Project Sun, 28 Mar 2008 22:43:12 -0500 + -- SIPB Xen Project Fri, 28 Mar 2008 22:43:12 -0500 -- 1.7.9.5 From 679f2690b1147860be563a54b8739b555c6d4aed Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 29 Mar 2008 11:37:22 -0400 Subject: [PATCH 05/16] keep /var/www/sipb-xen-www writable by our accounts svn path=/trunk/packages/sipb-xen-www/; revision=307 --- debian/sipb-xen-www.postinst | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/sipb-xen-www.postinst b/debian/sipb-xen-www.postinst index e4d526b..96ed42b 100755 --- a/debian/sipb-xen-www.postinst +++ b/debian/sipb-xen-www.postinst @@ -22,6 +22,7 @@ case "$1" in configure) cd /var/www/sipb-xen-www make clean && make all + chgrp -R sipb-xen . ;; abort-upgrade|abort-remove|abort-deconfigure) -- 1.7.9.5 From 1d02c55e91f06430c097bd5023ceb5c5782a52b8 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 29 Mar 2008 11:40:40 -0400 Subject: [PATCH 06/16] err, actually writable svn path=/trunk/packages/sipb-xen-www/; revision=308 --- debian/sipb-xen-www.postinst | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/sipb-xen-www.postinst b/debian/sipb-xen-www.postinst index 96ed42b..5ddf6f9 100755 --- a/debian/sipb-xen-www.postinst +++ b/debian/sipb-xen-www.postinst @@ -23,6 +23,7 @@ case "$1" in cd /var/www/sipb-xen-www make clean && make all chgrp -R sipb-xen . + chmod -R g+w . ;; abort-upgrade|abort-remove|abort-deconfigure) -- 1.7.9.5 From 36097be5e255b54e405def8be29c780ecaa42764 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 29 Mar 2008 11:54:58 -0400 Subject: [PATCH 07/16] move framebuffer tip to /help page svn path=/trunk/packages/sipb-xen-www/; revision=309 --- code/main.py | 8 +++++++- code/templates/vnc.tmpl | 8 ++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/main.py b/code/main.py index a3c84ee..31465f6 100755 --- a/code/main.py +++ b/code/main.py @@ -445,7 +445,13 @@ group.""", quotas=""" Quotas are determined on a per-locker basis. Each quota may have a maximum of 512 megabytes of active ram, 50 gigabytes of disk, and 4 -active machines.""" +active machines.""", + console=""" +Framebuffer: At a Linux boot prompt in your VM, try +setting fb=false to disable the framebuffer. If you don't, +your machine will run just fine, but the applet's display of the +console will suffer artifacts. +""" ) if not subjects: diff --git a/code/templates/vnc.tmpl b/code/templates/vnc.tmpl index a0b8b01..7ae0607 100644 --- a/code/templates/vnc.tmpl +++ b/code/templates/vnc.tmpl @@ -6,13 +6,13 @@ Console to $machine.name #end def #def body -

Console

+

Console to ${machine.name}

#if not $on

Your machine appears to be off.

#else if not $has_vnc

Your machine appears to not be accepting VNC connections. Perhaps you have a ParaVM machine?

#end if -

Here is a console to ${machine.name}.

+

See tips about framebuffer and other issues.

@@ -22,8 +22,4 @@ Console to $machine.name -

Tip: At a Linux boot prompt, try setting fb=false to disable the framebuffer. If you don't, your machine will run just fine, but this applet's display of the console will suffer artifacts.

-#* -java VncViewer HOST black-mesa PORT 10003 VMNAME tabbott_test AUTHTOKEN quentin SocketFactory VNCProxyConnectSocketFactory -*# #end def -- 1.7.9.5 From 6f66e68eedee3d72f4bd129dafe17e4df35ba7b5 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 29 Mar 2008 18:25:41 -0400 Subject: [PATCH 08/16] Fixed a bug in the DNS startup script and the dependencies for sipb-xen-www svn path=/trunk/packages/sipb-xen-www/; revision=319 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 0f156c5..a4a624a 100644 --- a/debian/control +++ b/debian/control @@ -7,5 +7,5 @@ Standards-Version: 3.7.2 Package: sipb-xen-www Architecture: all -Depends: ${misc:Depends}, python-cheetah, python-simple-json, sipb-xen-database-client, sipb-xen-vnc-client +Depends: ${misc:Depends}, python-cheetah, python-simplejson, sipb-xen-database-common, sipb-xen-vnc-client Description: Install the sipb-xen-dev website -- 1.7.9.5 From 0085ac96816e93f5790e6fc6c78ce53ba57bf39f Mon Sep 17 00:00:00 2001 From: Eric Price Date: Sat, 29 Mar 2008 18:44:45 -0400 Subject: [PATCH 09/16] Preinst script to create sipb-xen group. svn path=/trunk/packages/sipb-xen-www/; revision=332 --- debian/sipb-xen-www.preinst | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 debian/sipb-xen-www.preinst diff --git a/debian/sipb-xen-www.preinst b/debian/sipb-xen-www.preinst new file mode 100644 index 0000000..d5afbad --- /dev/null +++ b/debian/sipb-xen-www.preinst @@ -0,0 +1,40 @@ +#!/bin/sh +# preinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + install|upgrade) + if ! getent group sipb-xen > /dev/null; then + addgroup --system sipb-xen + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + -- 1.7.9.5 From 9fc8bacc9b94dae1bc8668d0bf8f3e9ac4fbb0d5 Mon Sep 17 00:00:00 2001 From: Eric Price Date: Sat, 29 Mar 2008 18:45:30 -0400 Subject: [PATCH 10/16] Increment debian version. svn path=/trunk/packages/sipb-xen-www/; revision=333 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7fff681..8a6ba5e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-www (2) unstable; urgency=low + + * Create sipb-xen group in preinst script. + + -- Eric Price Sat, 29 Mar 2008 18:45:02 -0400 + sipb-xen-www (1) unstable; urgency=low * Initial Release. -- 1.7.9.5 From eb9adb539fb47ab4b5c4e859cf119b554b9116cb Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 30 Mar 2008 04:28:10 -0400 Subject: [PATCH 11/16] expose cloning autoinstaller in web interface svn path=/trunk/packages/sipb-xen-www/; revision=340 --- code/controls.py | 8 +++++++- code/main.py | 7 ++++++- code/templates/list.tmpl | 6 ++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/code/controls.py b/code/controls.py index 7134668..b2c60d5 100644 --- a/code/controls.py +++ b/code/controls.py @@ -68,6 +68,10 @@ def makeDisks(machine): for disk in machine.disks: lvcreate(machine, disk) +def lvcopy(machine_orig_name, machine, rootpw): + """Copy a golden image onto a machine's disk""" + remctl('web', 'lvcopy', machine_orig_name, machine.name, rootpw) + def bootMachine(machine, cdtype): """Boot a machine with a given boot CD. @@ -95,7 +99,7 @@ def unregisterMachine(machine): """Unregister a machine to not be controlled by the web interface""" remctl('web', 'unregister', machine.name) -def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom): +def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom, clone_from): """Create a VM and put it in the database""" # put stuff in the table transaction = ctx.current.create_transaction() @@ -136,6 +140,8 @@ def createVm(owner, contact, name, memory, disk_size, is_hvm, cdrom): raise registerMachine(machine) makeDisks(machine) + if clone_from: + lvcopy(clone_from, machine, 'password') # tell it to boot with cdrom bootMachine(machine, cdrom) return machine diff --git a/code/main.py b/code/main.py index 31465f6..8bc9ece 100755 --- a/code/main.py +++ b/code/main.py @@ -159,8 +159,13 @@ def parseCreate(user, fields): cdrom = fields.getfirst('cdrom') if cdrom is not None and not CDROM.get(cdrom): raise CodeError("Invalid cdrom type '%s'" % cdrom) + + clone_from = fields.getfirst('clone_from') + if clone_from and clone_from != 'ice3': + raise CodeError("Invalid clone image '%s'" % clone_from) + return dict(contact=user, name=name, memory=memory, disk_size=disk_size, - owner=owner, is_hvm=is_hvm, cdrom=cdrom) + owner=owner, is_hvm=is_hvm, cdrom=cdrom, clone_from=clone_from) def create(user, fields): """Handler for create requests.""" diff --git a/code/templates/list.tmpl b/code/templates/list.tmpl index 6e06c53..b6e9e33 100644 --- a/code/templates/list.tmpl +++ b/code/templates/list.tmpl @@ -52,6 +52,12 @@ $errorRow('vmtype', $err) $errorRow('cdrom', $err) + Clone image? + + (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.) + +$errorRow('cdrom', $err) + Owner -- 1.7.9.5 From 71605b8617886e1ecdb3c7e2ae17fecfc519c3e0 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 30 Mar 2008 04:29:19 -0400 Subject: [PATCH 12/16] console tips in popup (broder's uncommitted change) svn path=/trunk/packages/sipb-xen-www/; revision=341 --- code/templates/vnc.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/templates/vnc.tmpl b/code/templates/vnc.tmpl index 7ae0607..85d7697 100644 --- a/code/templates/vnc.tmpl +++ b/code/templates/vnc.tmpl @@ -12,7 +12,7 @@ Console to $machine.name #else if not $has_vnc

Your machine appears to not be accepting VNC connections. Perhaps you have a ParaVM machine?

#end if -

See tips about framebuffer and other issues.

+

See tips about framebuffer and other issues.

-- 1.7.9.5 From c881441137e317daa9121eb38ce1db41d28b28a2 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 30 Mar 2008 04:30:00 -0400 Subject: [PATCH 13/16] absolute path to VncViewer.jar (someone's uncommitted change) svn path=/trunk/packages/sipb-xen-www/; revision=342 --- code/static/VncViewer.jar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/static/VncViewer.jar b/code/static/VncViewer.jar index c84b408..cd03f68 120000 --- a/code/static/VncViewer.jar +++ b/code/static/VncViewer.jar @@ -1 +1 @@ -../../vnc/vnc_javasrc/VncViewer.jar \ No newline at end of file +/usr/local/lib/sipb-xen-vnc-client/VncViewer.jar \ No newline at end of file -- 1.7.9.5 From 4f386e548c92adfa2be3c73e8bd8dcd70fe0956d Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 31 Mar 2008 05:39:39 -0400 Subject: [PATCH 14/16] Refresh the ACL cache every 5 minutes svn path=/trunk/packages/sipb-xen-www/; revision=373 --- debian/changelog | 6 ++++++ debian/sipb-xen-www.cron.d | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 debian/sipb-xen-www.cron.d diff --git a/debian/changelog b/debian/changelog index 8a6ba5e..bc0b23c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-www (3) unstable; urgency=low + + * Refresh the ACL cache every 5 minutes + + -- SIPB Xen Project Mon, 31 Mar 2008 05:38:16 -0400 + sipb-xen-www (2) unstable; urgency=low * Create sipb-xen group in preinst script. diff --git a/debian/sipb-xen-www.cron.d b/debian/sipb-xen-www.cron.d new file mode 100644 index 0000000..e41aeed --- /dev/null +++ b/debian/sipb-xen-www.cron.d @@ -0,0 +1,6 @@ +# +# cron-jobs for sipb-xen-www +# Refresh the ACL cache +# + +*/5 * * * * python /var/www/sipb-xen-www/cache_acls.py -- 1.7.9.5 From ce573bfe6fb46ed2fe34fc96abc346b3a4aec2a4 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 31 Mar 2008 05:49:56 -0400 Subject: [PATCH 15/16] And...I should actually read examples before I copy them svn path=/trunk/packages/sipb-xen-www/; revision=375 --- debian/changelog | 6 ++++++ debian/sipb-xen-www.cron.d | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bc0b23c..aaf5846 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-www (3.1) unstable; urgency=low + + * Fixed the crontab definition + + -- SIPB Xen Project Mon, 31 Mar 2008 05:49:32 -0400 + sipb-xen-www (3) unstable; urgency=low * Refresh the ACL cache every 5 minutes diff --git a/debian/sipb-xen-www.cron.d b/debian/sipb-xen-www.cron.d index e41aeed..146e0ad 100644 --- a/debian/sipb-xen-www.cron.d +++ b/debian/sipb-xen-www.cron.d @@ -3,4 +3,6 @@ # Refresh the ACL cache # -*/5 * * * * python /var/www/sipb-xen-www/cache_acls.py +MAILTO=root + +*/5 * * * * www-data python /var/www/sipb-xen-www/cache_acls.py -- 1.7.9.5 From dce58e66ce47f06e84bf7b60ad88ac729f264971 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 3 Apr 2008 02:46:28 -0400 Subject: [PATCH 16/16] default to no boot CD when cloning svn path=/trunk/packages/sipb-xen-www/; revision=406 --- code/templates/functions.tmpl | 2 +- code/templates/list.tmpl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/code/templates/functions.tmpl b/code/templates/functions.tmpl index 213b639..7b917b0 100644 --- a/code/templates/functions.tmpl +++ b/code/templates/functions.tmpl @@ -1,5 +1,5 @@ #def cdromList($cdroms, $default="") - diff --git a/code/templates/list.tmpl b/code/templates/list.tmpl index b6e9e33..249541e 100644 --- a/code/templates/list.tmpl +++ b/code/templates/list.tmpl @@ -53,8 +53,9 @@ $errorRow('vmtype', $err) $errorRow('cdrom', $err) Clone image? - - (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.) + + (experimental; 1-2 minutes, and you have an etch machine; root pw is 'password'.) + $errorRow('cdrom', $err) -- 1.7.9.5