From 2c72187e2ba666fdbcf8fc07e93dc64b1f389cc7 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 25 Oct 2008 21:07:59 -0400 Subject: [PATCH 01/16] sipb-xen-database-common -> invirt-database in sipb-xen-www svn path=/trunk/packages/sipb-xen-www/; revision=1297 --- debian/changelog | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++---- debian/control | 19 +++--- 2 files changed, 170 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 16ef0d6..40dc80c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,24 +1,172 @@ -invirt-web-iptables (0.0.1) unstable; urgency=low +sipb-xen-www (3.18) unstable; urgency=low - * sipb-xen-iptables -> invirt-web-iptables + * sipb-xen-database-common -> invirt-database - -- Greg Price Sat, 25 Oct 2008 17:47:46 -0400 + -- Evan Broder Sat, 25 Oct 2008 21:04:09 -0400 -sipb-xen-iptables (3) unstable; urgency=low +sipb-xen-www (3.17) unstable; urgency=low - * shorten initscript with std-init.sh - * make reload work too, just for fun + [ Quentin Smith ] + * Add Kerberos-authenticated web interface on port 442 - -- Greg Price Sat, 25 Oct 2008 15:37:07 -0400 + [ Evan Broder ] + * Add config-package-dev to the build dependencies -sipb-xen-iptables (2) unstable; urgency=low + -- Evan Broder Fri, 24 Oct 2008 15:32:34 -0400 - * invirt-configurize sipb-xen-iptables +sipb-xen-www (3.16) unstable; urgency=low - -- Evan Broder Sun, 05 Oct 2008 01:22:25 -0400 + * Shorten initscript with spiffy new library from sipb-xen-base + * Fix comment copy-paste error in initscript, now that it's mostly comments -sipb-xen-iptables (1) unstable; urgency=low + -- Greg Price Fri, 24 Oct 2008 07:19:13 -0400 + +sipb-xen-www (3.15) unstable; urgency=low + + * Use /etc/invirt/keytab instead of a separate keytab for apache + + -- Evan Broder Sun, 19 Oct 2008 19:56:04 -0400 + +sipb-xen-www (3.14.4) unstable; urgency=low + + * allow '*' wildcard in config.errormail_exclude + + -- Greg Price Sat, 11 Oct 2008 17:32:42 -0700 + +sipb-xen-www (3.14.3) unstable; urgency=low + + * Actually stop Apache on shutdown + + -- Evan Broder Sun, 05 Oct 2008 00:24:40 -0400 + +sipb-xen-www (3.14.2) unstable; urgency=low + + * Be a good debian package and undo what you did on uninstall + + -- Evan Broder Sun, 05 Oct 2008 00:06:30 -0400 + +sipb-xen-www (3.14.1) unstable; urgency=low + + * Try again, now that I actually understand what the problem is + + -- Evan Broder Sat, 04 Oct 2008 23:58:46 -0400 + +sipb-xen-www (3.14) unstable; urgency=low + + * Try to fix startup ordering problem by specifying that the new startup + script depends on $remote_fs + + -- Evan Broder Sat, 04 Oct 2008 23:32:14 -0400 + +sipb-xen-www (3.13.1) unstable; urgency=low + + * Don't add another Listen 443 directive - apache gets angry + * And this, kids, is why you should always test your code before + committing + + -- Evan broder Fri, 03 Oct 2008 22:01:22 -0400 + +sipb-xen-www (3.13) unstable; urgency=low + + * Make sure we're listening on all the necessary ports + + -- Evan Broder Fri, 03 Oct 2008 21:40:47 -0400 + +sipb-xen-www (3.12) unstable; urgency=low + + * invirt-confiscate the SVN checkout + + -- Evan Broder Fri, 03 Oct 2008 21:01:33 -0400 + +sipb-xen-www (3.11) unstable; urgency=low + + * fix distribution + + -- Greg Price Tue, 30 Sep 2008 23:48:37 -0400 + +sipb-xen-www (3.10) hardy; urgency=low + + * depend on debathena-afs-config and python-flup + + -- Greg Price Mon, 29 Sep 2008 05:58:01 +0000 + +sipb-xen-www (3.9) unstable; urgency=low + + * further integration of invirt.config + + -- Yang Zhang Fri, 8 Aug 2008 02:39:15 -0400 + +sipb-xen-www (3.8) unstable; urgency=low + + * sipb_xen_database -> invirt.database in cache_acls.py + + -- Yang Zhang Sun, 3 Aug 2008 19:45:19 -0400 + +sipb-xen-www (3.7) unstable; urgency=low + + uncommitted changes in /etc/apache2 on xvm.mit.edu: + * rewrite static/ uris for admin mode + * allow ~ uris + + * take instance from keytab in k5start apache2.init wrapper + + -- Greg Price Mon, 4 Aug 2008 01:22:47 -0400 + +sipb-xen-www (3.6) unstable; urgency=low + + * Add Anders' kstart-using apache2 init script. + * Add some dependencies the svn site needs. + * Use daemon/xvm-2.mit.edu for svn site, as it's on xvm-2 now + + -- Greg Price Fri, 1 Aug 2008 20:23:50 -0400 + +sipb-xen-www (3.5) unstable; urgency=low + + * Use FCGI. + * Lengthen timeouts to let the autoinstaller work. + + -- Greg Price Sun, 15 Jun 2008 21:51:59 -0400 + +sipb-xen-www (3.4) unstable; urgency=low + + * xvm.mit.edu rather than sipb-xen-dev.mit.edu + + -- Greg Price Sun, 11 May 2008 00:49:58 -0400 + +sipb-xen-www (3.3) unstable; urgency=low + + * Fix the SVN server to point to the new AFS mountpoint + + -- Evan Broder Fri, 9 May 2008 02:37:21 -0400 + +sipb-xen-www (3.2) unstable; urgency=low + + * Check in (part of?) the Apache config. + * Modify it to allow an informative front page without certs. + * Add that front page. + + -- Greg Price Fri, 9 May 2008 02:11:04 -0400 + +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 + + -- 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. + + -- Eric Price Sat, 29 Mar 2008 18:45:02 -0400 + +sipb-xen-www (1) unstable; urgency=low * Initial Release. - -- SIPB Xen Project Fri, 28 Mar 2008 21:22:12 -0500 + -- SIPB Xen Project Fri, 28 Mar 2008 22:43:12 -0500 diff --git a/debian/control b/debian/control index 39e3387..a6c8ea6 100644 --- a/debian/control +++ b/debian/control @@ -1,13 +1,14 @@ -Source: invirt-web-iptables +Source: sipb-xen-www Section: base Priority: extra -Maintainer: Invirt project -Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), subversion -Standards-Version: 3.8.0 +Maintainer: SIPB Xen Project +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev, subversion, sipb-xen-base +Standards-Version: 3.7.2 -Package: invirt-web-iptables +Package: sipb-xen-www Architecture: all -Depends: ${misc:Depends}, iptables -Description: Invirt web server iptables rules - The Invirt web server needs these iptables rules to forward VNC requests - to the hosts. +Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, + python-cheetah, python-simplejson, invirt-database, + sipb-xen-vnc-client, kstart, debathena-afs-config, sipb-xen-base, + libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients +Description: Install the sipb-xen-dev website -- 1.7.9.5 From 0aadb8195da3693364b6cd53d438fbc98f549679 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 25 Oct 2008 21:11:45 -0400 Subject: [PATCH 02/16] ok, plain sh works now for invirt-web-iptables.init svn path=/trunk/packages/invirt-web-iptables/; revision=1304 --- debian/invirt-web-iptables.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/invirt-web-iptables.init b/debian/invirt-web-iptables.init index ce7524e..883e2ab 100755 --- a/debian/invirt-web-iptables.init +++ b/debian/invirt-web-iptables.init @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh ### BEGIN INIT INFO # Provides: invirt-web-iptables # Required-Start: $local_fs $remote_fs -- 1.7.9.5 From d263f9d2c3b9004efd0df2bcc162816b3f155f0d Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 25 Oct 2008 22:16:40 -0400 Subject: [PATCH 03/16] sipb-xen-www -> invirt-web svn path=/trunk/packages/sipb-xen-www/; revision=1318 --- code/Makefile | 2 +- config.todo | 22 ++++++++++++++++++++ debian/changelog | 6 ++++++ debian/control | 8 +++---- debian/invirt-web.cron.d | 8 +++++++ debian/{sipb-xen-www.init => invirt-web.init} | 6 +++--- .../{sipb-xen-www.install => invirt-web.install} | 0 .../{sipb-xen-www.postinst => invirt-web.postinst} | 4 ++-- .../{sipb-xen-www.preinst => invirt-web.preinst} | 4 ++-- debian/{sipb-xen-www.prerm => invirt-web.prerm} | 2 +- debian/rules | 10 +++++++++ debian/sipb-xen-www.cron.d | 8 ------- .../{sipb-xen-repository => invirt-repository} | 0 .../apache2/conf.d/{sipb-xen-www => invirt-web} | 0 files/etc/apache2/sites-available/default | 6 +++--- files/etc/apache2/sites-available/ssl.mako | 8 +++---- 16 files changed, 66 insertions(+), 28 deletions(-) create mode 100644 config.todo create mode 100644 debian/invirt-web.cron.d rename debian/{sipb-xen-www.init => invirt-web.init} (77%) rename debian/{sipb-xen-www.install => invirt-web.install} (100%) rename debian/{sipb-xen-www.postinst => invirt-web.postinst} (96%) rename debian/{sipb-xen-www.preinst => invirt-web.preinst} (89%) rename debian/{sipb-xen-www.prerm => invirt-web.prerm} (96%) delete mode 100644 debian/sipb-xen-www.cron.d rename files/etc/apache2/conf.d/{sipb-xen-repository => invirt-repository} (100%) rename files/etc/apache2/conf.d/{sipb-xen-www => invirt-web} (100%) diff --git a/code/Makefile b/code/Makefile index c1649b6..418289f 100644 --- a/code/Makefile +++ b/code/Makefile @@ -3,7 +3,7 @@ DIRS = templates all: kill chmod compile chmod: - chgrp -R sipb-xen . 2>/dev/null || true + chgrp -R invirt . 2>/dev/null || true chmod -R g+w . 2>/dev/null || true kill: diff --git a/config.todo b/config.todo new file mode 100644 index 0000000..a6abc51 --- /dev/null +++ b/config.todo @@ -0,0 +1,22 @@ +# will differ dev/prod +files/etc/apache2/sites-available/ssl: web hostname +files/etc/apache2/sites-available/svn: web hostname +code/Makefile: base URI + +# may differ dev/prod? +files/etc/apache2/sites-available/default: assumes trac +files/etc/init.d/apache2.invirt: afs cell (for svn?) +code/templates/error.tmpl: xvm@mit.edu +code/templates/help.tmpl: assumes trac +code/templates/list.tmpl: SIPB Virtual Servers +code/templates/skeleton.tmpl: SIPB Virtual Servers (twice) +code/templates/skeleton.tmpl: xvm@mit.edu +code/templates/unauth.tmpl: tons of text +code/templates/unauth.tmpl: https://xvm.mit.edu +code/static/about.html: tons of text +code/static/about.html: SIPB Virtual Servers + +# will take real code to generalize +code/getafsgroups.py: lockers, /mit +code/getafsgroups.py: use of pts for authz +code/main.py: lockers, pts, in help text diff --git a/debian/changelog b/debian/changelog index 40dc80c..27071cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.0.1) unstable; urgency=low + + * sipb-xen-www -> invirt-web + + -- Greg Price Sat, 25 Oct 2008 22:09:29 -0400 + sipb-xen-www (3.18) unstable; urgency=low * sipb-xen-database-common -> invirt-database diff --git a/debian/control b/debian/control index a6c8ea6..4771238 100644 --- a/debian/control +++ b/debian/control @@ -1,14 +1,14 @@ -Source: sipb-xen-www +Source: invirt-web Section: base Priority: extra -Maintainer: SIPB Xen Project +Maintainer: Invirt Project Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev, subversion, sipb-xen-base Standards-Version: 3.7.2 -Package: sipb-xen-www +Package: invirt-web Architecture: all Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, python-cheetah, python-simplejson, invirt-database, sipb-xen-vnc-client, kstart, debathena-afs-config, sipb-xen-base, libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients -Description: Install the sipb-xen-dev website +Description: the Invirt web interface diff --git a/debian/invirt-web.cron.d b/debian/invirt-web.cron.d new file mode 100644 index 0000000..f1ef598 --- /dev/null +++ b/debian/invirt-web.cron.d @@ -0,0 +1,8 @@ +# +# cron-jobs for invirt-web +# Refresh the ACL cache +# + +MAILTO=root + +*/5 * * * * www-data python /var/www/invirt-web/cache_acls.py diff --git a/debian/sipb-xen-www.init b/debian/invirt-web.init similarity index 77% rename from debian/sipb-xen-www.init rename to debian/invirt-web.init index f13ab6d..560eecd 100755 --- a/debian/sipb-xen-www.init +++ b/debian/invirt-web.init @@ -1,15 +1,15 @@ #!/bin/bash ### BEGIN INIT INFO -# Provides: sipb-xen-www +# Provides: invirt-web # 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 web server +# Short-Description: Invirt web server # Description: ### END INIT INFO -PACKAGE=sipb-xen-www +PACKAGE=invirt-web PARENTPACKAGE=apache2 GEN_FILES=(/etc/apache2/sites-available/{ssl,svn}) diff --git a/debian/sipb-xen-www.install b/debian/invirt-web.install similarity index 100% rename from debian/sipb-xen-www.install rename to debian/invirt-web.install diff --git a/debian/sipb-xen-www.postinst b/debian/invirt-web.postinst similarity index 96% rename from debian/sipb-xen-www.postinst rename to debian/invirt-web.postinst index 7f213a0..9ab1554 100755 --- a/debian/sipb-xen-www.postinst +++ b/debian/invirt-web.postinst @@ -20,9 +20,9 @@ set -e case "$1" in configure) - cd /var/www/sipb-xen-www + cd /var/www/invirt-web make clean && make all - chgrp -R sipb-xen . + chgrp -R invirt . chmod -R g+w . # Our init script proxies all requests Apache's, so Apache's diff --git a/debian/sipb-xen-www.preinst b/debian/invirt-web.preinst similarity index 89% rename from debian/sipb-xen-www.preinst rename to debian/invirt-web.preinst index d5afbad..3245702 100644 --- a/debian/sipb-xen-www.preinst +++ b/debian/invirt-web.preinst @@ -16,8 +16,8 @@ set -e case "$1" in install|upgrade) - if ! getent group sipb-xen > /dev/null; then - addgroup --system sipb-xen + if ! getent group invirt > /dev/null; then + addgroup --system invirt fi ;; diff --git a/debian/sipb-xen-www.prerm b/debian/invirt-web.prerm similarity index 96% rename from debian/sipb-xen-www.prerm rename to debian/invirt-web.prerm index 95dbdf6..f38fe95 100644 --- a/debian/sipb-xen-www.prerm +++ b/debian/invirt-web.prerm @@ -1,5 +1,5 @@ #!/bin/sh -# prerm script for sipb-xen-www +# prerm script for invirt-web # # see: dh_installdeb(1) diff --git a/debian/rules b/debian/rules index e6192f6..b890156 100755 --- a/debian/rules +++ b/debian/rules @@ -1,3 +1,13 @@ #!/usr/bin/make -f +DEB_DIVERT_EXTENSION = .invirt +DEB_DIVERT_FILES_invirt-web += \ + /etc/init.d/apache2 + include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk + +DEB_UPDATE_RCD_PARAMS_invirt-web += defaults 91 9 + +binary-fixup/invirt-web:: + svn co $$(invirt-getconf svn.uri)/trunk/packages/invirt-web/code/ $(DEB_DESTDIR)/var/www/invirt-web diff --git a/debian/sipb-xen-www.cron.d b/debian/sipb-xen-www.cron.d deleted file mode 100644 index 146e0ad..0000000 --- a/debian/sipb-xen-www.cron.d +++ /dev/null @@ -1,8 +0,0 @@ -# -# cron-jobs for sipb-xen-www -# Refresh the ACL cache -# - -MAILTO=root - -*/5 * * * * www-data python /var/www/sipb-xen-www/cache_acls.py diff --git a/files/etc/apache2/conf.d/sipb-xen-repository b/files/etc/apache2/conf.d/invirt-repository similarity index 100% rename from files/etc/apache2/conf.d/sipb-xen-repository rename to files/etc/apache2/conf.d/invirt-repository diff --git a/files/etc/apache2/conf.d/sipb-xen-www b/files/etc/apache2/conf.d/invirt-web similarity index 100% rename from files/etc/apache2/conf.d/sipb-xen-www rename to files/etc/apache2/conf.d/invirt-web diff --git a/files/etc/apache2/sites-available/default b/files/etc/apache2/sites-available/default index 672526c..ed713a1 100644 --- a/files/etc/apache2/sites-available/default +++ b/files/etc/apache2/sites-available/default @@ -2,8 +2,8 @@ NameVirtualHost *:80 ServerAdmin webmaster@localhost - DocumentRoot /var/www/sipb-xen-www - + DocumentRoot /var/www/invirt-web + Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride None Order allow,deny @@ -20,7 +20,7 @@ NameVirtualHost *:80 RewriteRule ^/sipb-xen - [L] RewriteRule ^/kill.cgi - [L] RewriteRule ^/~ - [L] - RewriteRule ^/(.*) /var/www/sipb-xen-www/main.fcgi/$1 [L] + RewriteRule ^/(.*) /var/www/invirt-web/main.fcgi/$1 [L] ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ diff --git a/files/etc/apache2/sites-available/ssl.mako b/files/etc/apache2/sites-available/ssl.mako index dfd5af9..b722bfd 100644 --- a/files/etc/apache2/sites-available/ssl.mako +++ b/files/etc/apache2/sites-available/ssl.mako @@ -8,8 +8,8 @@ Listen 442 Listen 446 <%def name="invirt_webinterface()"> - DocumentRoot /var/www/sipb-xen-www - + DocumentRoot /var/www/invirt-web + Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride None Order allow,deny @@ -31,7 +31,7 @@ ${caller.body()} RewriteRule ^/wiki(.*) - [L] RewriteRule ^/kill.cgi - [L] RewriteRule ^/~ - [L] - RewriteRule ^/(.*) /var/www/sipb-xen-www/main.fcgi/$1 [L] + RewriteRule ^/(.*) /var/www/invirt-web/main.fcgi/$1 [L] RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 0 @@ -90,7 +90,7 @@ ${caller.body()} ServerAdmin ${errmail} ServerName ${hostname}:446 - DocumentRoot /var/www/sipb-xen-www + DocumentRoot /var/www/invirt-web Options Indexes FollowSymLinks MultiViews ExecCGI AllowOverride None -- 1.7.9.5 From 04fc30b39f1ea99064d48f662eee0cd74e66e46c Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 26 Oct 2008 05:07:46 -0400 Subject: [PATCH 04/16] /sipb-xen -> /invirt in serving apt repo svn path=/trunk/packages/invirt-web/; revision=1331 --- debian/changelog | 6 ++++++ files/etc/apache2/conf.d/invirt-repository | 2 +- files/etc/apache2/sites-available/default | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 27071cb..500577e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.0.2) unstable; urgency=low + + * /sipb-xen -> /invirt in apt repo URI + + -- Greg Price Sun, 26 Oct 2008 04:56:21 -0400 + invirt-web (0.0.1) unstable; urgency=low * sipb-xen-www -> invirt-web diff --git a/files/etc/apache2/conf.d/invirt-repository b/files/etc/apache2/conf.d/invirt-repository index 73c6229..1732f86 100644 --- a/files/etc/apache2/conf.d/invirt-repository +++ b/files/etc/apache2/conf.d/invirt-repository @@ -1,4 +1,4 @@ -Alias /sipb-xen /srv/repository +Alias /invirt /srv/repository Alias /debian/ /debian/ diff --git a/files/etc/apache2/sites-available/default b/files/etc/apache2/sites-available/default index ed713a1..f55dea7 100644 --- a/files/etc/apache2/sites-available/default +++ b/files/etc/apache2/sites-available/default @@ -17,7 +17,8 @@ NameVirtualHost *:80 RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L] RewriteRule ^/trac/login(.*) https://xvm.mit.edu/trac/login$1 [L] RewriteRule ^/trac(.*) /var/www/trac/trac.fcgi$1 [L] - RewriteRule ^/sipb-xen - [L] + RewriteRule ^/invirt - [L] + RewriteRule ^/sipb-xen(.*) /invirt$1 [PT] RewriteRule ^/kill.cgi - [L] RewriteRule ^/~ - [L] RewriteRule ^/(.*) /var/www/invirt-web/main.fcgi/$1 [L] -- 1.7.9.5 From 2be4309141ec57fc2b2a7b776b2187cd38d6abb7 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sun, 26 Oct 2008 17:29:18 -0400 Subject: [PATCH 05/16] sipb-xen-vnc-client -> invirt-vnc-client in invirt-web svn path=/trunk/packages/invirt-web/; revision=1340 --- code/static/VncViewer.jar | 2 +- debian/changelog | 6 ++++++ debian/control | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/static/VncViewer.jar b/code/static/VncViewer.jar index cd03f68..625c4a8 120000 --- a/code/static/VncViewer.jar +++ b/code/static/VncViewer.jar @@ -1 +1 @@ -/usr/local/lib/sipb-xen-vnc-client/VncViewer.jar \ No newline at end of file +/usr/share/invirt-vnc-client/VncViewer.jar \ No newline at end of file diff --git a/debian/changelog b/debian/changelog index 500577e..ac27875 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.0.3) unstable; urgency=low + + * sipb-xen-vnc-client -> invirt-vnc-client + + -- Evan Broder Sun, 26 Oct 2008 17:28:51 -0400 + invirt-web (0.0.2) unstable; urgency=low * /sipb-xen -> /invirt in apt repo URI diff --git a/debian/control b/debian/control index 4771238..6e163bc 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,6 @@ Package: invirt-web Architecture: all Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, python-cheetah, python-simplejson, invirt-database, - sipb-xen-vnc-client, kstart, debathena-afs-config, sipb-xen-base, + invirt-vnc-client, kstart, debathena-afs-config, sipb-xen-base, libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients Description: the Invirt web interface -- 1.7.9.5 From dc7e1551f18344fa9ceb85af7385c18e39037336 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 28 Oct 2008 04:24:26 -0400 Subject: [PATCH 06/16] sipb-xen-base -> invirt-base in dependency lists svn path=/trunk/packages/invirt-web/; revision=1372 --- debian/changelog | 6 ++++++ debian/control | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ac27875..5bf38bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.0.4) unstable; urgency=low + + * sipb-xen-base -> invirt-base + + -- Evan Broder Tue, 28 Oct 2008 04:23:35 -0400 + invirt-web (0.0.3) unstable; urgency=low * sipb-xen-vnc-client -> invirt-vnc-client diff --git a/debian/control b/debian/control index 6e163bc..986ac5d 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,13 @@ Source: invirt-web Section: base Priority: extra Maintainer: Invirt Project -Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev, subversion, sipb-xen-base +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev, subversion, invirt-base Standards-Version: 3.7.2 Package: invirt-web Architecture: all Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, python-cheetah, python-simplejson, invirt-database, - invirt-vnc-client, kstart, debathena-afs-config, sipb-xen-base, + invirt-vnc-client, kstart, debathena-afs-config, invirt-base, libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients Description: the Invirt web interface -- 1.7.9.5 From 4a421c824cd37a3b005f4d8c5ee58e05444b54f1 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 28 Oct 2008 20:00:22 -0400 Subject: [PATCH 07/16] In the web interface, get the VNC auth token over remctl svn path=/trunk/packages/invirt-web/; revision=1391 --- code/main.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/code/main.py b/code/main.py index e4727a8..cfcbd5d 100755 --- a/code/main.py +++ b/code/main.py @@ -245,18 +245,7 @@ def vnc(username, state, path, fields): """ machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine - TOKEN_KEY = "0M6W0U1IXexThi5idy8mnkqPKEq1LtEnlK/pZSn0cDrN" - - data = {} - data["user"] = username - data["machine"] = machine.name - data["expires"] = time.time()+(5*60) - pickled_data = cPickle.dumps(data) - m = hmac.new(TOKEN_KEY, digestmod=sha) - m.update(pickled_data) - token = {'data': pickled_data, 'digest': m.digest()} - token = cPickle.dumps(token) - token = base64.urlsafe_b64encode(token) + token = remctl('control', machine.name, 'vnctoken') host = controls.listHost(machine) if host: port = 10003 + [h.hostname for h in config.hosts].index(host) -- 1.7.9.5 From 0395f472d9214d2d39ae8e0079908f092adf9fb6 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Wed, 29 Oct 2008 01:28:02 -0400 Subject: [PATCH 08/16] Enable IP forwarding on the web server so that VNC works svn path=/trunk/packages/invirt-web-iptables/; revision=1427 --- debian/changelog | 196 +++------------------------------------ debian/invirt-web-iptables.init | 1 + 2 files changed, 16 insertions(+), 181 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5bf38bc..4d695b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,196 +1,30 @@ -invirt-web (0.0.4) unstable; urgency=low +invirt-web-iptables (0.0.2) unstable; urgency=low - * sipb-xen-base -> invirt-base + * Be sure to enable IP forwarding for VNC - -- Evan Broder Tue, 28 Oct 2008 04:23:35 -0400 + -- Evan Broder Wed, 29 Oct 2008 01:27:48 -0400 -invirt-web (0.0.3) unstable; urgency=low +invirt-web-iptables (0.0.1) unstable; urgency=low - * sipb-xen-vnc-client -> invirt-vnc-client + * sipb-xen-iptables -> invirt-web-iptables - -- Evan Broder Sun, 26 Oct 2008 17:28:51 -0400 + -- Greg Price Sat, 25 Oct 2008 17:47:46 -0400 -invirt-web (0.0.2) unstable; urgency=low +sipb-xen-iptables (3) unstable; urgency=low - * /sipb-xen -> /invirt in apt repo URI + * shorten initscript with std-init.sh + * make reload work too, just for fun - -- Greg Price Sun, 26 Oct 2008 04:56:21 -0400 + -- Greg Price Sat, 25 Oct 2008 15:37:07 -0400 -invirt-web (0.0.1) unstable; urgency=low +sipb-xen-iptables (2) unstable; urgency=low - * sipb-xen-www -> invirt-web + * invirt-configurize sipb-xen-iptables - -- Greg Price Sat, 25 Oct 2008 22:09:29 -0400 + -- Evan Broder Sun, 05 Oct 2008 01:22:25 -0400 -sipb-xen-www (3.18) unstable; urgency=low - - * sipb-xen-database-common -> invirt-database - - -- Evan Broder Sat, 25 Oct 2008 21:04:09 -0400 - -sipb-xen-www (3.17) unstable; urgency=low - - [ Quentin Smith ] - * Add Kerberos-authenticated web interface on port 442 - - [ Evan Broder ] - * Add config-package-dev to the build dependencies - - -- Evan Broder Fri, 24 Oct 2008 15:32:34 -0400 - -sipb-xen-www (3.16) unstable; urgency=low - - * Shorten initscript with spiffy new library from sipb-xen-base - * Fix comment copy-paste error in initscript, now that it's mostly comments - - -- Greg Price Fri, 24 Oct 2008 07:19:13 -0400 - -sipb-xen-www (3.15) unstable; urgency=low - - * Use /etc/invirt/keytab instead of a separate keytab for apache - - -- Evan Broder Sun, 19 Oct 2008 19:56:04 -0400 - -sipb-xen-www (3.14.4) unstable; urgency=low - - * allow '*' wildcard in config.errormail_exclude - - -- Greg Price Sat, 11 Oct 2008 17:32:42 -0700 - -sipb-xen-www (3.14.3) unstable; urgency=low - - * Actually stop Apache on shutdown - - -- Evan Broder Sun, 05 Oct 2008 00:24:40 -0400 - -sipb-xen-www (3.14.2) unstable; urgency=low - - * Be a good debian package and undo what you did on uninstall - - -- Evan Broder Sun, 05 Oct 2008 00:06:30 -0400 - -sipb-xen-www (3.14.1) unstable; urgency=low - - * Try again, now that I actually understand what the problem is - - -- Evan Broder Sat, 04 Oct 2008 23:58:46 -0400 - -sipb-xen-www (3.14) unstable; urgency=low - - * Try to fix startup ordering problem by specifying that the new startup - script depends on $remote_fs - - -- Evan Broder Sat, 04 Oct 2008 23:32:14 -0400 - -sipb-xen-www (3.13.1) unstable; urgency=low - - * Don't add another Listen 443 directive - apache gets angry - * And this, kids, is why you should always test your code before - committing - - -- Evan broder Fri, 03 Oct 2008 22:01:22 -0400 - -sipb-xen-www (3.13) unstable; urgency=low - - * Make sure we're listening on all the necessary ports - - -- Evan Broder Fri, 03 Oct 2008 21:40:47 -0400 - -sipb-xen-www (3.12) unstable; urgency=low - - * invirt-confiscate the SVN checkout - - -- Evan Broder Fri, 03 Oct 2008 21:01:33 -0400 - -sipb-xen-www (3.11) unstable; urgency=low - - * fix distribution - - -- Greg Price Tue, 30 Sep 2008 23:48:37 -0400 - -sipb-xen-www (3.10) hardy; urgency=low - - * depend on debathena-afs-config and python-flup - - -- Greg Price Mon, 29 Sep 2008 05:58:01 +0000 - -sipb-xen-www (3.9) unstable; urgency=low - - * further integration of invirt.config - - -- Yang Zhang Fri, 8 Aug 2008 02:39:15 -0400 - -sipb-xen-www (3.8) unstable; urgency=low - - * sipb_xen_database -> invirt.database in cache_acls.py - - -- Yang Zhang Sun, 3 Aug 2008 19:45:19 -0400 - -sipb-xen-www (3.7) unstable; urgency=low - - uncommitted changes in /etc/apache2 on xvm.mit.edu: - * rewrite static/ uris for admin mode - * allow ~ uris - - * take instance from keytab in k5start apache2.init wrapper - - -- Greg Price Mon, 4 Aug 2008 01:22:47 -0400 - -sipb-xen-www (3.6) unstable; urgency=low - - * Add Anders' kstart-using apache2 init script. - * Add some dependencies the svn site needs. - * Use daemon/xvm-2.mit.edu for svn site, as it's on xvm-2 now - - -- Greg Price Fri, 1 Aug 2008 20:23:50 -0400 - -sipb-xen-www (3.5) unstable; urgency=low - - * Use FCGI. - * Lengthen timeouts to let the autoinstaller work. - - -- Greg Price Sun, 15 Jun 2008 21:51:59 -0400 - -sipb-xen-www (3.4) unstable; urgency=low - - * xvm.mit.edu rather than sipb-xen-dev.mit.edu - - -- Greg Price Sun, 11 May 2008 00:49:58 -0400 - -sipb-xen-www (3.3) unstable; urgency=low - - * Fix the SVN server to point to the new AFS mountpoint - - -- Evan Broder Fri, 9 May 2008 02:37:21 -0400 - -sipb-xen-www (3.2) unstable; urgency=low - - * Check in (part of?) the Apache config. - * Modify it to allow an informative front page without certs. - * Add that front page. - - -- Greg Price Fri, 9 May 2008 02:11:04 -0400 - -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 - - -- 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. - - -- Eric Price Sat, 29 Mar 2008 18:45:02 -0400 - -sipb-xen-www (1) unstable; urgency=low +sipb-xen-iptables (1) unstable; urgency=low * Initial Release. - -- SIPB Xen Project Fri, 28 Mar 2008 22:43:12 -0500 + -- SIPB Xen Project Fri, 28 Mar 2008 21:22:12 -0500 diff --git a/debian/invirt-web-iptables.init b/debian/invirt-web-iptables.init index 883e2ab..9c107ee 100755 --- a/debian/invirt-web-iptables.init +++ b/debian/invirt-web-iptables.init @@ -23,6 +23,7 @@ dpkg -s "$NAME" >/dev/null 2>/dev/null || exit 0 do_start() { gen_files + echo 1 > /proc/sys/net/ipv4/ip_forward /sbin/iptables-restore < $RULES } -- 1.7.9.5 From bf27ca1d371e1bb6b49c7e7d47438985e1399d24 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 31 Oct 2008 21:12:24 -0400 Subject: [PATCH 09/16] When getting the authtoken in the web interface, call remctl from the right place svn path=/trunk/packages/invirt-web/; revision=1469 --- code/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/main.py b/code/main.py index cfcbd5d..452a285 100755 --- a/code/main.py +++ b/code/main.py @@ -245,7 +245,7 @@ def vnc(username, state, path, fields): """ machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine - token = remctl('control', machine.name, 'vnctoken') + token = controls.remctl('control', machine.name, 'vnctoken') host = controls.listHost(machine) if host: port = 10003 + [h.hostname for h in config.hosts].index(host) -- 1.7.9.5 From a5129d860e26e364fff59043900d632e725efced Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Fri, 31 Oct 2008 22:58:23 -0400 Subject: [PATCH 10/16] Validate hostnames by querying to see if the name exists in DNS, and add an appropriate dependency svn path=/trunk/packages/invirt-web/; revision=1473 --- code/validation.py | 15 +++- debian/changelog | 202 ++++++++++++++++++++++++++++++++++++++++++++++++---- debian/control | 5 +- 3 files changed, 203 insertions(+), 19 deletions(-) diff --git a/code/validation.py b/code/validation.py index 860bac3..2f64f9a 100644 --- a/code/validation.py +++ b/code/validation.py @@ -4,6 +4,7 @@ import cache_acls import getafsgroups import re import string +import dns.resolver from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall from invirt.config import structs as config from webcommon import InvalidInput @@ -270,11 +271,21 @@ def testName(user, name, machine=None): name = name.lower() if machine is not None and name == machine.name: return None - if not Machine.query().filter_by(name=name).count(): + try: + f = open('/tmp/log', 'a') + dns.resolver.query('%s.%s.' % (name, config.dns.domains[0]), 'A') + # If the hostname didn't exist, it would have thrown an + # exception by now - error out + raise InvalidInput('name', name, 'Name is already taken.') + except dns.resolver.NXDOMAIN, e: if not validMachineName(name): raise InvalidInput('name', name, 'You must provide a machine name. Max 63 chars, alnum plus \'-\', does not begin or end with \'-\'.') return name - raise InvalidInput('name', name, "Name is already taken.") + except InvalidInput: + raise + except: + # Any other error is a validation failure + raise InvalidInput('name', name, 'We were unable to verify that this name is available. If you believe this is in error, please contact us at %s' % config.dns.contact) def testDescription(user, description, machine=None): if description is None or description.strip() == '': diff --git a/debian/changelog b/debian/changelog index 4d695b3..3ebb5c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,30 +1,202 @@ -invirt-web-iptables (0.0.2) unstable; urgency=low +invirt-web (0.0.5) unstable; urgency=low - * Be sure to enable IP forwarding for VNC + * Add new dependency on python-dns - -- Evan Broder Wed, 29 Oct 2008 01:27:48 -0400 + -- Evan Broder Fri, 31 Oct 2008 22:57:41 -0400 -invirt-web-iptables (0.0.1) unstable; urgency=low +invirt-web (0.0.4) unstable; urgency=low - * sipb-xen-iptables -> invirt-web-iptables + * sipb-xen-base -> invirt-base - -- Greg Price Sat, 25 Oct 2008 17:47:46 -0400 + -- Evan Broder Tue, 28 Oct 2008 04:23:35 -0400 -sipb-xen-iptables (3) unstable; urgency=low +invirt-web (0.0.3) unstable; urgency=low - * shorten initscript with std-init.sh - * make reload work too, just for fun + * sipb-xen-vnc-client -> invirt-vnc-client - -- Greg Price Sat, 25 Oct 2008 15:37:07 -0400 + -- Evan Broder Sun, 26 Oct 2008 17:28:51 -0400 -sipb-xen-iptables (2) unstable; urgency=low +invirt-web (0.0.2) unstable; urgency=low - * invirt-configurize sipb-xen-iptables + * /sipb-xen -> /invirt in apt repo URI - -- Evan Broder Sun, 05 Oct 2008 01:22:25 -0400 + -- Greg Price Sun, 26 Oct 2008 04:56:21 -0400 -sipb-xen-iptables (1) unstable; urgency=low +invirt-web (0.0.1) unstable; urgency=low + + * sipb-xen-www -> invirt-web + + -- Greg Price Sat, 25 Oct 2008 22:09:29 -0400 + +sipb-xen-www (3.18) unstable; urgency=low + + * sipb-xen-database-common -> invirt-database + + -- Evan Broder Sat, 25 Oct 2008 21:04:09 -0400 + +sipb-xen-www (3.17) unstable; urgency=low + + [ Quentin Smith ] + * Add Kerberos-authenticated web interface on port 442 + + [ Evan Broder ] + * Add config-package-dev to the build dependencies + + -- Evan Broder Fri, 24 Oct 2008 15:32:34 -0400 + +sipb-xen-www (3.16) unstable; urgency=low + + * Shorten initscript with spiffy new library from sipb-xen-base + * Fix comment copy-paste error in initscript, now that it's mostly comments + + -- Greg Price Fri, 24 Oct 2008 07:19:13 -0400 + +sipb-xen-www (3.15) unstable; urgency=low + + * Use /etc/invirt/keytab instead of a separate keytab for apache + + -- Evan Broder Sun, 19 Oct 2008 19:56:04 -0400 + +sipb-xen-www (3.14.4) unstable; urgency=low + + * allow '*' wildcard in config.errormail_exclude + + -- Greg Price Sat, 11 Oct 2008 17:32:42 -0700 + +sipb-xen-www (3.14.3) unstable; urgency=low + + * Actually stop Apache on shutdown + + -- Evan Broder Sun, 05 Oct 2008 00:24:40 -0400 + +sipb-xen-www (3.14.2) unstable; urgency=low + + * Be a good debian package and undo what you did on uninstall + + -- Evan Broder Sun, 05 Oct 2008 00:06:30 -0400 + +sipb-xen-www (3.14.1) unstable; urgency=low + + * Try again, now that I actually understand what the problem is + + -- Evan Broder Sat, 04 Oct 2008 23:58:46 -0400 + +sipb-xen-www (3.14) unstable; urgency=low + + * Try to fix startup ordering problem by specifying that the new startup + script depends on $remote_fs + + -- Evan Broder Sat, 04 Oct 2008 23:32:14 -0400 + +sipb-xen-www (3.13.1) unstable; urgency=low + + * Don't add another Listen 443 directive - apache gets angry + * And this, kids, is why you should always test your code before + committing + + -- Evan broder Fri, 03 Oct 2008 22:01:22 -0400 + +sipb-xen-www (3.13) unstable; urgency=low + + * Make sure we're listening on all the necessary ports + + -- Evan Broder Fri, 03 Oct 2008 21:40:47 -0400 + +sipb-xen-www (3.12) unstable; urgency=low + + * invirt-confiscate the SVN checkout + + -- Evan Broder Fri, 03 Oct 2008 21:01:33 -0400 + +sipb-xen-www (3.11) unstable; urgency=low + + * fix distribution + + -- Greg Price Tue, 30 Sep 2008 23:48:37 -0400 + +sipb-xen-www (3.10) hardy; urgency=low + + * depend on debathena-afs-config and python-flup + + -- Greg Price Mon, 29 Sep 2008 05:58:01 +0000 + +sipb-xen-www (3.9) unstable; urgency=low + + * further integration of invirt.config + + -- Yang Zhang Fri, 8 Aug 2008 02:39:15 -0400 + +sipb-xen-www (3.8) unstable; urgency=low + + * sipb_xen_database -> invirt.database in cache_acls.py + + -- Yang Zhang Sun, 3 Aug 2008 19:45:19 -0400 + +sipb-xen-www (3.7) unstable; urgency=low + + uncommitted changes in /etc/apache2 on xvm.mit.edu: + * rewrite static/ uris for admin mode + * allow ~ uris + + * take instance from keytab in k5start apache2.init wrapper + + -- Greg Price Mon, 4 Aug 2008 01:22:47 -0400 + +sipb-xen-www (3.6) unstable; urgency=low + + * Add Anders' kstart-using apache2 init script. + * Add some dependencies the svn site needs. + * Use daemon/xvm-2.mit.edu for svn site, as it's on xvm-2 now + + -- Greg Price Fri, 1 Aug 2008 20:23:50 -0400 + +sipb-xen-www (3.5) unstable; urgency=low + + * Use FCGI. + * Lengthen timeouts to let the autoinstaller work. + + -- Greg Price Sun, 15 Jun 2008 21:51:59 -0400 + +sipb-xen-www (3.4) unstable; urgency=low + + * xvm.mit.edu rather than sipb-xen-dev.mit.edu + + -- Greg Price Sun, 11 May 2008 00:49:58 -0400 + +sipb-xen-www (3.3) unstable; urgency=low + + * Fix the SVN server to point to the new AFS mountpoint + + -- Evan Broder Fri, 9 May 2008 02:37:21 -0400 + +sipb-xen-www (3.2) unstable; urgency=low + + * Check in (part of?) the Apache config. + * Modify it to allow an informative front page without certs. + * Add that front page. + + -- Greg Price Fri, 9 May 2008 02:11:04 -0400 + +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 + + -- 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. + + -- Eric Price Sat, 29 Mar 2008 18:45:02 -0400 + +sipb-xen-www (1) unstable; urgency=low * Initial Release. - -- SIPB Xen Project Fri, 28 Mar 2008 21:22:12 -0500 + -- SIPB Xen Project Fri, 28 Mar 2008 22:43:12 -0500 diff --git a/debian/control b/debian/control index 986ac5d..7c9d1c5 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,8 @@ Standards-Version: 3.7.2 Package: invirt-web Architecture: all Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, - python-cheetah, python-simplejson, invirt-database, + python-cheetah, python-simplejson, python-dns, invirt-database, invirt-vnc-client, kstart, debathena-afs-config, invirt-base, - libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients + libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, + zephyr-clients Description: the Invirt web interface -- 1.7.9.5 From 5ca52d8ea00d202c79c750fd52fe08b6a215eb57 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 1 Nov 2008 00:31:39 -0400 Subject: [PATCH 11/16] Standardize on the spelling of "Invirt project"...just because svn path=/trunk/packages/invirt-web/; revision=1474 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 7c9d1c5..7328980 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: invirt-web Section: base Priority: extra -Maintainer: Invirt Project +Maintainer: Invirt project Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev, subversion, invirt-base Standards-Version: 3.7.2 -- 1.7.9.5 From fcfdb35beb5e69fa3355743472dd956ba929c5b0 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 1 Nov 2008 04:21:49 -0400 Subject: [PATCH 12/16] Display a helpful error on the website if a name has specifically been reserved svn path=/trunk/packages/invirt-web/; revision=1492 --- code/validation.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/code/validation.py b/code/validation.py index 2f64f9a..39c0084 100644 --- a/code/validation.py +++ b/code/validation.py @@ -272,8 +272,18 @@ def testName(user, name, machine=None): if machine is not None and name == machine.name: return None try: - f = open('/tmp/log', 'a') - dns.resolver.query('%s.%s.' % (name, config.dns.domains[0]), 'A') + hostname = '%s.%s.' % (name, config.dns.domains[0]) + try: + dns.resolver.query(hostname, 'A') + except dns.resolver.NoAnswer, e: + # If we can get the TXT record, then we can verify it's + # reserved. If this lookup fails, let it bubble up and be + # dealt with + answer = dns.resolver.query(hostname, 'TXT') + txt = answer[0].strings[0] + if txt.startswith('Reserved'): + raise InvalidInput('name', name, 'The name you have requested has been %s. For more information, contact us at %s' % (txt, config.dns.contact)) + # If the hostname didn't exist, it would have thrown an # exception by now - error out raise InvalidInput('name', name, 'Name is already taken.') -- 1.7.9.5 From 2c2a6440b71e26d6921924d3b840e1c35f5e2079 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Sat, 1 Nov 2008 04:27:41 -0400 Subject: [PATCH 13/16] Switched to lowercase "reserved" in the zone file because it flows better in the error text svn path=/trunk/packages/invirt-web/; revision=1495 --- code/validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/validation.py b/code/validation.py index 39c0084..f28603c 100644 --- a/code/validation.py +++ b/code/validation.py @@ -281,7 +281,7 @@ def testName(user, name, machine=None): # dealt with answer = dns.resolver.query(hostname, 'TXT') txt = answer[0].strings[0] - if txt.startswith('Reserved'): + if txt.startswith('reserved'): raise InvalidInput('name', name, 'The name you have requested has been %s. For more information, contact us at %s' % (txt, config.dns.contact)) # If the hostname didn't exist, it would have thrown an -- 1.7.9.5 From e0991f3ed4c49b6067936e7c2246df790ea38d6e Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Mon, 3 Nov 2008 03:42:26 -0500 Subject: [PATCH 14/16] invirt-svn-server and invirt-web both depend on AFS working svn path=/trunk/packages/invirt-web/; revision=1514 --- debian/changelog | 7 +++++++ debian/control | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3ebb5c0..a9e9f18 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-web (0.0.6) unstable; urgency=low + + * The web server needs a working AFS; make sure OpenAFS modules are + installed + + -- Evan Broder Mon, 03 Nov 2008 03:40:51 -0500 + invirt-web (0.0.5) unstable; urgency=low * Add new dependency on python-dns diff --git a/debian/control b/debian/control index 7328980..4cfa294 100644 --- a/debian/control +++ b/debian/control @@ -11,5 +11,5 @@ Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, python-cheetah, python-simplejson, python-dns, invirt-database, invirt-vnc-client, kstart, debathena-afs-config, invirt-base, libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, - zephyr-clients + zephyr-clients, openafs-modules-xen Description: the Invirt web interface -- 1.7.9.5 From 86baf5455a424dab73b0e2268d71f704631a6718 Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 6 Nov 2008 21:52:39 -0500 Subject: [PATCH 15/16] In the web interface, validate names by querying against the local nameserver This fixes the case where the default nameserver is caching an old value. svn path=/trunk/packages/invirt-web/; revision=1542 --- code/validation.py | 6 ++++-- debian/changelog | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/validation.py b/code/validation.py index f28603c..25031ef 100644 --- a/code/validation.py +++ b/code/validation.py @@ -273,13 +273,15 @@ def testName(user, name, machine=None): return None try: hostname = '%s.%s.' % (name, config.dns.domains[0]) + resolver = dns.resolver.Resolver() + resolver.nameservers = ['127.0.0.1'] try: - dns.resolver.query(hostname, 'A') + resolver.query(hostname, 'A') except dns.resolver.NoAnswer, e: # If we can get the TXT record, then we can verify it's # reserved. If this lookup fails, let it bubble up and be # dealt with - answer = dns.resolver.query(hostname, 'TXT') + answer = resolver.query(hostname, 'TXT') txt = answer[0].strings[0] if txt.startswith('reserved'): raise InvalidInput('name', name, 'The name you have requested has been %s. For more information, contact us at %s' % (txt, config.dns.contact)) diff --git a/debian/changelog b/debian/changelog index a9e9f18..d52aa04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +invirt-web (0.0.7) unstable; urgency=low + + * Query against the local nameserver to be sure there's no caching of + deleted hosts + + -- Evan Broder Thu, 06 Nov 2008 21:44:27 -0500 + invirt-web (0.0.6) unstable; urgency=low * The web server needs a working AFS; make sure OpenAFS modules are -- 1.7.9.5 From f0aea0f7a31f022caf37ed0fee99f19a1744054d Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Thu, 6 Nov 2008 21:52:40 -0500 Subject: [PATCH 16/16] Depend on invirt-dns so there is a local nameserver to query against svn path=/trunk/packages/invirt-web/; revision=1543 --- debian/changelog | 3 ++- debian/control | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index d52aa04..add3e5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ invirt-web (0.0.7) unstable; urgency=low * Query against the local nameserver to be sure there's no caching of deleted hosts + * Depend on invirt-dns to be sure that a nameserver is running locally - -- Evan Broder Thu, 06 Nov 2008 21:44:27 -0500 + -- Evan Broder Thu, 06 Nov 2008 21:45:42 -0500 invirt-web (0.0.6) unstable; urgency=low diff --git a/debian/control b/debian/control index 4cfa294..8225624 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Package: invirt-web Architecture: all Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, python-cheetah, python-simplejson, python-dns, invirt-database, - invirt-vnc-client, kstart, debathena-afs-config, invirt-base, - libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, - zephyr-clients, openafs-modules-xen + invirt-vnc-client, invirt-dns, kstart, debathena-afs-config, + invirt-base, libapache2-svn, libapache2-mod-auth-kerb, postfix, + subversion, zephyr-clients, openafs-modules-xen Description: the Invirt web interface -- 1.7.9.5