xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit dbe6ddaddfc735c8a6fef126ba90cdb2a98fe631

git clone fixes and other stuff
Author: Catalin(ux) M. BOIE
Author date (UTC): 2012-11-07 19:19
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2012-11-07 19:19
Parent(s): 146d1de07369f1e3270a6cdca1f1bead2d076f30
Signing key:
Tree: b6ec3c669f02c9eca02131a33ace78c5b762524f
File Lines added Lines deleted
TODO 7 3
inc/keys.inc.php 1 0
inc/user/repo-page.php 0 3
inc/user/repo/admin/admin.php 7 0
scripts/remote.php 9 15
File TODO changed (mode: 100644) (index bfa7e54..294792c)
1 1 == BEFORE FIRST RELEASE! == == BEFORE FIRST RELEASE! ==
2 [ ] Check if same user can create two repos with the same name!
2 3 [ ] When we are altering keys table and we upgrade, the file will not be rebuilt. [ ] When we are altering keys table and we upgrade, the file will not be rebuilt.
3 4 We have to dirty it. We have to dirty it.
4 [ ] Do not prevent double ssh keys by database. Use the PHP code.
5 [ ] Fix this shit. isset($_REQUEST['rights']) ? rg_rights_a2s(rg_var_str("rights")) : $rg
6 [ ] when you add a bug, state any shoul not be present.
5 [ ] Fix this shit: isset($_REQUEST['rights']) ? rg_rights_a2s(rg_var_str("rights")) : $rg
6 [ ] when you add a bug, state 'any' should not be present.
7 7 [ ] bug tracker is private? [ ] bug tracker is private?
8 8 [ ] When I visit bug page, I auto add a save search. Bad! (doit == 1) [ ] When I visit bug page, I auto add a save search. Bad! (doit == 1)
9 9 [ ] Is not clear that the owner has full rights (repo->admin->edit). [ ] Is not clear that the owner has full rights (repo->admin->edit).
 
37 37
38 38
39 39 == Medium == == Medium ==
40 [ ] In logs we should log the version!
41 [ ] GeoIP
42 [ ] Specify a timeout for push/fetch.
43 [ ] Describe also the instalation.
40 44 [ ] Allow search from the first page. [ ] Allow search from the first page.
41 45 [ ] Send notifications when a user is given rights to a repo. [ ] Send notifications when a user is given rights to a repo.
42 46 [ ] Detect hexa strings and link them to commits. [ ] Detect hexa strings and link them to commits.
File inc/keys.inc.php changed (mode: 100644) (index 4ceaf37..f0d9e7b)
... ... function rg_keys_update_use($db, $key_id, $ip)
251 251 break; break;
252 252 } }
253 253 rg_sql_free_result($res); rg_sql_free_result($res);
254 $ret = TRUE;
254 255 } while (0); } while (0);
255 256
256 257 rg_prof_end("keys_update_use"); rg_prof_end("keys_update_use");
File inc/user/repo-page.php changed (mode: 100644) (index 14c6068..db81318)
... ... if ($rg_git_port != 0)
86 86 $repo_more['HTML:urls'] = rg_template_table("repo/urls", $urls, $repo_more); $repo_more['HTML:urls'] = rg_template_table("repo/urls", $urls, $repo_more);
87 87
88 88 if (strcmp($subop, "admin") == 0) { if (strcmp($subop, "admin") == 0) {
89 if ($can_admin != 1)
90 rg_security_violation("User is not admin!");
91
92 89 include($INC . "/user/repo/admin/admin.php"); include($INC . "/user/repo/admin/admin.php");
93 90 $_repo_body .= $_admin; $_repo_body .= $_admin;
94 91 } else if (strcmp($subop, "source") == 0) { } else if (strcmp($subop, "source") == 0) {
File inc/user/repo/admin/admin.php changed (mode: 100644) (index 966187a..1ef6589)
... ... rg_log("/inc/user/repo/admin/admin");
4 4 $_admin_body = ""; $_admin_body = "";
5 5 $repo_admin_more = $repo_more; $repo_admin_more = $repo_more;
6 6
7 if (rg_repo_allow($db, $ri, $rg_ui, "A") !== TRUE) {
8 // Probably the user is not logged in
9 $_url = rg_re_url("/op/login");
10 rg_redirect($_url);
11 exit(0);
12 }
13
7 14 // TODO: we must set the url globally, in index.php! // TODO: we must set the url globally, in index.php!
8 15 $_url_admin = rg_re_repopage($rg_ui, $rr['repo']) . "/admin"; $_url_admin = rg_re_repopage($rg_ui, $rr['repo']) . "/admin";
9 16
File scripts/remote.php changed (mode: 100644) (index 33d71ff..cb73cce)
... ... rg_log_set_file($rg_log_dir . "/remote.log");
22 22
23 23 function info($str) function info($str)
24 24 { {
25 global $access_type;
26
27 rg_log("Sending error: " . $str);
25 rg_log("Sending: " . $str);
28 26 $str2 = "RocketGit: " . $str . "\n"; $str2 = "RocketGit: " . $str . "\n";
29 if ($access_type == 2) { // git
30 $str3 = "\n" . $str2;
31 $len = strlen($str3) + 4;
32 $str4 = sprintf("%04x", $len) . $str3;
33 fwrite(STDERR, $str4);
34 } else { // ssh
27 if (isset($_SERVER['SSH_CONNECTION'])) {
28 // ssh
35 29 fwrite(STDERR, $str2); fwrite(STDERR, $str2);
30 } else {
31 // git - seems is not working
32 /*
33 $len = 4 + 1 + strlen($str2);
34 echo sprintf("%04x", $len) . "\2" . $str2;
35 */
36 36 } }
37 37 } }
38 38
 
... ... umask(0022);
47 47 rg_log("Start..."); rg_log("Start...");
48 48 rg_log("_SERVER: " . rg_array2string($_SERVER)); rg_log("_SERVER: " . rg_array2string($_SERVER));
49 49
50 info("Welcome to RocketGit " . $more['rg_version'] . "!");
51
52 50 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
53 51 if ($db === FALSE) if ($db === FALSE)
54 52 fatal("Internal error (db)!"); fatal("Internal error (db)!");
 
... ... if ($r !== TRUE)
59 57
60 58 if (isset($_SERVER['SSH_CONNECTION'])) { if (isset($_SERVER['SSH_CONNECTION'])) {
61 59 rg_log("SSH connection: " . $_SERVER['SSH_CONNECTION']); rg_log("SSH connection: " . $_SERVER['SSH_CONNECTION']);
62 $access_type = 1;
63 60
64 61 // we do not have host info // we do not have host info
65 62 $host = ""; $host = "";
 
... ... if (isset($_SERVER['SSH_CONNECTION'])) {
92 89 rg_internal_error("Cannot update key last_use!"); rg_internal_error("Cannot update key last_use!");
93 90 } else { } else {
94 91 rg_log("git-daemon connection..."); rg_log("git-daemon connection...");
95 $access_type = 2;
96 92
97 93 // we have no client info // we have no client info
98 94 $uid = 0; $uid = 0;
 
... ... rg_log("Running [$run]...");
227 223 passthru($run, $ret); passthru($run, $ret);
228 224 rg_log("[$run] returned $ret."); rg_log("[$run] returned $ret.");
229 225
230 info("Done. Thank you!");
231
232 226 rg_prof_end("remote.php"); rg_prof_end("remote.php");
233 227 rg_prof_log("rg_log"); rg_prof_log("rg_log");
234 228 ?> ?>
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master