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/20 18:52:20 UTC
[4/4] allura git commit: [#8128] docker file for git over http
[#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/73cf309c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/73cf309c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/73cf309c
Branch: refs/heads/db/8128
Commit: 73cf309ca552ce0c24ae7ac60ae9a9138aed7c6d
Parents: fd18061
Author: Dave Brondsema <da...@brondsema.net>
Authored: Mon Sep 19 18:28:17 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Sep 20 14:52:10 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/73cf309c/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/73cf309c/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/73cf309c/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