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/19 22:29:56 UTC

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

Repository: allura
Updated Branches:
  refs/heads/db/8128 [created] 3b8a27364


[#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/fd18061b
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/fd18061b
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/fd18061b

Branch: refs/heads/db/8128
Commit: fd18061b832671829a3b794b13ceef1be85da8e7
Parents: a941cec
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Sep 19 18:27:24 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Sep 19 18:29:04 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/fd18061b/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/fd18061b/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/2] 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/3b8a2736
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/3b8a2736
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/3b8a2736

Branch: refs/heads/db/8128
Commit: 3b8a27364c1860dbc64e4baac05be1412b3f0d94
Parents: fd18061
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Sep 19 18:28:17 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Sep 19 18:29:25 2016 -0400

----------------------------------------------------------------------
 docker-compose.yml           | 11 +++++++++
 scm_config/git/Dockerfile    | 50 +++++++++++++++++++++++++++++++++++++++
 scm_config/git/http-git.conf | 50 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/allura/blob/3b8a2736/scm_config/git/Dockerfile
----------------------------------------------------------------------
diff --git a/scm_config/git/Dockerfile b/scm_config/git/Dockerfile
new file mode 100644
index 0000000..3675dc4
--- /dev/null
+++ b/scm_config/git/Dockerfile
@@ -0,0 +1,50 @@
+#       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
+
+# WARNING: Image for service git was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
+
+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 ./http-git.conf /etc/apache2/sites-available/
+RUN a2dissite 000-default.conf
+RUN a2ensite http-git.conf
+
+RUN a2enmod cgi
+
+CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/allura/blob/3b8a2736/scm_config/git/http-git.conf
----------------------------------------------------------------------
diff --git a/scm_config/git/http-git.conf b/scm_config/git/http-git.conf
new file mode 100644
index 0000000..1707014
--- /dev/null
+++ b/scm_config/git/http-git.conf
@@ -0,0 +1,50 @@
+#       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
+
+<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