-
Background – Many Drupal developers have faced the problem of not being able to push to Drupal’s git repositories from behind a http proxy. This problem is particularly prevalent among University students (such as myself) as many universities have proxy servers. My proposal is to write a server-side CGI script that would allow developers to perform push operations to the Drupal git infrastructure over http.
-
Existing Implementations - Git already provides a mechanism for push operations over http know as SmartHttp. It uses a CGI script git-http-backend for this functionality. GitHub also allows its users to push to their git repositories over HTTP using Grack. However, we cannot use these existing mechanisms as they are not compatible with Drupal’s custom Authentication Mechanism.
-
Plan of Action : Drupal has a git-varnish-module, this module has a number of callbacks that input the credentials of the user and output the relevant response in JSON format. Currently Drupal uses a custom ssh daemon to interface with this module. The CGI script that would enable http compatibility would be similar in function to this ssh daemon.
STEP 1 – Study the ssh daemon, the callbacks it makes and how it handles the JSON output. Also study grack and git-http-backend to see how they interface with git.
STEP 2 – Create a simple CGI script that would interface with the auth mechanism only. This will enable users to authenticate over http.
STEP 3 – Add git support to the above CGI script i.e. when the authentication process is complete the push is executed in the git repository.
I'm also adding a little information about the existing git process (So you guys can correct me if I'm making a mistake :) )
1. drupalorg/drupalorg_git_varnish/drupalorg_git_varnish.module : This is the interface with a Varnish server that holds most of the Authentication Information. It has mainly four callbacks -
1.1 drupalorg-ssh-user-key -- takes a username & an ssh key fingerprint and returns true if valid, else false.
1.2 drupalorg-sshkey-check -- checks whether a fingerprint is known or not
1.3 drupalorg-vcs-auth-check-user-pass -- checks a user & pass combo to see if it is correct.
1.4 vcs-auth-data -- Returns all information about a project i.e who the maintainers are, what branches/tags are protected by releases, etc. A sample output is available at http://groups.drupal.org/node/126529.
2. The twisted ssh daemon : https://github.com/chizu/Drupal.org-Git-Daemons. This is the ssh daemon that handles the push/pull requests, makes the required callback to drupalorg-git-varnish module then handles the JSON output and returns the git packfile accordingly.
-
Testing - Testing the code I have written is a major issue. Initially I would test with the git infrastructure on Drupal.org using dummy accounts. Once I feel the code is of a certain quality and mentor(s) agree, it could be tested on the main Drupal git infrastructure.
-
Schedule –
Upto May 23 – Study ssh daemon and git varnish module. i.e. STEP 1
May 23 – June 23 : STEP 2 + test
June 23 to July 23 : STEP 3 + tests
Rest – Create documentation for end users as well as the Drupal gitsupport team.
-
Motivation and Qualification : I'm really motivated to see this project through since it solves a "real" problem that I have faced a lot and I would pursue it GSoC or not :) . Recently, I created a Versioning file system that used Git as backend so I'm fairly acquainted with Git. Also, I have written a lot of CGI scripts in python and perl in the past (mostly for menial tasks). So, I'm confident that I'll be able to see this project to completion. BTW: Incase there is any doubt, I'm completely jobless this summer :)
Mentor – I talked with sdboyer regarding this and he told me to go for this. He said he might mentor if there is time otherwise someone else from the git team might mentor.