Commits

Wez Furlong committed c7819e5

remove hgweb proxying; I'm only going to support SSH access with mtrack.

  • Participants
  • Parent commits 064e25b

Comments (0)

Files changed (4)

bin/hgweb.cgi

-#!/usr/bin/python
-# vim:ts=2:sw=2:et:
-# For licensing and copyright terms, see the file named LICENSE
-
-import sys
-from mercurial import demandimport; demandimport.enable()
-from mercurial.hgweb import hgweb, wsgicgi
-application = hgweb(sys.argv[3], sys.argv[2])
-wsgicgi.launch(application)

config.ini.sample

 allow_user_repo_creation = true
 ; Where per-user repositories should be created (both git and hg)
 basedir = "@{core:vardir}/repos"
-; For Mercurial push/pull support, mtrack will enable hgweb support
-; automatically, but this will be subject to the authentication protocols
-; you have configured.  This may result in unexpected authentication
-; behavior when using the SCM tools
-; The URL over which users can clone, push, pull 
+
+; The SSH user@host which can be used to access repos. You must have configured
+; SSH access as described in the mtrack SSH installation documentation
+;serverurl = "code@example.com"
+
+; The URL over which users can clone, push, pull via HG.
+; You need to configure this URL yourself using your choice of Mercurial server.
+; This is ignored if you have set serverurl.
 ;hg.serverurl = "http://example.com/hg"
 ;
 ; The URL over which users can clone, push, pull via GIT.
 ; You need to configure this URL yourself using your choice of Git server.
+; This is ignored if you have set serverurl.
 ;git.serverurl = "http://example.com/git"
 
 [solr]
     if ($url) {
       return "ssh://$url/" . $this->getBrowseRootName();
     }
-    global $ABSWEB;
-    return $ABSWEB . 'srv/hg.php/' . $this->getBrowseRootName();
+    return null;
   }
 
   public function getBranches()

web/srv/hg.php

-<?php # vim:ts=2:sw=2:et:
-/* For licensing and copyright terms, see the file named LICENSE */
-
-# Note well: a possible failure point here is PHP's maximum upload
-# size limit when handling PUSHes.
-
-include '../../inc/common.php';
-MTrackACL::requireAllRights('Browser', 'read');
-
-$pi = mtrack_get_pathinfo(true);
-$cmd = dirname(__FILE__) . "/../../bin/hgweb.cgi ";
-
-if (strlen($pi) > 1 && false) {
-  $repo = MTrackSCM::factory($pi);
-  if ($repo->scmtype != 'hg') {
-    throw new Exception("invalid repo type for hg srv URL");
-  }
-  $cmd .= escapeshellarg($repo->repopath);
-  $cmd .= ' ' . escapeshellarg($repo->getBrowseRootName());
-} else {
-  $cmd .= " '' '' ";
-}
-$cmd .= ' ' . escapeshellarg(
-  MTrackConfig::get('core', 'vardir') . "/repos/hgconfig");
-
-# Fake up a CGI environment
-foreach ($_SERVER as $k => $v) {
-  putenv("$k=$v");
-}
-
-if (!isset($_SERVER['HTTPS'])) {
-  # lie
-  putenv('HTTPS=on');
-}
-
-if (php_sapi_name() == 'cgi') {
-  system($cmd);
-  exit;
-}
-
-$payload = tmpfile();
-$input = fopen('php://input', 'rb');
-if ($input) {
-  stream_copy_to_stream($input, $payload);
-  rewind($payload);
-}
-
-$p = proc_open($cmd, array(
-    0 => $payload,
-    1 => array('pipe', 'w'),
-    2 => array('file', dirname(__FILE__) . '/../../var/srv.log', 'a'),
-  ), $pipes);
-
-# Read HTTP headers first
-while (($line = fgets($pipes[1])) !== false) {
-  if ($line == "\r\n") {
-    break;
-  }
-  $line = rtrim($line);
-  header($line);
-}
-
-fpassthru($pipes[1]);
-
-#var_dump($repo);
-#var_dump($_SERVER);
-
-exit;