mirroring: add support for hg+https? mirror source URLs
[girocco.git] / README
blob7eacee07e3a8e9f300cd2406cc32b31de829c6b4
1 Girocco
2 =======
3 Petr Baudis <pasky@ucw.cz>
6 This is the duct tape that ties repo.or.cz together, codenamed Girocco.
7 It is packaged here for easy re-deployment - just follow the INSTALL file
8 for brief deployment instructions; you may hit some obstacle here or there,
9 though, so be prepared.
11 Girocco is an Open Source project covered by the GNU General Public License.
12 See the file COPYING for further details.
15 About Girocco
16 -------------
18 Girocco is a Git hosting solution, designed to allow users easily create and
19 access repositories over the web, either in mirror mode (Girocco maintains a
20 clone of the given repository locally) or in push mode (Girocco maintains
21 a secure chroot with ssh inside for push-only access). A well-known feature
22 is forking support, where users can easily publish modifications of projects
23 they don't own, and mob user support, allowing a sandbox within a project
24 where anonymous pushing is allowed.
26 Typical scenarios are:
28 * Full-blown hosting site with both mirroring and ssh push access
29   (like repo.or.cz)
30 * Internal Git hosting site with no mirroring, but users being able to easily
31   set up projects to push to (corporate deployment with no networked homes)
32 * Internal Git hosting site with no pushing, instead mirroring specified
33   projects from people's home directories for others to easily access and fork
34   (corporate deployment especially suitable for NFS homes and UNIX-savvy
35   users)
37 Girocco itself comprises of a terse documentation, somewhat customized gitweb
38 instance, CGI scripts for user and project management, and several management
39 scripts for the hosting site maintenance.
42 Girocco vs...
43 -------------
45 * Gitorious: Gitorious is very slick hosting solution, but without mirroring
46   support (thus less flexible for both public and corporate deployment) and
47   offering different project model and interface nice for Web 2.0 fans but
48   not for those who prefer the raw beauty and terseness of gitweb.
50 * GitHub: Like Gitorious, but actually not open-source at all.
52 * Gitosis, gitolite: Not really a hosting solution, just a clever way to give
53   multiple users push access over SSH without giving them actual UNIX accounts
54   on the system. It could be used as an alternative to chroot for push access
55   support in Girocco, though that is unfortunately not yet implemented.
58 Requirements and setup
59 ----------------------
61 You will need git pre-installed, or you can build and install one from
62 the git.git subdirectory; normally, Girocco will use only gitweb from there.
63 However, some bits of Girocco (e.g. the chroot setup) will rely on
64 /usr/bin/git regardless of cmd_git settings; for chroot you will also need
65 /bin/nc.openbsd (netcat-openbsd debian package). You will need to add the
66 right users to the right groups (a dedicated Girocco user and the CGI user,
67 at least); root access or root user cooperation will be probably essential
68 unless you have good suexec setup. Girocco is designed to be run only with
69 single instance within one system. If you want git protocol access, you will
70 need to set up git-daemon independently, but it's very easy with inetd.
72 After configuring Girocco (editing Girocco/Config.pm and possibly other
73 files), you should try to run make install and carefully look at any
74 errors. See INSTALL for details. The installation procedure (especially
75 chroot setup) is tuned for Debian systems, elsewhere you might need to
76 adjust few things.
78 You should be running jobd.sh at all times - it will periodically check
79 all the repositories and check if any need garbage collection, but also
80 update them if the mirroring mode is enabled.
82 If you enable mirror support or want to have push notifications, you must
83 also be running taskd.pl - it will listen to clone requests and perform
84 the actual clone operations, and listen to notification messages from
85 repository post-receive hooks and perform notifications.
87 If you enable push support, you will have to run sshd as root from
88 within the chroot setup by make install; no special setup of the sshd
89 is necessary, up to specifying a port to listen at in etc/ssh/sshd_config
90 within the chroot (if the port is not to be 22).
92 Alternately, you can use push support with extremely relaxed security,
93 but using the system-wide password database and not requiring a chroot.
94 Or you could implement Gitosis permission model and send me a patch. ;-)
97 History and naming
98 ------------------
100 Until Jul 2008, we called all the repo.or.cz machinery just 'repo', however
101 that is not very good name, especially since the machinery is now suitable
102 for universal usage even outside of repo.or.cz.  Thankfully, Jan Engelhart
103 invented a nice name 'Girocco', standing for 'GIt Repo.Or.Cz COdebase'.
105 At that time, the machinery was a set of ugly cronjobs completely specific
106 for repo.or.cz. However, Novartis sponsored an internship for Pasky to
107 generalize the framework and adapt it for an internally suitable usage.
108 And another year later, Pasky finally finished the job by porting Girocco
109 back to useable state for repo.or.cz and further cleaning it up.
112 Forks
113 -----
115 An important Girocco concept is a _project fork_ - anyone can fork any
116 project (including a fork of another project), the fork resides in the
117 directory structure as PARENT/FORK.git. Forks are meant as a place for
118 people to freely publish their modifications for the project, even if
119 they don't have push permissions to the parent. To save space and
120 bandwidth, the fork will reuse objects in the parent project, garbage
121 collection is done in a clever way not to prune objects used in forks.
124 Implementation of project database
125 ----------------------------------
127 (All uids and gids are allocated from range 65536..infty. All passwords are
128 stored in DES crypt(3) format because Apache is moronic - in the past
129 the group file was also used as htpasswd file.)
131 When you register a project, it will get a gid allocation and you will set a
132 password for it. The triple is stored in a group(5) file (but containing just
133 the project groups):
135         projname:crypt:gid:list,of,users
137 When you register a user, it will get a uid allocation and you will upload
138 an ssh public key for it. The user is stored in a passwd(5) file (but
139 containing just the repo.or.cz users; 65534 is nogroup):
141         username:x:uid:65534:email:/:/bin/git-shell
143 The authorized keys are stored in /etc/sshkeys/username.
145 When you (un)assign user to a project, you just manipulate the list of users
146 for the project in /etc/group. The web interface for the project administration
147 is protected by the group password.
149 Since Apache is not in the project groups, there is a special cronjob run
150 once in a while to fix up the permissions for the refs/, info/, and objects/
151 project directories, under the root user.
153 If the given project is in push mode, that is indicated by having a .nofetch
154 file in the repository. If the given project is in mirror mode on the other
155 hand, that is indicated by the absence of .nofetch and by having double colon
156 after the gid in the group(5) file - this prevents listed users to actually
157 have write access to the repository.