Add note about awful ugliness of the CGI scripts
[girocco.git] / README
blob34d79e19d668b7ee7481108e666d5e0fc7185eda
1 This is the duct tape that ties repo.or.cz together. You will find
2 some hardcoded paths inside, and some other kludgy stuff. The CGI perl scripts
3 are horribly ugly.
5 The user interface is kept in the cgi/ subdirectory (repo.or.cz/m/ is symlink
6 to that).
8 There are two modes of operation for each project: hosting and mirroring.
11 Hosting mode
12 ------------
14 (All uids and gids are allocated from range 65536..infty. All passwords are
15 stored in DES crypt(3) format because Apache is moronic.)
17 (This is vaporware: No such thing exists yet. But workin' on it.)
20 This is how the push access is provided:
22 The whole setup is confined in a chroot with its own instance of sshd running.
23 The chroot looks like:
25         /bin/sh
26         /bin/git-shell
27         /bin/git-upload-pack
28         /bin/git-receive-pack
29         /bin/git-rev-list
30         /bin/git-pack-objects
31         /bin/git-unpack-objects
32         /bin/git-update-server-info
33         /bin/git-repack
34         /sbin/sshd
35         /dev/randomstuff
36         /lib/randomstuff
37         /var/empty
38         /srv/git/...
39         /etc/group
40         /etc/passwd
41         /etc/sshkeys/*
42         /etc/ssh/randomstuff
44 There is a (non-chroot) system user 'repo' and a group of the same name (the
45 webserver is member of the group; TODO: suexec). The files in /etc are owned
46 by repo.repo and group-writable, as well as all files in /srv/git/*/ but
47 refs/**, info/**, and objects/** which are repo.project.
50 When you register a project, it will get a gid allocation and you will set a
51 password for it. The triple is stored in a group(5) file (but containing just
52 the project groups):
54         projname:crypt:gid:list,of,users
56 When you register a user, it will get a uid allocation and you will upload
57 an ssh public key for it. The user is stored in a passwd(5) file (but
58 containing just the repo.or.cz users; 65534 is nogroup):
60         username:x:uid:65534:email:/:/bin/git-shell
62 The authorized keys are stored in /etc/sshkeys/username.
64 When you (un)assign user to a project, you just manipulate the list of users
65 for the project in /etc/group. The web interface for the project administration
66 is protected by the group password; chroot/etc/group is used as the htpasswd
67 file here.
69 Since Apache is not in the project groups, there is a special cronjob run
70 every minute to fix up the permissions for the refs/, info/, and objects/
71 project directories, under the root user.
74 Mirror mode
75 -----------
77 To keep things safe and neat, repo.or.cz is job-controlled: the only thing the
78 cgi script does is scheduling a clone job (by creating a directory with some
79 files at a magic location) and then the clonecheck.sh script is invoked every
80 minute by cron (under more reasonable uid) to check if there are any jobs
81 scheduled, and calls clone.sh to do the clone itself, notifying the user about
82 the results.
84 The script that keeps repositories up-to-date is updatecheck.sh, being run
85 by cron every hour and calling update.sh for all the relevant repositories.
87 updateglibc.sh stands somewhat out of the crowd and keeps the Git mirror of
88 the glibc CVS repository up-to-date, so it's probably not interesting for
89 anyone.
91 To make sure a project is not pushable when in mirror mode, the last colon
92 in the /etc/group entry for the project is doubled.