daemons/repod -> jobd/jobd, daemons/cloned -> taskd/taskd
[girocco/test-forks.git] / README
blob4d8d2f478f97b976ada89eb4b18668c3906d5413
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.
7 About Girocco
8 -------------
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
21   (like repo.or.cz)
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
27   users)
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.
34 Girocco vs...
35 -------------
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
67 adjust few things.
69 You should be running jobd.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 or want to have push notifications, you must
74 also be running taskd.pl - it will listen to clone requests and perform
75 the actual clone operations, and listen to notification messages from
76 repository post-receive hooks and perform notifications.
78 If you enable push support, you will have to run sshd as root from
79 within the chroot setup by make install; no special setup of the sshd
80 is necessary, up to specifying a port to listen at in etc/ssh/sshd_config
81 within the chroot (if the port is not to be 22). You will also have to
82 enable the permission fixup scripts running as root.
84 Alternately, you can use push support with extremely relaxed security,
85 but using the system-wide password database and not requiring a chroot.
86 Or you could implement Gitosis permission model and send me a patch. ;-)
89 History and naming
90 ------------------
92 Until Jul 2008, we called all the repo.or.cz machinery just 'repo', however
93 that is not very good name, especially since the machinery is now suitable
94 for universal usage even outside of repo.or.cz.  Thankfully, Jan Engelhart
95 invented a nice name 'Girocco', standing for 'GIt Repo.Or.Cz COdebase'.
97 At that time, the machinery was a set of ugly cronjobs completely specific
98 for repo.or.cz. However, Novartis sponsored an internship for Pasky to
99 generalize the framework and adapt it for an internally suitable usage.
100 And another year later, Pasky finally finished the job by porting Girocco
101 back to useable state for repo.or.cz and further cleaning it up.
104 Implementation of project database
105 ----------------------------------
107 (All uids and gids are allocated from range 65536..infty. All passwords are
108 stored in DES crypt(3) format because Apache is moronic - in the past
109 the group file was also used as htpasswd file.)
111 When you register a project, it will get a gid allocation and you will set a
112 password for it. The triple is stored in a group(5) file (but containing just
113 the project groups):
115         projname:crypt:gid:list,of,users
117 When you register a user, it will get a uid allocation and you will upload
118 an ssh public key for it. The user is stored in a passwd(5) file (but
119 containing just the repo.or.cz users; 65534 is nogroup):
121         username:x:uid:65534:email:/:/bin/git-shell
123 The authorized keys are stored in /etc/sshkeys/username.
125 When you (un)assign user to a project, you just manipulate the list of users
126 for the project in /etc/group. The web interface for the project administration
127 is protected by the group password.
129 Since Apache is not in the project groups, there is a special cronjob run
130 once in a while to fix up the permissions for the refs/, info/, and objects/
131 project directories, under the root user.
133 If the given project is in push mode, that is indicated by having a .nofetch
134 file in the repository. If the given project is in mirror mode on the other
135 hand, that is indicated by the absence of .nofetch and by having double colon
136 after the gid in the group(5) file - this prevents listed users to actually
137 have write access to the repository.