# # # patch "htaccess" # from [2d7b0cbd638b1136b192755f4ff5517e40478e4c] # to [239290fd4efd6cd0bf27e6c0e4bed4a0688de8d0] # # patch "install" # from [4b57262f502771a900d51ea540f530fc59bfa818] # to [4f2e1416aee1b9d20205c23d4482fb2ea0527c5a] # # patch "skel/monotonerc" # from [122b23da7f885efe4496224b3dd00d6a206a4785] # to [5d87f59bdbd47d4b068ec82a5db8f64eb39d19ea] # # patch "www/login.php" # from [dd897a20596adc302dc6e5fdadc0dc0a71744374] # to [7a3c32e48996838bdc1b5f03ff393a75519a7b08] # # patch "www/proj-ctrl.php" # from [eb121c3d6cfe1ebb75106528500f38638b1b30be] # to [62ef570344065937711cdbe8e78d4fa1ee8b59cf] # # patch "www/viewmtn/config.py.example" # from [8d2d8bfe1c6e5664ddd6bbf74af7e726d3460c1f] # to [da968608a2444a4c8bdf4f8c91d8941295a4d8cc] # # patch "www/viewmtn/mtn.py" # from [de4f2d6e37972a1382bf71b3da3787bd02b70635] # to [172745ec4da85714e3257a1af2d2316803ab78dc] # ============================================================ --- htaccess 2d7b0cbd638b1136b192755f4ff5517e40478e4c +++ htaccess 239290fd4efd6cd0bf27e6c0e4bed4a0688de8d0 @@ -1,5 +1,5 @@ - SetHandler fastcgi-script + SetHandler fcgid-script Options +ExecCGI ============================================================ --- install 4b57262f502771a900d51ea540f530fc59bfa818 +++ install 4f2e1416aee1b9d20205c23d4482fb2ea0527c5a @@ -97,7 +97,7 @@ do_install() { make usher.webhost cp usher.webhost $BINDIR/usher.$BINNAME - if [ ! -d $CONFDIR ] || [ "$1" == "--force-conffiles" ]; then + if [ ! -d "$CONFDIR" ] || [ "$1" == "--force-conffiles" ]; then if [ -d $CONFDIR ]; then echo "Replacing your configuration..." else ============================================================ --- skel/monotonerc 122b23da7f885efe4496224b3dd00d6a206a4785 +++ skel/monotonerc 5d87f59bdbd47d4b068ec82a5db8f64eb39d19ea @@ -23,10 +23,10 @@ end return false end -read_config(); +read_config() function get_passphrase(keyid) - if keyid == hostkey then + if keyid.given_name == hostkey then return hostkeypass end return nil @@ -38,7 +38,7 @@ function get_netsync_write_permitted(ide old_get_wperm = get_netsync_write_permitted function get_netsync_write_permitted(ident) - if ident == hostkey then return true end + if ident.given_name == hostkey then return true end return old_get_wperm(ident) end ============================================================ --- www/login.php dd897a20596adc302dc6e5fdadc0dc0a71744374 +++ www/login.php 7a3c32e48996838bdc1b5f03ff393a75519a7b08 @@ -14,7 +14,7 @@ function page_head() { } function page_head() { - global $validuser, $username, $location, $DOCTYPE; + global $validuser, $username, $location, $DOCTYPE, $confdir; $level = 'main'; ?> ============================================================ --- www/proj-ctrl.php eb121c3d6cfe1ebb75106528500f38638b1b30be +++ www/proj-ctrl.php 62ef570344065937711cdbe8e78d4fa1ee8b59cf @@ -154,8 +154,8 @@ if ($action == "new_project") { symlink('../../project.php', "$projwww/index.php"); exec("$monotone -d $projdir/database db init 2>&1", $out, $res2); exec("chmod ug+rwX '$projdir' '$projdir'/database* 2>&1", $out, $res3); - if ($res1 || $res2 || $res3) { - $errmsg = array("error" => "Internal server error", "verboseError" => $out); + if ($res2 || $res3) { + $errmsg = array("error" => "Internal server error", "verboseError" => print_r($out, true)); } usherctrl("RELOAD"); } while (false); ============================================================ --- www/viewmtn/config.py.example 8d2d8bfe1c6e5664ddd6bbf74af7e726d3460c1f +++ www/viewmtn/config.py.example da968608a2444a4c8bdf4f8c91d8941295a4d8cc @@ -47,6 +47,7 @@ for s in file_tokens(conffile): lastkey = s config_data[lastkey] = [] +hostkey = config_data['hostkey'][0] # default addresses should work without modification # if running viewmtn standalone. You must change these ============================================================ --- www/viewmtn/mtn.py de4f2d6e37972a1382bf71b3da3787bd02b70635 +++ www/viewmtn/mtn.py 172745ec4da85714e3257a1af2d2316803ab78dc @@ -19,6 +19,8 @@ import genproxy from traceback import format_exc import genproxy +import config + import web from web import debug @@ -54,7 +56,7 @@ class Author(str): str.__init__(v) self.obj_type = "author" -packet_header_re = re.compile(r'^(\d+):([lm]):(\d+):') +packet_header_re = re.compile(r'^(\d+):([a-z]):(\d+):') class Automate(object): """Runs commands via a particular monotone process. This @@ -66,7 +68,11 @@ class Automate(object): stopped and a new one created. """ def __init__(self, monotone, host, **kwargs): - self.command = [monotone, "automate", "remote_stdio", pipes.quote(host)] + self.command = [monotone, "automate", "remote_stdio", "-d:memory:", + "--confdir=%s" % config.confdir, + "--key=%s" % config.hostkey, + "--reallyquiet", + pipes.quote(host)] self.lock = threading.Lock() self.process = None @@ -204,7 +210,11 @@ class Automate(object): buffer = buffer[header_length+length:] complete = pstate == 'l' in_packet = False - yield complete, result + if pstate == 'l' or pstate == 'm': + yield complete, result + else: + # maybe do something with error/ticker/etc packets? + pass if complete: break @@ -355,7 +365,7 @@ class Operations(object): """Call this method every distinct request, to allow Operations to do any cleanup operations. """ - self.automate.check_current() + pass def tags(self): for stanza in basic_io_from_stream(self.automate.run('tags', [])):