converted two of the generated config files to use mako
authorYang Zhang <y_z@mit.edu>
Tue, 12 Aug 2008 20:02:57 +0000 (16:02 -0400)
committerYang Zhang <y_z@mit.edu>
Tue, 12 Aug 2008 20:02:57 +0000 (16:02 -0400)
svn path=/trunk/packages/sipb-xen-www/; revision=883

debian/control
debian/sipb-xen-www.init
files/etc/apache2/sites-available/ssl.mako [new file with mode: 0644]
files/etc/apache2/sites-available/svn.mako [new file with mode: 0644]

index dbc37b1..13f1a1c 100644 (file)
@@ -2,7 +2,7 @@ Source: sipb-xen-www
 Section: base
 Priority: extra
 Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
-Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), subversion
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), subversion, sipb-xen-base
 Standards-Version: 3.7.2
 
 Package: sipb-xen-www
index 5a4db6d..e907f53 100755 (executable)
@@ -15,142 +15,7 @@ PACKAGE=sipb-xen-www
 
 gen_config()
 {
-    local errormail="$( invirt-getconf web.errormail )" \
-          hostname="$( invirt-getconf web.hostname )" \
-          tracuri="$( invirt-getconf trac.uri )" \
-          svnpath="$( invirt-getconf svn.repopath )"
-
-    cat > /etc/apache2/sites-available/ssl << EOF
-<VirtualHost *:443>
-       ServerAdmin $hostname
-       ServerName $trachost:443
-       
-       DocumentRoot /var/www/sipb-xen-www
-       <Directory /var/www/sipb-xen-www>
-               Options Indexes FollowSymLinks MultiViews ExecCGI
-               AllowOverride None
-               Order allow,deny
-               allow from all
-       </Directory>
-       <Location />
-               Require valid-user
-               AuthType SSLCert
-               AuthSSLCertVar SSL_CLIENT_S_DN_Email
-               AuthSSLCertStripSuffix "@MIT.EDU"
-       </Location>
-
-       RewriteEngine On
-       RewriteRule ^/favicon.ico - [L]
-       RewriteRule ^/static(.*) - [L]
-       RewriteRule ^/overlord/static(.*) /static/\$1 [L]
-       RewriteRule ^/admin/static(.*) /static/\$1 [L]
-       RewriteRule ^/trac.fcgi(.*) - [L]
-       RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs\$1 [L]
-       RewriteRule ^/trac(.*) /var/www/trac/trac.fcgi\$1 [L]
-       RewriteRule ^/var(.*) - [L]
-       RewriteRule ^/wiki(.*) - [L]
-       RewriteRule ^/kill.cgi - [L]
-       RewriteRule ^/~ - [L]
-       RewriteRule ^/(.*) /var/www/sipb-xen-www/main.fcgi/\$1 [L]
-
-       RewriteLog /var/log/apache2/rewrite.log
-       RewriteLogLevel 0 
-
-       ErrorLog /var/log/apache2/error.log
-
-       # Possible values include: debug, info, notice, warn, error, crit,
-       # alert, emerg.
-       LogLevel warn
-
-       CustomLog /var/log/apache2/ssl_access.log combined
-       ServerSignature On
-
-       SSLEngine on
-
-       SSLCertificateFile ssl/server.crt
-       SSLCertificateKeyFile ssl/server.key
-       
-       SSLCACertificateFile ssl/mitCAclient.pem
-       SSLVerifyClient require
-       SSLVerifyDepth 10
-
-       SSLOptions +StdEnvVars
-       
-       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
-
-
-       Redirect /wiki $tracuri 
-</VirtualHost>
-
-<VirtualHost *:446>
-       ServerAdmin $errormail
-       ServerName $hostname:446
-       
-       DocumentRoot /var/www/sipb-xen-www
-       <Directory />
-               Options Indexes FollowSymLinks MultiViews ExecCGI
-               AllowOverride None
-               Order allow,deny
-               allow from all
-       </Directory>
-
-       ErrorLog /var/log/apache2/error.log
-
-       # Possible values include: debug, info, notice, warn, error, crit,
-       # alert, emerg.
-       LogLevel warn
-
-       CustomLog /var/log/apache2/ssl_nocert_access.log combined
-       ServerSignature On
-
-       SSLEngine on
-
-       SSLCertificateFile ssl/server.crt
-       SSLCertificateKeyFile ssl/server.key
-       
-       SSLVerifyClient none
-
-       SSLOptions +StdEnvVars
-       
-       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0        
-</VirtualHost>
-EOF
-
-    cat > /etc/apache2/sites-available/svn << EOF
-<VirtualHost *:1111>
-       ServerAdmin $errormail
-       ServerName $hostname:1111
-       
-       <Directory />
-               Options FollowSymLinks
-               AllowOverride None
-       </Directory>
-       <Location />
-               DAV svn
-               SVNPath $svnpath
-               AuthType Basic
-               AuthName "xvm.mit.edu subversion repository"
-               AuthUserFile /etc/apache2/dav_svn.passwd
-               <LimitExcept GET PROPFIND OPTIONS REPORT>
-                       Require valid-user
-               </LimitExcept>
-       </Location>
-
-       ErrorLog /var/log/apache2/error.log
-
-       # Possible values include: debug, info, notice, warn, error, crit,
-       # alert, emerg.
-       LogLevel warn
-
-       CustomLog /var/log/apache2/svn_access.log combined
-       ServerSignature On
-
-       SSLEngine on
-
-       SSLCertificateFile ssl/server.crt
-       SSLCertificateKeyFile ssl/server.key
-</VirtualHost>
-EOF
+    mako /etc/apache2/sites-available/{ssl,svn}.mako
 }
 
 case "$1" in
