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. You will need to add the right
57 users to the right groups (a dedicated Girocco user and the CGI user,
58 at least); root access or root user cooperation will be probably essential
59 unless you have good suexec setup. Girocco is designed to be run only with
60 single instance within one system. If you want git protocol access, you will
61 need to set up git-daemon independently, but it's very easy with inetd.
63 After configuring Girocco (editing Girocco/Config.pm and possibly other
64 files), you should try to run make install and carefully look at any
65 errors. See INSTALL for details. The installation procedure (especially
66 chroot setup) is tuned for Debian systems, elsewhere you might need to
69 You should be running repod.sh at all times - it will periodically check
70 all the repositories and check if any need garbage collection, but also
71 update them if the mirroring mode is enabled.
73 If you enable mirror support, you must also be running cloned.pl which
74 will listen to clone requests and perform the actual clone operations.
76 If you enable push support, you will have to run sshd as root from
77 within the chroot setup by make install; no special setup of the sshd
78 is necessary, up to specifying a port to listen at in etc/ssh/sshd_config
79 within the chroot (if the port is not to be 22). You will also have to
80 enable the permission fixup scripts running as root.
82 Alternately, you can use push support with extremely relaxed security,
83 but using the system-wide password database and not requiring a chroot.
84 Or you could implement Gitosis permission model and send me a patch. ;-)
90 Until Jul 2008, we called all the repo.or.cz machinery just 'repo', however
91 that is not very good name, especially since the machinery is now suitable
92 for universal usage even outside of repo.or.cz. Thankfully, Jan Engelhart
93 invented a nice name 'Girocco', standing for 'GIt Repo.Or.Cz COdebase'.
95 At that time, the machinery was a set of ugly cronjobs completely specific
96 for repo.or.cz. However, Novartis sponsored an internship for Pasky to
97 generalize the framework and adapt it for an internally suitable usage.
98 And another year later, Pasky finally finished the job by porting Girocco
99 back to useable state for repo.or.cz and further cleaning it up.
102 Implementation of project database
103 ----------------------------------
105 (All uids and gids are allocated from range 65536..infty. All passwords are
106 stored in DES crypt(3) format because Apache is moronic - in the past
107 the group file was also used as htpasswd file.)
109 When you register a project, it will get a gid allocation and you will set a
110 password for it. The triple is stored in a group(5) file (but containing just
113 projname:crypt:gid:list,of,users
115 When you register a user, it will get a uid allocation and you will upload
116 an ssh public key for it. The user is stored in a passwd(5) file (but
117 containing just the repo.or.cz users; 65534 is nogroup):
119 username:x:uid:65534:email:/:/bin/git-shell
121 The authorized keys are stored in /etc/sshkeys/username.
123 When you (un)assign user to a project, you just manipulate the list of users
124 for the project in /etc/group. The web interface for the project administration
125 is protected by the group password.
127 Since Apache is not in the project groups, there is a special cronjob run
128 once in a while to fix up the permissions for the refs/, info/, and objects/
129 project directories, under the root user.
131 If the given project is in push mode, that is indicated by having a .nofetch
132 file in the repository. If the given project is in mirror mode on the other
133 hand, that is indicated by the absence of .nofetch and by having double colon
134 after the gid in the group(5) file - this prevents listed users to actually
135 have write access to the repository.