1 This is the duct tape that ties repo.or.cz together, codenamed Girocco.
2 It is packaged here for easy re-deployment - just follow the INSTALL file
3 for brief deployment instructions; you may hit some obstacle here or there,
4 though, so be prepared.
10 Girocco is a Git hosting solution, designed to allow users easily create and
11 access repositories over the web, either in mirror mode (Girocco maintains a
12 clone of the given repository locally) or in push mode (Girocco maintains
13 a secure chroot with ssh inside for push-only access). A well-known feature
14 is forking support, where users can easily publish modifications of projects
15 they don't own, and mob user support, allowing a sandbox within a project
16 where anonymous pushing is allowed.
18 Typical scenarios are:
20 * Full-blown hosting site with both mirroring and ssh push access
22 * Internal Git hosting site with no mirroring, but users being able to easily
23 set up projects to push to (corporate deployment with no networked homes)
24 * Internal Git hosting site with no pushing, instead mirroring specified
25 projects from people's home directories for others to easily access and fork
26 (corporate deployment especially suitable for NFS homes and UNIX-savvy
29 Girocco itself comprises of a terse documentation, somewhat customized gitweb
30 instance, CGI scripts for user and project management, and several management
31 scripts for the hosting site maintenance.
37 * Gitorious: Gitorious is very slick hosting solution, but without mirroring
38 support (thus less flexible for both public and corporate deployment) and
39 offering different project model and interface nice for Web 2.0 fans but
40 not for those who prefer the raw beauty and terseness of gitweb.
42 * GitHub: Like Gitorious, but actually not open-source at all.
44 * Gitosis, gitolite: Not really a hosting solution, just a clever way to give
45 multiple users push access over SSH without giving them actual UNIX accounts
46 on the system. It could be used as an alternative to chroot for push access
47 support in Girocco, though that is unfortunately not yet implemented.
50 Requirements and setup
51 ----------------------
53 You will need git pre-installed, or you can build and install one from
54 the git.git subdirectory; normally, Girocco will use only gitweb from there.
55 However, some bits of Girocco (e.g. the chroot setup) will rely on
56 /usr/bin/git regardless of cmd_git settings; for chroot you will also need
57 /bin/nc.openbsd (netcat-openbsd debian package). You will need to add the
58 right users to the right groups (a dedicated Girocco user and the CGI user,
59 at least); root access or root user cooperation will be probably essential
60 unless you have good suexec setup. Girocco is designed to be run only with
61 single instance within one system. If you want git protocol access, you will
62 need to set up git-daemon independently, but it's very easy with inetd.
64 After configuring Girocco (editing Girocco/Config.pm and possibly other
65 files), you should try to run make install and carefully look at any
66 errors. See INSTALL for details. The installation procedure (especially
67 chroot setup) is tuned for Debian systems, elsewhere you might need to
70 You should be running jobd.sh at all times - it will periodically check
71 all the repositories and check if any need garbage collection, but also
72 update them if the mirroring mode is enabled.
74 If you enable mirror support or want to have push notifications, you must
75 also be running taskd.pl - it will listen to clone requests and perform
76 the actual clone operations, and listen to notification messages from
77 repository post-receive hooks and perform notifications.
79 If you enable push support, you will have to run sshd as root from
80 within the chroot setup by make install; no special setup of the sshd
81 is necessary, up to specifying a port to listen at in etc/ssh/sshd_config
82 within the chroot (if the port is not to be 22). You will also have to
83 enable the permission fixup scripts running as root.
85 Alternately, you can use push support with extremely relaxed security,
86 but using the system-wide password database and not requiring a chroot.
87 Or you could implement Gitosis permission model and send me a patch. ;-)
93 Until Jul 2008, we called all the repo.or.cz machinery just 'repo', however
94 that is not very good name, especially since the machinery is now suitable
95 for universal usage even outside of repo.or.cz. Thankfully, Jan Engelhart
96 invented a nice name 'Girocco', standing for 'GIt Repo.Or.Cz COdebase'.
98 At that time, the machinery was a set of ugly cronjobs completely specific
99 for repo.or.cz. However, Novartis sponsored an internship for Pasky to
100 generalize the framework and adapt it for an internally suitable usage.
101 And another year later, Pasky finally finished the job by porting Girocco
102 back to useable state for repo.or.cz and further cleaning it up.
105 Implementation of project database
106 ----------------------------------
108 (All uids and gids are allocated from range 65536..infty. All passwords are
109 stored in DES crypt(3) format because Apache is moronic - in the past
110 the group file was also used as htpasswd file.)
112 When you register a project, it will get a gid allocation and you will set a
113 password for it. The triple is stored in a group(5) file (but containing just
116 projname:crypt:gid:list,of,users
118 When you register a user, it will get a uid allocation and you will upload
119 an ssh public key for it. The user is stored in a passwd(5) file (but
120 containing just the repo.or.cz users; 65534 is nogroup):
122 username:x:uid:65534:email:/:/bin/git-shell
124 The authorized keys are stored in /etc/sshkeys/username.
126 When you (un)assign user to a project, you just manipulate the list of users
127 for the project in /etc/group. The web interface for the project administration
128 is protected by the group password.
130 Since Apache is not in the project groups, there is a special cronjob run
131 once in a while to fix up the permissions for the refs/, info/, and objects/
132 project directories, under the root user.
134 If the given project is in push mode, that is indicated by having a .nofetch
135 file in the repository. If the given project is in mirror mode on the other
136 hand, that is indicated by the absence of .nofetch and by having double colon
137 after the gid in the group(5) file - this prevents listed users to actually
138 have write access to the repository.