From e91f7b060ef128cd6f4b41b0786ffde3552c11bb Mon Sep 17 00:00:00 2001 From: mediocregopher <> Date: Sun, 29 Mar 2020 14:59:01 -0600 Subject: [PATCH] make docker-remote not force a .git extension --- type: change message: |- make docker-remote not force a .git extension There wasn't really a good reason to do so, except convention maybe, but even then I'm not sure it was a real convention. This commit also fixes the docker image naming for docker-remote change_hash: AAdGtR83SalP03yPlU0FDNkzlDzgWFXs08vJ26KtB8du credentials: - type: pgp_signature pub_key_id: 95C46FA6A41148AC body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl6BDAkACgkQlcRvpqQRSKwcsxAAtfvN8xNqWAXS48MVApoFPtK4GoUeoJsW+2KVWlaHYxwOtROaLoXBp+reNn9ESeetebQB8qPY44/xwmQuZ//CKt1iDvGqf470FW6bnm+LFNmpX5X49WUKs2KeTSXBeVYRtz8vZKPkQyfhlcUB2rHtVIWbqXPFXV4UtufqEnSu1LEgF+MORkNzOkoF35xRzp6pUlcmOc4Q1TUvK5+m3QXQpD9g3imA2fp49rmfVQ4E9OdtFAPxfhCWEdi2Zre8k9W2XFgCak/SX++9i1/7eyfC896RiCPD/cR/OvzXlCE8psuORAJ0MqcaJCYWz84KWVKH2sHqmkT0AYnrJRV+QXWWUS3ePZX/LzGBqgkxU8AuNiGXiDl5X9XVBRpCbYdwAjO0s4CoV6okH06euqlpvKhsLDKW6/TlIAqDVNg91Pqklu/oSd37faGCDfvDgsWvuypXe1VG+o2MXIdP5Z1Keis0tPKRyNCILa9aG8Jzue4Eaa3OnLCPnzT/MaXbTgAosLZf/IObyEGNhGnGZzUXXlwbwJNHQfeim1sILUEWCTU7/NrupSPOmjNzFcSQmvmLj4iBqnFikQez48uYl/ZL7jFYxbOxiPmXCNe+NX42TExT9P6wLkQs5kKzFbNKUgx5W5ou1ZQuqJ8CflS/eUBA+FEpb4nYdgPMKNwMPW/MD42Z1Uk= account: mediocregopher --- cmd/dehub-remote/README.md | 15 +++++++++------ cmd/dehub-remote/nginx.conf | 4 ++-- cmd/dehub-remote/run.sh | 6 ------ cmd/dehub-remote/start.sh | 2 +- 4 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 cmd/dehub-remote/run.sh 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"