You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/09/23 18:37:13 UTC

[1/6] allura git commit: [#8128] show 2FA+HTTP checkout message when needed

Repository: allura
Updated Branches:
  refs/heads/master 7fb402233 -> 77619a1b6


[#8128] show 2FA+HTTP checkout message when needed


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/77619a1b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/77619a1b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/77619a1b

Branch: refs/heads/master
Commit: 77619a1b6a55ab776a4372f12b25310c61b4f37a
Parents: e529920
Author: Dave Brondsema <da...@brondsema.net>
Authored: Thu Sep 22 16:43:43 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 Allura/allura/templates/repo/repo_master.html | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/77619a1b/Allura/allura/templates/repo/repo_master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/repo_master.html b/Allura/allura/templates/repo/repo_master.html
index 1d94285..eb51f79 100644
--- a/Allura/allura/templates/repo/repo_master.html
+++ b/Allura/allura/templates/repo/repo_master.html
@@ -38,10 +38,16 @@
   $('#access_urls .btn').click(function(evt){
     evt.preventDefault();
     var parent = $(this).parents('.btn-bar');
-    $(parent).find('input').val($(this).attr('data-url'));
+    var checkout_cmd = $(this).attr('data-url');
+    $(parent).find('input').val(checkout_cmd);
     $(parent).find('span').text($(this).attr('title')+' access');
     $(this).parent().children('.btn').removeClass('active');
     $(this).addClass('active');
+    if (checkout_cmd.indexOf(' http://') !== -1 || checkout_cmd.indexOf(' https://') !== -1 ) {
+      $('#http-2fa-msg').show();
+    } else {
+      $('#http-2fa-msg').hide();
+    }
   });
   $('#access_urls .btn').first().click();
 
@@ -110,6 +116,12 @@
              class="selectText"
              value=""/>
     </div>
+    {% if not c.user.is_anonymous() and c.user.get_pref('multifactor') and h.has_access(c.app, 'write') %}
+        <div id="http-2fa-msg" class="grid-19 info" style="display: none">
+        When using HTTP access with two-factor auth, you will need to enter your password and current token together as
+        the password (e.g. "p4ssw0Rd123456")
+        </div>
+    {% endif %}
     <hr>
   {% endif %}
 {% endmacro %}


[4/6] allura git commit: [#8128] docker file for git over http

Posted by br...@apache.org.
[#8128] docker file for git over http


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/b6d1c2fa
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/b6d1c2fa
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/b6d1c2fa

Branch: refs/heads/master
Commit: b6d1c2fa22b5267925cb5e181a91becd7bc9c7e9
Parents: a2a07fb
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Sep 19 18:28:17 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 docker-compose.yml                | 10 +++++++
 scm_config/git-http/Dockerfile    | 51 +++++++++++++++++++++++++++++++++
 scm_config/git-http/git-http.conf | 52 ++++++++++++++++++++++++++++++++++
 3 files changed, 113 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b6d1c2fa/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 22c9a38..316046e 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -74,3 +74,13 @@ inmail:
     - "8825:8825"
   links:
     - mongo
+
+git-http:
+  build: scm_config/git-http/
+  ports:
+    - "8081:80"
+  volumes_from:
+    - web
+  links:
+    - mongo
+    - web
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b6d1c2fa/scm_config/git-http/Dockerfile
----------------------------------------------------------------------
diff --git a/scm_config/git-http/Dockerfile b/scm_config/git-http/Dockerfile
new file mode 100644
index 0000000..3479632
--- /dev/null
+++ b/scm_config/git-http/Dockerfile
@@ -0,0 +1,51 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+
+# loosely inspired by https://github.com/jacksoncage/apache-docker/blob/ubuntu/Dockerfile
+# not inspired by https://hub.docker.com/_/httpd/ which does a custom source-based install of httpd
+
+# match main allura Dockerfile, for shared base
+FROM ubuntu:14.04
+
+RUN apt-get update && apt-get install -y \
+    apache2 \
+    libapache2-mod-python \
+    git
+
+
+ENV APACHE_RUN_USER www-data
+ENV APACHE_RUN_GROUP www-data
+ENV APACHE_LOG_DIR /var/log/apache2
+ENV APACHE_PID_FILE /var/run/apache2.pid
+ENV APACHE_RUN_DIR /var/run/apache2
+ENV APACHE_LOCK_DIR /var/lock/apache2
+ENV APACHE_SERVERADMIN admin@localhost
+ENV APACHE_SERVERNAME localhost
+ENV APACHE_SERVERALIAS docker.localhost
+ENV APACHE_DOCUMENTROOT /var/www
+
+ADD ./git-http.conf /etc/apache2/sites-available/
+RUN a2dissite 000-default.conf
+RUN a2ensite git-http.conf
+
+RUN a2enmod cgi
+
+# so that git operations run as root, and can modify the scm repo files
+RUN chmod u+s /usr/lib/git-core/git-http-backend
+
+CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/b6d1c2fa/scm_config/git-http/git-http.conf
----------------------------------------------------------------------
diff --git a/scm_config/git-http/git-http.conf b/scm_config/git-http/git-http.conf
new file mode 100644
index 0000000..40cbfef
--- /dev/null
+++ b/scm_config/git-http/git-http.conf
@@ -0,0 +1,52 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+ErrorLog /dev/stderr
+
+# see also Allura/docs/getting_started/scm_host.rst
+
+<VirtualHost *:80>
+
+    SetEnv GIT_PROJECT_ROOT /allura-data/scm/git
+    SetEnv GIT_HTTP_EXPORT_ALL
+    ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
+
+    # disable access to default web content
+    <Directory /var/www>
+        Order Deny,Allow
+        Deny from all
+        Options None
+        AllowOverride None
+    </Directory>
+
+    <Location "/git/">
+        Require all granted
+
+        AddHandler mod_python .py
+        PythonAccessHandler /allura/scripts/ApacheAccessHandler.py
+        PythonDebug On
+
+        AuthType Basic
+        AuthName "Git Access"
+        AuthBasicAuthoritative off
+        PythonOption ALLURA_PERM_URL http://web:8080/auth/repo_permissions
+        PythonOption ALLURA_AUTH_URL http://web:8080/auth/do_login
+        # for 'requests' lib only
+        PythonOption ALLURA_VIRTUALENV /allura-data/virtualenv
+    </Location>
+
+</VirtualHost>
\ No newline at end of file


[3/6] allura git commit: [#8128] update ApacheAccessHandler.py docs for httpd 2.4, remove unneeded proxy stuff

Posted by br...@apache.org.
[#8128] update ApacheAccessHandler.py docs for httpd 2.4, remove unneeded proxy stuff


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a2a07fb3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a2a07fb3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a2a07fb3

Branch: refs/heads/master
Commit: a2a07fb356e0a46cb2db14eca6d9cd6e6b989d9f
Parents: 7fb4022
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Sep 19 18:27:24 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 Allura/docs/getting_started/scm_host.rst | 14 +++++++++++---
 scripts/ApacheAccessHandler.py           | 24 +++++++++++++-----------
 2 files changed, 24 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a2a07fb3/Allura/docs/getting_started/scm_host.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/scm_host.rst b/Allura/docs/getting_started/scm_host.rst
index 18811b5..7b94f95 100644
--- a/Allura/docs/getting_started/scm_host.rst
+++ b/Allura/docs/getting_started/scm_host.rst
@@ -48,7 +48,7 @@ and subsequent chapters.
 
     sudo chmod 775 /srv/*  # make sure apache can read the repo dirs
     sudo apt-get install apache2
-    sudo a2enmod proxy rewrite
+    sudo a2enmod cgi
     sudo vi /etc/apache2/sites-available/default
 
 And add the following text within the :code:`<VirtualHost>` block:
@@ -57,11 +57,14 @@ And add the following text within the :code:`<VirtualHost>` block:
 
     SetEnv GIT_PROJECT_ROOT /srv/git
     SetEnv GIT_HTTP_EXPORT_ALL
-    ProxyPass /git/ !
     ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
 
     # no authentication required at all - for testing purposes
     SetEnv REMOTE_USER=git-allura
+    <Location "/git/">
+        # new for httpd 2.4
+        Require all granted
+    </Location>
 
 Then exit vim (:kbd:`<esc> :wq`) and run:
 
@@ -191,7 +194,7 @@ First, you need to ensure that mod_python is installed:
 
     sudo aptitude install libapache2-mod-python
 
-Then, in the VirtualHost section where you proxy SCM requests to git, SVN, or Hg, add the
+Then, in the VirtualHost section where you send SCM requests to git, SVN, or Hg, add the
 access handler, e.g.:
 
 .. code-block:: console
@@ -201,12 +204,17 @@ access handler, e.g.:
 .. code-block:: apache
 
     <LocationMatch "^/(git|svn|hg)/">
+        # new for httpd 2.4
+        Require all granted
+
         AddHandler mod_python .py
         # Change this path if needed:
         PythonAccessHandler /home/vagrant/src/allura/scripts/ApacheAccessHandler.py
+
         AuthType Basic
         AuthName "SCM Access"
         AuthBasicAuthoritative off
+
         # Change this path if needed:
         PythonOption ALLURA_VIRTUALENV /home/vagrant/env-allura
         # This routes back to the allura webapp

http://git-wip-us.apache.org/repos/asf/allura/blob/a2a07fb3/scripts/ApacheAccessHandler.py
----------------------------------------------------------------------
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 1ee9ebc..89654c5 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -26,20 +26,22 @@ Here is a quick example for your apache settings (assuming ProxyPass)
 
     SetEnv GIT_PROJECT_ROOT /opt/allura/scm/git
     SetEnv GIT_HTTP_EXPORT_ALL
-    ProxyPass /git/ !
     ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
 
     <Location "/git/">
-            AddHandler mod_python .py
-            PythonAccessHandler /path/to/ApacheAccessHandler.py
-            PythonDebug On
-
-            AuthType Basic
-            AuthName "Git Access"
-            AuthBasicAuthoritative off
-            PythonOption ALLURA_PERM_URL https://127.0.0.1/auth/repo_permissions
-            PythonOption ALLURA_AUTH_URL https://127.0.0.1/auth/do_login
-            PythonOption ALLURA_VIRTUALENV /var/local/env-allura
+        # new for httpd 2.4
+        Require all granted
+
+        AddHandler mod_python .py
+        PythonAccessHandler /path/to/ApacheAccessHandler.py
+        PythonDebug On
+
+        AuthType Basic
+        AuthName "Git Access"
+        AuthBasicAuthoritative off
+        PythonOption ALLURA_PERM_URL https://127.0.0.1/auth/repo_permissions
+        PythonOption ALLURA_AUTH_URL https://127.0.0.1/auth/do_login
+        PythonOption ALLURA_VIRTUALENV /var/local/env-allura
     </Location>
 
 """


[2/6] allura git commit: [#8128] support TOTP two-factor auth by appending your code to your password

Posted by br...@apache.org.
[#8128] support TOTP two-factor auth by appending your code to your password


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/f0474db9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/f0474db9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/f0474db9

Branch: refs/heads/master
Commit: f0474db955cfab025fffda34b458ebb0609e8976
Parents: 755eb4f
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 20 13:53:41 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 Allura/docs/getting_started/scm_host.rst |  5 +++
 scripts/ApacheAccessHandler.py           | 46 +++++++++++++++++++++++++--
 2 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/f0474db9/Allura/docs/getting_started/scm_host.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/getting_started/scm_host.rst b/Allura/docs/getting_started/scm_host.rst
index 7b94f95..9141edf 100644
--- a/Allura/docs/getting_started/scm_host.rst
+++ b/Allura/docs/getting_started/scm_host.rst
@@ -241,6 +241,11 @@ message.
     and write requests and thus requires WRITE permission for every request.
     See ticket #7288
 
+.. note::
+
+    If two-factor auth is enabled, enter your password + current 6-digit code together, as your password.
+    You will have to enter your password each time, and may run into temporary permission denied when it fails.
+
 
 Advanced Alternative
 --------------------

http://git-wip-us.apache.org/repos/asf/allura/blob/f0474db9/scripts/ApacheAccessHandler.py
----------------------------------------------------------------------
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index b8fc2fe..3d01f0c 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -113,10 +113,16 @@ def check_repo_path(req):
     return repo_path is not None
 
 
+class RateLimitExceeded(Exception):
+    pass
+
+
 def check_authentication(req):
     password = req.get_basic_auth_pw()  # MUST be called before req.user
     username = req.user
     log(req, "checking auth for: %s" % username)
+    if not username or not password:
+        return False
     auth_url = req.get_options().get('ALLURA_AUTH_URL', 'https://127.0.0.1/auth/do_login')
     r = requests.post(auth_url, allow_redirects=False, data={
         'username': username,
@@ -126,7 +132,37 @@ def check_authentication(req):
     }, cookies={
         '_session_id': 'this-is-our-session',
     })
-    return r.status_code == 302 and r.headers['location'].endswith('/login_successful')
+    if r.status_code == 302 and r.headers['location'].endswith('/login_successful'):
+        return True
+    else:
+        # try 2FA
+        password, code = password[:-6], password[-6:]
+        log(req, 'trying multifactor for user: %s' % username)
+        sess = requests.Session()
+        r = sess.post(auth_url, allow_redirects=False, data={
+            'username': username,
+            'password': password,
+            'return_to': '/login_successful',
+            '_session_id': 'this-is-our-session',
+        }, cookies={
+            '_session_id': 'this-is-our-session',
+        })
+        if r.status_code == 302 and '/auth/multifactor' in r.headers['location']:
+            multifactor_url = auth_url.replace('do_login', 'do_multifactor')
+            r = sess.post(multifactor_url, allow_redirects=False, data={
+                'mode': 'totp',
+                'code': code,
+                'return_to': '/login_successful',
+                '_session_id': 'this-is-our-session',
+            }, cookies={
+                '_session_id': 'this-is-our-session',
+            })
+            if r.status_code == 302 and r.headers['location'].endswith('/login_successful'):
+                return True
+            else:
+                if 'rate limit exceeded' in r.text:
+                    raise RateLimitExceeded()
+    return False
 
 
 def check_permissions(req):
@@ -156,9 +192,13 @@ def handler(req):
     req.add_common_vars()
 
     if not check_repo_path(req):
+        log(req, 'path not found in Allura for URL %s' % req.parsed_uri[apache.URI_PATH])
         return apache.HTTP_NOT_FOUND
-
-    authenticated = check_authentication(req)
+    try:
+        authenticated = check_authentication(req)
+    except RateLimitExceeded as e:
+        # HTTP "Too Many Requests" to give the user a bit of a hint about why it failed
+        return 429
     if req.user and not authenticated:
         return apache.HTTP_UNAUTHORIZED
 


[6/6] allura git commit: [#8128] comments

Posted by br...@apache.org.
[#8128] comments


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/755eb4f2
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/755eb4f2
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/755eb4f2

Branch: refs/heads/master
Commit: 755eb4f200211a2b0293444cf7c41ab900656c15
Parents: b6d1c2f
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 20 11:58:16 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 scm_config/git-http/git-http.conf | 2 +-
 scripts/ApacheAccessHandler.py    | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/755eb4f2/scm_config/git-http/git-http.conf
----------------------------------------------------------------------
diff --git a/scm_config/git-http/git-http.conf b/scm_config/git-http/git-http.conf
index 40cbfef..f6f059e 100644
--- a/scm_config/git-http/git-http.conf
+++ b/scm_config/git-http/git-http.conf
@@ -45,7 +45,7 @@ ErrorLog /dev/stderr
         AuthBasicAuthoritative off
         PythonOption ALLURA_PERM_URL http://web:8080/auth/repo_permissions
         PythonOption ALLURA_AUTH_URL http://web:8080/auth/do_login
-        # for 'requests' lib only
+        # for 'requests' lib only, doesn't have to be full allura venv
         PythonOption ALLURA_VIRTUALENV /allura-data/virtualenv
     </Location>
 

http://git-wip-us.apache.org/repos/asf/allura/blob/755eb4f2/scripts/ApacheAccessHandler.py
----------------------------------------------------------------------
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 89654c5..b8fc2fe 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -41,9 +41,13 @@ Here is a quick example for your apache settings (assuming ProxyPass)
         AuthBasicAuthoritative off
         PythonOption ALLURA_PERM_URL https://127.0.0.1/auth/repo_permissions
         PythonOption ALLURA_AUTH_URL https://127.0.0.1/auth/do_login
+        # for 'requests' lib only, doesn't have to be full allura venv
         PythonOption ALLURA_VIRTUALENV /var/local/env-allura
     </Location>
 
+
+This could also use the Allura code and authorize directly, but it's useful to be able to run
+this authorization code without Allura set up and configured on the git host.
 """
 
 


[5/6] allura git commit: [#8128] make repo refresh work

Posted by br...@apache.org.
[#8128] make repo refresh work


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e529920d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e529920d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e529920d

Branch: refs/heads/master
Commit: e529920d3be44c00b35227cbe1382e8b3a66eafb
Parents: f0474db
Author: Dave Brondsema <da...@brondsema.net>
Authored: Tue Sep 20 14:24:31 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Sep 23 14:37:00 2016 -0400

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 3 ++-
 Allura/development.ini            | 3 +++
 Allura/docker-dev.ini             | 9 +++++++--
 scm_config/git-http/Dockerfile    | 3 ++-
 4 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/e529920d/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 8ee52b5..2f265fd 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -575,8 +575,9 @@ class Repository(Artifact, ActivityObject):
         return self.app_config.url()
 
     def refresh_url(self):
+        refresh_base_url = tg.config.get('scm.repos.refresh_base_url') or tg.config.get('base_url', 'http://localhost:8080')
         return '/'.join([
-            tg.config.get('base_url', 'http://localhost:8080').rstrip('/'),
+            refresh_base_url.rstrip('/'),
             'auth/refresh_repo',
             self.url().lstrip('/'),
         ])

http://git-wip-us.apache.org/repos/asf/allura/blob/e529920d/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index b160ef6..6e9c1d3 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -346,6 +346,9 @@ scm.clone.ro.svn = svn checkout $source_url $dest_path
 scm.clone.https_anon.svn = svn checkout $source_url $dest_path
 scm.clone.svn = svn checkout --username=$username $source_url $dest_path
 
+; Only needed if different than "base_url" (e.g. if "base_url" isn't reachable from SCM hosts and you need an internal hostname)
+;scm.repos.refresh_base_url = http://localhost:8080
+
 scm.repos.root = /srv
 scm.repos.tarball.enable = false
 scm.repos.tarball.root = /usr/share/nginx/www/

http://git-wip-us.apache.org/repos/asf/allura/blob/e529920d/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index dacc99c..eb4d8f7 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -29,9 +29,14 @@ ming.main.uri = mongodb://mongo:27017/allura
 ming.project.uri = mongodb://mongo:27017/project-data
 ming.task.uri = mongodb://mongo:27017/task
 
+scm.repos.refresh_base_url = http://web:8080
+
 scm.repos.root = /allura-data/scm
-scm.host.ro.git = /allura-data/scm/git$path
-scm.host.rw.git = /allura-data/scm/git$path
+; may need to change "localhost" to your remote host name, or docker-machine IP address
+scm.host.ro.git = http://localhost:8081/git$path
+scm.host.rw.git = http://localhost:8081/git$path
+scm.host.https.git = http://localhost:8081/git$path
+scm.host.https_anon.git = http://localhost:8081/git$path
 scm.host.ro.hg = /allura-data/scm/hg$path
 scm.host.rw.hg = /allura-data/scm/hg$path
 scm.host.ro.svn = file:///allura-data/scm/svn$path/

http://git-wip-us.apache.org/repos/asf/allura/blob/e529920d/scm_config/git-http/Dockerfile
----------------------------------------------------------------------
diff --git a/scm_config/git-http/Dockerfile b/scm_config/git-http/Dockerfile
index 3479632..8f5650f 100644
--- a/scm_config/git-http/Dockerfile
+++ b/scm_config/git-http/Dockerfile
@@ -25,7 +25,8 @@ FROM ubuntu:14.04
 RUN apt-get update && apt-get install -y \
     apache2 \
     libapache2-mod-python \
-    git
+    git \
+    curl
 
 
 ENV APACHE_RUN_USER www-data