diff --git a/cmd/dehub-remote/README.md b/cmd/dehub-remote/README.md index d49d82b..43c4bab 100644 --- a/cmd/dehub-remote/README.md +++ b/cmd/dehub-remote/README.md @@ -4,8 +4,11 @@ This directory provides a simple Docker image which can be spun up to run a dehub-enabled git http remote server. Commits which are pushed to this server will be automatically verified using `dehub verify`. -The docker image is also being hosted on docker hub at `mediocregopher/dehub`. -Proper image tagging/versioning coming soon! +The docker image is also being hosted on docker hub at +[mediocregopher/dehub-remote][dehub-remote]. Proper image tagging/versioning +coming soon! + +[dehub-remote]: https://hub.docker.com/repository/docker/mediocregopher/dehub-remote ## Usage @@ -17,12 +20,13 @@ docker run \ -v /opt/dehub/repos:/repos \ -v /opt/dehub/www:/var/www \ -p 8080:80 \ - mediocregopher/dehub repo-a repo-b + mediocregopher/dehub-remote repo-a.git repo-b.git ``` Will start an http server on port 8080, using `/opt/dehub/repos` to store all -repo folders. It will then initialize repos at `/opt/dehub/repos/repo-a.git` and -`/opt/dehub/repos/repo-b.git`, if they arent already there. +repo folders. It will then initialize repo directories at +`/opt/dehub/repos/repo-a.git` and `/opt/dehub/repos/repo-b.git`, if they arent +already there. If a volume for `/var/www` is given then that will be used as the root for all non-git http requests. @@ -32,4 +36,3 @@ non-git http requests. The Dockerfile being used is based on [gitbox](https://github.com/nmarus/docker-gitbox), so thank you to nmarus for the great work there. - diff --git a/cmd/dehub-remote/nginx.conf b/cmd/dehub-remote/nginx.conf index b59ad46..e9c5cb0 100644 --- a/cmd/dehub-remote/nginx.conf +++ b/cmd/dehub-remote/nginx.conf @@ -31,12 +31,12 @@ http { error_log /var/log/nginx/MYSERVER.error.log error; #git SMART HTTP - location ~ /(.*\.git.*) { + location / { client_max_body_size 0; fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend; fastcgi_param GIT_HTTP_EXPORT_ALL ""; fastcgi_param GIT_PROJECT_ROOT /repos; - fastcgi_param PATH_INFO /$1; + fastcgi_param PATH_INFO $uri; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; } diff --git a/cmd/dehub-remote/run.sh b/cmd/dehub-remote/run.sh deleted file mode 100644 index 69ad918..0000000 --- a/cmd/dehub-remote/run.sh +++ /dev/null @@ -1,6 +0,0 @@ -docker run \ - --rm -it \ - --name gitbox \ - -p 8080:80 \ - -v $(pwd)/srv:/repos \ - gitbox diff --git a/cmd/dehub-remote/start.sh b/cmd/dehub-remote/start.sh index b816315..086d0da 100644 --- a/cmd/dehub-remote/start.sh +++ b/cmd/dehub-remote/start.sh @@ -67,7 +67,7 @@ sed -i "s,MYSERVER,${FQDN},g" /etc/nginx/nginx.conf &> /dev/null # create the individual repo directories while [ ! -z "$1" ]; do - dir="/repos/$1.git"; + dir="/repos/$1"; if [ ! -d "$dir" ]; then echo "Initializing repo $1" mkdir "$dir"