diff --git a/files/etc/apache2/sites-available/ssl.mako b/files/etc/apache2/sites-available/ssl.mako
new file mode 100644 (file)
index 0000000..7276a0b
--- /dev/null
@@ -0,0 +1,98 @@
+<%
+from invirt.config import structs as cfg
+hostname = cfg.web.hostname
+errmail  = cfg.web.errormail
+tracuri  = cfg.trac.uri
+%>
+<VirtualHost *:443>
+       ServerAdmin ${errmail}
+       ServerName ${hostname}:443
+       
+       DocumentRoot /var/www/sipb-xen-www
+       <Directory /var/www/sipb-xen-www>
+               Options Indexes FollowSymLinks MultiViews ExecCGI
+               AllowOverride None
+               Order allow,deny
+               allow from all
+       </Directory>
+       <Location />
+               Require valid-user
+               AuthType SSLCert
+               AuthSSLCertVar SSL_CLIENT_S_DN_Email
+               AuthSSLCertStripSuffix "@MIT.EDU"
+       </Location>
+
+       RewriteEngine On
+       RewriteRule ^/favicon.ico - [L]
+       RewriteRule ^/static(.*) - [L]
+       RewriteRule ^/overlord/static(.*) /static/$1 [L]
+       RewriteRule ^/admin/static(.*) /static/$1 [L]
+       RewriteRule ^/trac.fcgi(.*) - [L]
+       RewriteRule ^/trac/chrome/common(.*) /usr/share/trac/htdocs$1 [L]
+       RewriteRule ^/trac(.*) /var/www/trac/trac.fcgi$1 [L]
+       RewriteRule ^/var(.*) - [L]
+       RewriteRule ^/wiki(.*) - [L]
+       RewriteRule ^/kill.cgi - [L]
+       RewriteRule ^/~ - [L]
+       RewriteRule ^/(.*) /var/www/sipb-xen-www/main.fcgi/$1 [L]
+
+       RewriteLog /var/log/apache2/rewrite.log
+       RewriteLogLevel 0 
+
+       ErrorLog /var/log/apache2/error.log
+
+       # Possible values include: debug, info, notice, warn, error, crit,
+       # alert, emerg.
+       LogLevel warn
+
+       CustomLog /var/log/apache2/ssl_access.log combined
+       ServerSignature On
+
+       SSLEngine on
+
+       SSLCertificateFile ssl/server.crt
+       SSLCertificateKeyFile ssl/server.key
+       
+       SSLCACertificateFile ssl/mitCAclient.pem
+       SSLVerifyClient require
+       SSLVerifyDepth 10
+
+       SSLOptions +StdEnvVars
+       
+       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
+
+       Redirect /wiki ${tracuri}       
+</VirtualHost>
+
+<VirtualHost *:446>
+       ServerAdmin ${errmail}
+       ServerName ${hostname}:446
+       
+       DocumentRoot /var/www/sipb-xen-www
+       <Directory />
+               Options Indexes FollowSymLinks MultiViews ExecCGI
+               AllowOverride None
+               Order allow,deny
+               allow from all
+       </Directory>
+
+       ErrorLog /var/log/apache2/error.log
+
+       # Possible values include: debug, info, notice, warn, error, crit,
+       # alert, emerg.
+       LogLevel warn
+
+       CustomLog /var/log/apache2/ssl_nocert_access.log combined
+       ServerSignature On
+
+       SSLEngine on
+
+       SSLCertificateFile ssl/server.crt
+       SSLCertificateKeyFile ssl/server.key
+       
+       SSLVerifyClient none
+
+       SSLOptions +StdEnvVars
+       
+       SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0        
+</VirtualHost>
diff --git a/files/etc/apache2/sites-available/svn.mako b/files/etc/apache2/sites-available/svn.mako
new file mode 100644 (file)
index 0000000..1266338
--- /dev/null
@@ -0,0 +1,40 @@
+<%
+from invirt.config import structs as cfg
+hostname = cfg.web.hostname
+errmail  = cfg.web.errormail
+svnpath  = cfg.svn.repopath
+%>
+
+<VirtualHost *:1111>
+       ServerAdmin ${errormail}
+       ServerName ${hostname}:1111
+       
+       <Directory />
+               Options FollowSymLinks
+               AllowOverride None
+       </Directory>
+       <Location />
+               DAV svn
+               SVNPath ${svnpath}
+               AuthType Basic
+               AuthName "xvm.mit.edu subversion repository"
+               AuthUserFile /etc/apache2/dav_svn.passwd
+               <LimitExcept GET PROPFIND OPTIONS REPORT>
+                       Require valid-user
+               </LimitExcept>
+       </Location>
+
+       ErrorLog /var/log/apache2/error.log
+
+       # Possible values include: debug, info, notice, warn, error, crit,
+       # alert, emerg.
+       LogLevel warn
+
+       CustomLog /var/log/apache2/svn_access.log combined
+       ServerSignature On
+
+       SSLEngine on
+
+       SSLCertificateFile ssl/server.crt
+       SSLCertificateKeyFile ssl/server.key
+</VirtualHost>