2 # (c) Petr Baudis <pasky@suse.cz>
8 use lib
qw(/home/repo/repomgr/cgi);
11 my $repo = Git
::RepoCGI
->new('Project Registration');
14 if ($cgi->param('name')) {
15 # submitted, let's see
16 # FIXME: racy, do a lock
17 my $name = $repo->wparam('name');
19 and (-d
"/srv/git/$name.git" or -d
"/home/repo/repodata/cloning/$name" or -d
"/home/repo/repodata/to-clone/$name")
20 and $repo->err "Project with that name already exists.";
22 my $mirror = $cgi->param('mode') eq 'mirror';
23 my $proj = Git
::RepoCGI
::Project
->ghost($name, $mirror);
24 if ($proj->cgi_fill($repo)) {
27 print "<p>Initiated mirroring. You will be notified by mail about results.</p>\n";
32 Project successfuly set up.
33 You can <a href="p/editproj.pl">assign users</a> now (use project name as username, admin password as password).
34 You need to <a href="reguser.pl">register a user</a> first if you have not done so yet.
35 (One user can have push access to multiple projects and multiple users can have push access to one project.)
37 <p>You may experience permission problems if you try to push right now. If so, that should get fixed automagically in few minutes.</p>
38 <p>Enjoy yourself!</p>
46 <p>Here you can register a project. It can be hosted in two modes: mirror mode and push mode. In the first mode, we will check another repository at a given URL each hour and mirror any new updates. In the second mode, registered users with appropriate permissions will be able to push to the repository. You currently cannot switch freely between those two modes; if you want to switch an existing project, please contact the administrator.</p>
47 <p>You will need the admin password to adjust project settings later (mirroring URL, list of users allowed to push, project description, ...). Use the project name as the username when asked by the browser.</p>
48 <p>By submitting this form, you are confirming that the repository contains only free software and redistributing it does not violate any law of Czech Republic. Have fun!</p>
50 <p>Project name (w/o the .git suffix): <input type="text" name="name" /></p>
51 <p>Admin password: <input type="password" name="pwd" /></p>
52 <p>E-mail contact: <input type="text" name="email" /></p>
53 <p>Description: <input type="text" name="desc" /></p>
54 <p>Homepage URL: <input type="text" name="hp" /></p>
55 <p>Hosting mode:</p><ul>
56 <li><input type="radio" name="mode" value="mirror" />Mirror mode. Repository URL: <input type="text" name="url" /></li>
57 <li><input type="radio" name="mode" value="push" />Push mode.</li></ul>
58 <p><input type="submit" name="y0" value="Register" /></p>