# # # add_file "htaccess" # content [26d297563036d691d1f930492d5eda382ad8fedd] # # patch "install" # from [e3b156b50f3207f6073c7b69c181fdde171c5540] # to [5e767e18b76dcb32d22751c0c14d606ad181af44] # # patch "www/common.php" # from [562f11880e88e483abb76608c6e84b094c424dd4] # to [b3d58f037ac01cd79b36aa512d985a4f5b53b281] # # patch "www/viewmtn/config.py.example" # from [97fbc51fb12393018862a3073aa718a25bfb6eac] # to [3d1577e03525c8b0374522ab8b7a385853d8b77f] # # patch "www/viewmtn/templates/base.html" # from [80e156cce6d5b84b160c953f38cdd91b03169e16] # to [e25f9cbfae9b9794e74497a4b10146b2fbdb1945] # # patch "www/viewmtn/viewmtn.py" # from [c95461a7b4351fa19c6cc6fa609dc4989773a0e8] # to [063769597c928c69c66f90bbf48c2766b4592c31] # ============================================================ --- htaccess 26d297563036d691d1f930492d5eda382ad8fedd +++ htaccess 26d297563036d691d1f930492d5eda382ad8fedd @@ -0,0 +1,17 @@ + + SetHandler fastcgi-script + + +Options +ExecCGI + + + RewriteEngine on + + RewriteCond %{REQUEST_URI} ^/NAME/viewmtn/$ + RewriteRule ^(.*)$ /NAME/ [L,R=seeother] + + RewriteCond %{REQUEST_URI} !^(/.*)+viewmtn.py/ + RewriteCond %{REQUEST_URI} !^/NAME/viewmtn/static/.* + RewriteRule ^(.*)$ viewmtn.py/$1 [PT] + + ============================================================ --- install e3b156b50f3207f6073c7b69c181fdde171c5540 +++ install 5e767e18b76dcb32d22751c0c14d606ad181af44 @@ -76,6 +76,8 @@ do_install() { # The main directory migh just have gotten destroyed, let's recreate it mkdir -p $WWWDIR/ (cd www; tar -cf - .) | (cd $WWWDIR; tar -xf -) + sed -e "s!NAME!$NAME!" \ + < htaccess > $WWWDIR/viewmtn/.htaccess chmod -R a+r $WWWDIR/ echo "Copied www/... to $WWWDIR/..." @@ -129,6 +131,7 @@ do_install() { -e "s!WWWDIR!$WWWDIR!" \ -e "s!LOGDIR!$LOGDIR!" \ -e "s!OWNER!$OWNER!" \ + -e "s!NAME!$NAME!" \ < hostconfig.dist > $CONFDIR/hostconfig.new install_file $CONFDIR/hostconfig /bin/true @@ -160,6 +163,7 @@ do_install() { if [ -f $WWWDIR/viewmtn/config.py.example ]; then sed -e "s!'CONFDIR'!'$CONFDIR'!" \ + -e "s!'NAME'!'$NAME'!" \ < $WWWDIR/viewmtn/config.py.example \ > $WWWDIR/viewmtn/config.py.new install_file $WWWDIR/viewmtn/config.py /bin/false ============================================================ --- www/common.php 562f11880e88e483abb76608c6e84b094c424dd4 +++ www/common.php b3d58f037ac01cd79b36aa512d985a4f5b53b281 @@ -1,5 +1,5 @@ '; ============================================================ --- www/viewmtn/config.py.example 97fbc51fb12393018862a3073aa718a25bfb6eac +++ www/viewmtn/config.py.example 3d1577e03525c8b0374522ab8b7a385853d8b77f @@ -23,18 +23,14 @@ import re import os import re +name = 'NAME' confdir = 'CONFDIR' conffile = confdir + '/hostconfig' -# default addresses should work without modification -# if running viewmtn standalone. You must change these -# if you run viewmtn with a web server, see INSTALL. -dynamic_uri_path = 'http://localhost:8080/' -static_uri_path = 'http://localhost:8080/static/' # if you are running under Apache2, set this. # don't set it otherwise, it breaks any other configuration # including running standalone. -running_under_apache2 = False +running_under_apache2 = True def file_tokens(fn): f = open(fn, 'r') data = f.read() @@ -55,11 +51,11 @@ for s in file_tokens(conffile): lastkey = s config_data[lastkey] = [] -def dynamic_uri_path(uri): - d = os.path.dirname(os.path.dirname(uri)) - return config_data['base_url'][0] + ('/projects/%s/viewmtn/' % os.path.basename(d)) -def static_uri_path(uri): - return config_data['base_url'][0] + '/viewmtn/static/' +# default addresses should work without modification +# if running viewmtn standalone. You must change these +# if you run viewmtn with a web server, see INSTALL. +dynamic_uri_path = config_data['base_url'][0] + 'viewmtn/' +static_uri_path = config_data['base_url'][0] + 'viewmtn/static/' # the path to the 'mtn' binary monotone = config_data['monotone'][0] @@ -68,9 +64,9 @@ monotone = config_data['monotone'][0] # everything in this database should be considered subject # to disclosure. So don't store your private key in # it! -def dbfile(uri): - d = os.path.dirname(os.path.dirname(uri)) - return (config_data['project_dir'][0] + '/%s/database.viewmtn') % os.path.basename(d) +def dbfile(project): + d = (config_data['project_dir'][0] + '/%s/database.viewmtn') % project + return d # highlight from http://andre-simon.de/ # if you don't have this available, just comment ============================================================ --- www/viewmtn/templates/base.html 80e156cce6d5b84b160c953f38cdd91b03169e16 +++ www/viewmtn/templates/base.html e25f9cbfae9b9794e74497a4b10146b2fbdb1945 @@ -1,5 +1,5 @@ - @@ -17,9 +17,17 @@