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 70b59e41caa4a49a3f6580e104da0c8e6cec8658

Checkpoint
Author: Catalin(ux) M. BOIE
Author date (UTC): 2014-11-20 04:42
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2014-11-20 04:42
Parent(s): 954ee41b76dcfe6920ebd36bd81453bc26276890
Signing key:
Tree: 527b1ef245c78f48bf54e7bce0012f751e455ba4
File Lines added Lines deleted
TODO 46 42
admin/init.php 1 0
hooks/post-receive 2 1
hooks/update 1 0
inc/bug.inc.php 11 8
inc/cache.inc.php 18 5
inc/git.inc.php 12 4
inc/plan.inc.php 1 1
inc/repo.inc.php 29 48
inc/rights.inc.php 3 5
inc/sql.inc.php 15 1
inc/struct.inc.php 1 1
root/index.php 1 0
root/themes/default/mail/user/repo/new.body.txt 1 4
root/themes/default/mail/user/repo/update.body.txt 1 4
root/themes/default/repo/add_edit.html 1 1
root/themes/default/repo/bug/bug_add_edit.html 1 1
samples/config.php 8 1
scripts/cron.php 1 0
scripts/events.php 1 0
scripts/q.php 1 0
scripts/remote.php 1 0
tests/Makefile 1 1
tests/bug.php 2 1
tests/cache.php 2 1
tests/common.php 8 41
tests/config.php 33 0
tests/email.php 2 1
tests/event.php 2 1
tests/git.php 2 1
tests/git2.php 2 1
tests/hook_update.sh 61 10
tests/keys.php 2 1
tests/log.php 2 1
tests/prof.php 2 1
tests/repo.php 30 10
tests/rights.php 3 1
tests/sql.php 2 1
tests/state.php 2 1
tests/user.php 2 1
tests/util.php 2 1
File TODO changed (mode: 100644) (index 88e58b2..4b379bb)
1 1 == Where I stopped last time == == Where I stopped last time ==
2 [ ] Investigate "event_signal_daemon: event_id=[] timeout=ms"
3 NULL=no_wait, 0=forever
4 rg_event_signal_daemon - timeout 0 OK
5 rg_socket - timeout 0 OK
6 socket_recv_wait - timeout 0
7 $rg_cache_timeout is pretty safe (0 or >0, NULL does not make sense)
8
9 change NULL=forever, 0=no_wait
10 rg_event_signal_daemon - timeout 0 OK
11 rg_socket - timeout 0 OK
12 socket_recv_wait - timeout 0
13 $rg_cache_timeout is pretty safe (0 or >0, NULL does not make sense)
14
2 [ ] Not clear why I do not have rights to push a file: it fails on repo_path
3 tests. I did not inject anything there. What should I inject?!
4 We have injection only for owner. Keep in mind is a private repo.
5 [ ] Integrate anonymous push. remove old sh file.
6 [ ] Run unit tests
7 [ ] git url is not ok.
8 [ ]
15 9
16 [ ] cache: on timeout, should we close the connection?
17 Probably not, but we should flush the input after a timeout.
18 [ ] Description passed in e-mail, may have security implications?
19 [ ] Seems that repo description is not updated under repo name. A caching
20 problem?
21 [ ] Replace rg_var_str with rg_var_str_core. It is ok to not have escaped in
22 db, but be careful with "HTML:" construct! Audit all HTML: and then
23 switch. Do not forget that is a problem how it works now:
24 for example, description that contains '<' will not work correctly.
25 The problem is with HTML: vars that include unescaped vars.
26 Is it possible?
27 Seems is working for repo description. Do it everywhere?
28 [ ] In loguri, la username, apar unele cu '?'. O fi de la cache
29 + bug-ul in user.inc?
30 [ ] We should invalidate rights cache when repo goes from public -> private
31 and viceversa.
10 == BEFORE NEXT RELEASE ==
11 [ ] Delete anonymous push must take uid in consideration. Maybe also other ops.
12 [ ] Add unit test also for paths.
13 [ ] cache: we may have data with \x0 embedded. Check.
14 [ ] Do we use users.rights?!
15 [ ] Add some versioning mechanism to restart the cache daemon when the protocol
16 changes.
17 [ ] What happends when a user adds a nonexisting one letter code for rights?
18 I should filter it out.
19 [ ] Log attempts to inject <> inside vars. Maybe in rg_var_str?
32 20 [ ] We should not call cosmetic in rights hl because we anyway load again the [ ] We should not call cosmetic in rights hl because we anyway load again the
33 list.
34 [ ] Add unit test for inject functions.
35 [ ] When changing rights, invalidate/update cache.
36 [ ] Retest repo rename. Better, add an unit test.
37 [ ] We have big races for cache. But, the same with the database.
21 list. Seems I do not do it.
22 [ ] Get rid of 'qstats'.
23 [ ] Do I test somewhere if a commit is bigger than max_commit_size?
38 24 [ ] We must test in HL functions if we have rights, not in rg_user_remove & co. [ ] We must test in HL functions if we have rights, not in rg_user_remove & co.
39 25 [ ] The caller of rg_user_make_admin must check rights for administering repo. [ ] The caller of rg_user_make_admin must check rights for administering repo.
26 [ ] If a project is private and the admin gives "Access repo" to a user,
27 that user sees the repo as public. Unit test.
40 28 [ ] What right is "Access repo"?! I think is for web. Not clear. Check. [ ] What right is "Access repo"?! I think is for web. Not clear. Check.
41 29 Seems is used on repo-page.php to give access or not to the repo. Seems is used on repo-page.php to give access or not to the repo.
42 30 But I should only check if is public. But I should only check if is public.
43 31 No, because the same test is used also for pivate repos. No, because the same test is used also for pivate repos.
44 [ ] If a project is private and the admin gives "Access repo" to a user,
45 that user sees the repo as public. Unit test.
46 [ ] Run hook_update.sh test. It not passes anymore.
47 32 [ ] I have to define what means a 'public' repo: fetch + see bugtracker? [ ] I have to define what means a 'public' repo: fetch + see bugtracker?
48 [ ] In the process to remove 'ri.rights_text' and replace by 'public'.
33 [ ] In loguri, la username, apar unele cu '?'. O fi de la cache
34 + bug-ul in user.inc?
35 [ ] We should invalidate rights cache when repo goes from public -> private
36 and viceversa. This is not so easy. Because the caching is not done by
37 repo_id.
38 And this is another problem. What about user_id and repo_id clashes?!
39 No clashes because we have the type!
40 So, when editing the repo and the repo is doing a switch private-repo
41 we must to rg_cache_unset("rights_by_obj_id::$repo_id::type
42 unde type poate fi "repo", "repo_refs", "repo_path" etc.
49 43 [ ] serialize returns a binary string! Not ok to store it like this in db! [ ] serialize returns a binary string! Not ok to store it like this in db!
50
51 == BEFORE NEXT RELEASE ==
44 unit test with \0?
45 [ ] We have big races for cache. But, the same with the database.
46 [ ] Retest repo rename. Better, add an unit test.
47 [ ] When changing rights, invalidate/update cache.
48 [ ] Replace rg_var_str with rg_var_str_core. It is ok to not have escaped in
49 db, but be careful with "HTML:" construct! Audit all HTML: and then
50 switch. Do not forget that is a problem how it works now:
51 for example, description that contains '<' will not work correctly.
52 The problem is with HTML: vars that include unescaped vars.
53 Is it possible?
54 Seems is working for repo description. Do it everywhere?
55 [ ] Add unit test for inject functions.
56 [ ] Description passed in e-mail, may have security implications?
52 57 [ ] keywords for search. Really needed? [ ] keywords for search. Really needed?
53 58 [ ] check: seems the browser uses 0x0d instead of 0x0a in textareas. unify? [ ] check: seems the browser uses 0x0d instead of 0x0a in textareas. unify?
54 [ ] performance: update session only after the page was sent to the client!
59 [ ] performance: update session only after the page was flushed to the client!
55 60 [ ] ionut: http://blogs.atlassian.com/2014/10/git-summit-2014-video-roundup/?atl_medium=ACE [ ] ionut: http://blogs.atlassian.com/2014/10/git-summit-2014-video-roundup/?atl_medium=ACE
56 61 [ ] Get rid of custom caches in all files! [ ] Get rid of custom caches in all files!
57 62 [ ] Remove rg_menu stuff (replaced with templates). [ ] Remove rg_menu stuff (replaced with templates).
 
411 416 [ ] Third option: anybody can create an account but must be validated by admin. [ ] Third option: anybody can create an account but must be validated by admin.
412 417 [ ] After creating the account, keep the user logged in and allow login [ ] After creating the account, keep the user logged in and allow login
413 418 even if is not confirmed (option in config). even if is not confirmed (option in config).
414 [ ] 'application_name' must be set something like rocketgit-q/web/etc.
415 419 [ ] When I close a bug, seems I add myself to the watch table again! [ ] When I close a bug, seems I add myself to the watch table again!
416 420 [ ] Should we load the lables in rg_bug_info? [ ] Should we load the lables in rg_bug_info?
417 421 [ ] Do we need a rg_bug_cosmetic for notes/users/repos/etc? [ ] Do we need a rg_bug_cosmetic for notes/users/repos/etc?
File admin/init.php changed (mode: 100644) (index 291efde..c82a0ef)
... ... require_once($INC . "/fixes.inc.php");
17 17
18 18 rg_log_set_file("init.log"); rg_log_set_file("init.log");
19 19
20 rg_sql_app("rg-admin-init");
20 21 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
21 22 if ($db === FALSE) { if ($db === FALSE) {
22 23 echo "Internal error (" . rg_sql_error() . ")!\n"; echo "Internal error (" . rg_sql_error() . ")!\n";
File hooks/post-receive changed (mode: 100755) (index e91550b..3e24a46)
... ... while (($set = fgets($f))) {
62 62 } }
63 63 fclose($f); fclose($f);
64 64
65 //TODO: replace with event - do not forget to dirty the repo
65 /* TODO: replace with event - do not forget to dirty the repo
66 66 $a = array( $a = array(
67 67 "op" => "push", "op" => "push",
68 68 "itime" => getenv("ROCKETGIT_ITIME"), "itime" => getenv("ROCKETGIT_ITIME"),
 
... ... $a = array(
75 75 "ip" => getenv("ROCKETGIT_IP") "ip" => getenv("ROCKETGIT_IP")
76 76 ); );
77 77 rg_repo_stats_push2file($a); rg_repo_stats_push2file($a);
78 */
78 79
79 80 rg_prof_end("post-receive"); rg_prof_end("post-receive");
80 81 rg_prof_log("rg_log"); rg_prof_log("rg_log");
File hooks/update changed (mode: 100755) (index de44135..be11b25)
... ... rg_prof_start("hook-update");
32 32
33 33 rg_log_set_file($rg_log_dir . "/hook_update.log"); rg_log_set_file($rg_log_dir . "/hook_update.log");
34 34
35 rg_sql_app("rg-hook-update");
35 36 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
36 37
37 38 $a = array(); $a = array();
File inc/bug.inc.php changed (mode: 100644) (index c00813a..472f151)
... ... function rg_bug_info($db, $repo_id, $bug_id)
339 339 rg_bug_set_error("cannot list bugs (" . rg_sql_error() . ")"); rg_bug_set_error("cannot list bugs (" . rg_sql_error() . ")");
340 340 break; break;
341 341 } }
342 $ret = array();
343 $rows = rg_sql_num_rows($res);
344 if ($rows == 1)
345 $ret = rg_sql_fetch_array($res);
346 rg_sql_free_result($res);
347 342
348 343 $ret['ok'] = 1; $ret['ok'] = 1;
349 $ret['exists'] = $rows;
350 if ($ret['exists'] == 1)
344
345 $rows = rg_sql_num_rows($res);
346 if ($rows == 1) {
347 $row = rg_sql_fetch_array($res);
348 $ret = array_merge($ret, $row);
349 $ret['exists'] = 1;
351 350 rg_bug_cosmetic($db, $ret); rg_bug_cosmetic($db, $ret);
351 }
352 rg_sql_free_result($res);
352 353
353 354 // We set the cache even on non-existent bug // We set the cache even on non-existent bug
354 355 rg_cache_set($key, $ret); rg_cache_set($key, $ret);
 
... ... function rg_bug_edit($db, $login_ui, $ri, $data)
497 498 } }
498 499
499 500 // update cache // update cache
501 $data['ok'] = 1;
502 $data['exists'] = 1;
500 503 $key = $ri['repo_id'] . "::bugs::" . $data['bug_id']; $key = $ri['repo_id'] . "::bugs::" . $data['bug_id'];
501 504 rg_bug_cosmetic($db, $data); rg_bug_cosmetic($db, $data);
502 505 rg_cache_set($key, $data); rg_cache_set($key, $data);
 
... ... function rg_bug_edit_high_level($db, &$rg)
1283 1286
1284 1287 $hints = array(); $hints = array();
1285 1288 $hints[]['HTML:hint'] = rg_template("hints/repo/bug/add.html", $rg); $hints[]['HTML:hint'] = rg_template("hints/repo/bug/add.html", $rg);
1286 $rg['HTML:hints'] = rg_template_table("hints/list", $hints, $rg);
1289 $rg['HTML:bug_edit_hints'] = rg_template_table("hints/list", $hints, $rg);
1287 1290
1288 1291 $ret .= rg_template("repo/bug/bug_add_edit.html", $rg); $ret .= rg_template("repo/bug/bug_add_edit.html", $rg);
1289 1292 } }
File inc/cache.inc.php changed (mode: 100644) (index e3007db..df332b9)
... ... require_once($INC . "/sql.inc.php");
7 7 require_once($INC . "/prof.inc.php"); require_once($INC . "/prof.inc.php");
8 8
9 9 // Client side can disable the cache for various reasons (unit testing etc.) // Client side can disable the cache for various reasons (unit testing etc.)
10 $rg_cache_enable = TRUE;
10 if (!isset($rg_cache_enable))
11 $rg_cache_enable = TRUE;
11 12
12 13 // timeout in miliseconds // timeout in miliseconds
13 14 $rg_cache_timeout = 100; $rg_cache_timeout = 100;
 
... ... function rg_cache_set($ns_var, $value)
358 359
359 360 $c = rg_socket($rg_cache_socket, "SET " . $ns_var . "=" $c = rg_socket($rg_cache_socket, "SET " . $ns_var . "="
360 361 . rg_cache_prepare($value) . "\n", $rg_cache_timeout); . rg_cache_prepare($value) . "\n", $rg_cache_timeout);
361 if ($c === FALSE)
362 if ($c === FALSE) {
363 // Give up for the rest of the session
364 $rg_cache_enable = FALSE;
362 365 break; break;
366 }
363 367
364 368 if (strncmp($c, "OK", 2) != 0) if (strncmp($c, "OK", 2) != 0)
365 369 break; break;
 
... ... function rg_cache_inc($ns_var)
394 398
395 399 $c = rg_socket($rg_cache_socket, $c = rg_socket($rg_cache_socket,
396 400 "INC " . $ns_var . "\n", $rg_cache_timeout); "INC " . $ns_var . "\n", $rg_cache_timeout);
397 if ($c === FALSE)
401 if ($c === FALSE) {
402 // Give up for the rest of the session
403 $rg_cache_enable = FALSE;
398 404 break; break;
405 }
399 406
400 407 if (strncmp($c, "OK", 2) != 0) if (strncmp($c, "OK", 2) != 0)
401 408 break; break;
 
... ... function rg_cache_unset($ns_var)
434 441
435 442 $ret = rg_socket($rg_cache_socket, $ret = rg_socket($rg_cache_socket,
436 443 "UNSET " . $ns_var . "\n", $rg_cache_timeout); "UNSET " . $ns_var . "\n", $rg_cache_timeout);
437 if ($ret === FALSE)
444 if ($ret === FALSE) {
445 // Give up for the rest of the session
446 $rg_cache_enable = FALSE;
438 447 break; break;
448 }
439 449
440 450 // TODO: return old value? // TODO: return old value?
441 451 if (strncmp($ret, "OK", 2) != 0) if (strncmp($ret, "OK", 2) != 0)
 
... ... function rg_cache_merge($ns_var, $list)
471 481
472 482 $c = rg_socket($rg_cache_socket, "MERGE " . $ns_var . "=" $c = rg_socket($rg_cache_socket, "MERGE " . $ns_var . "="
473 483 . rg_cache_prepare($list) . "\n", $rg_cache_timeout); . rg_cache_prepare($list) . "\n", $rg_cache_timeout);
474 if ($c === FALSE)
484 if ($c === FALSE) {
485 // Give up for the rest of the session
486 $rg_cache_enable = FALSE;
475 487 break; break;
488 }
476 489
477 490 if (strncmp($c, "OK", 2) != 0) if (strncmp($c, "OK", 2) != 0)
478 491 break; break;
File inc/git.inc.php changed (mode: 100644) (index d060bf7..338b0f4)
... ... function rg_git_stats($log)
764 764 */ */
765 765 function rg_git_files($old, $new) function rg_git_files($old, $new)
766 766 { {
767 global $rg_git_zero;
768 global $rg_git_empty;
769
767 770 rg_prof_start("git_files"); rg_prof_start("git_files");
768 771 rg_log_enter("rg_git_files old=$old new=$new"); rg_log_enter("rg_git_files old=$old new=$new");
769 772
 
... ... function rg_git_files($old, $new)
772 775
773 776 $ret = FALSE; $ret = FALSE;
774 777 while (1) { while (1) {
778 if (strcmp($old, $rg_git_zero) == 0)
779 $old = $rg_git_empty;
780
775 781 $cmd = "git diff --name-only " . escapeshellarg($old) . " " . escapeshellarg($new); $cmd = "git diff --name-only " . escapeshellarg($old) . " " . escapeshellarg($new);
776 782 $a = rg_exec($cmd); $a = rg_exec($cmd);
777 783 if ($a['ok'] != 1) { if ($a['ok'] != 1) {
778 rg_git_set_error("error on ls-tree (" . $a['errmsg'] . ")");
784 rg_git_set_error("error on git diff (" . $a['errmsg'] . ")");
779 785 break; break;
780 786 } }
781 787
 
... ... function rg_git_update_branch($db, $a)
1040 1046 if ($r === FALSE) if ($r === FALSE)
1041 1047 rg_git_fatal($a['refname'] . "\nInternal error, try again later\n"); rg_git_fatal($a['refname'] . "\nInternal error, try again later\n");
1042 1048 foreach ($r as $file) { foreach ($r as $file) {
1043 if (rg_rights_allow($db, $a['repo_id'], "repo_refs", $a['repo.uid'], $uid, "P", $ip, $file) !== TRUE) {
1049 if (rg_rights_allow($db, $a['repo_id'], "repo_path",
1050 $a['repo.uid'], $uid, "P", $ip, $file) !== TRUE) {
1044 1051 rg_git_fatal($a['refname'] rg_git_fatal($a['refname']
1045 . "\nNo rights to push file [$path]\n");
1052 . "\nNo rights to push file [$file]\n");
1046 1053 } }
1047 1054
1048 if (!rg_rights_allow($db, $a['repo_id'], "repo_refs", $a['repo.uid'], $uid, "W", $ip, $a['refname'])) {
1055 if (!rg_rights_allow($db, $a['repo_id'], "repo_path",
1056 $a['repo.uid'], $uid, "W", $ip, $a['refname'])) {
1049 1057 $w = rg_git_whitespace_ok($a['old_rev'], $a['new_rev']); $w = rg_git_whitespace_ok($a['old_rev'], $a['new_rev']);
1050 1058 if ($w !== TRUE) { if ($w !== TRUE) {
1051 1059 rg_git_fatal($a['refname'] rg_git_fatal($a['refname']
File inc/plan.inc.php changed (mode: 100644) (index 572df97..0a406f5)
... ... function rg_plan_select($db, $plan_id)
233 233 /* /*
234 234 * High-level function for rg_plan_list * High-level function for rg_plan_list
235 235 */ */
236 function rg_plan_list_high_level($db, &$rg)
236 function rg_plan_list_high_level($db, $rg)
237 237 { {
238 238 $ret = ""; $ret = "";
239 239
File inc/repo.inc.php changed (mode: 100644) (index 6b9e1a5..62b1dea)
... ... $rg_repo_refs_rights = array(
13 13 "P" => "Push", "P" => "Push",
14 14 "H" => "Anonymous push", "H" => "Anonymous push",
15 15 "S" => "Create annotated tag", "S" => "Create annotated tag",
16 "n" => "Delete annotated tag", // Seems this cannot be deleted. Remove this from here!
16 "n" => "Delete annotated tag",
17 17 "Y" => "Create un-annotated tag", "Y" => "Create un-annotated tag",
18 18 "U" => "Modify un-annotated tag", "U" => "Modify un-annotated tag",
19 19 "u" => "Delete un-annotated tag", "u" => "Delete un-annotated tag",
 
... ... $rg_repo_path_rights = array(
31 31
32 32 $rg_repo_rights = array( $rg_repo_rights = array(
33 33 "A" => "Access repo", "A" => "Access repo",
34 "E" => "Edit repo", /* also create */
34 "E" => "Create/edit repo",
35 35 "D" => "Delete repo", "D" => "Delete repo",
36 36 "G" => "Grant rights", "G" => "Grant rights",
37 37 "a" => "Access bug tracker", "a" => "Access bug tracker",
 
... ... $rg_repo_rights = array(
44 44 // TODO: default rights should go into conf file? // TODO: default rights should go into conf file?
45 45 // TODO: better move all config to database (modulo db conn info)? // TODO: better move all config to database (modulo db conn info)?
46 46
47 rg_rights_register("repo_refs", $rg_repo_refs_rights, "FMH", "rg_repo_compare_refs", "rg_repo_rights_inject");
48 rg_rights_register("repo_path", $rg_repo_path_rights, "P", "rg_repo_compare_paths", "rg_repo_rights_inject");
49 rg_rights_register("repo", $rg_repo_rights, "AB", FALSE, "rg_repo_rights_inject");
47 rg_rights_register("repo_refs", $rg_repo_refs_rights, "FMH",
48 "rg_repo_compare_refs", "rg_repo_rights_inject");
49 rg_rights_register("repo_path", $rg_repo_path_rights, "P",
50 "rg_repo_compare_paths", "rg_repo_rights_inject");
51 rg_rights_register("repo", $rg_repo_rights, "AB",
52 FALSE, "rg_repo_rights_inject");
50 53
51 54 /* /*
52 55 * Function used to inject rights for a obj_id/type combination * Function used to inject rights for a obj_id/type combination
 
... ... function rg_repo_ok($repo)
528 531 return FALSE; return FALSE;
529 532 } }
530 533
531 if (strlen($repo) < $rg_repo_min_len) {
534 $len = strlen($repo);
535 rg_log("CHECK: strlen($repo)=$len");
536 if ($len < $rg_repo_min_len) {
532 537 rg_repo_set_error("repository name is too short" rg_repo_set_error("repository name is too short"
533 . " (minimum $rg_repo_min_len)");
538 . " (minimum $rg_repo_min_len < $len)");
534 539 return FALSE; return FALSE;
535 540 } }
536 541
537 if (strlen($repo) > $rg_repo_max_len) {
542 if ($len > $rg_repo_max_len) {
538 543 rg_repo_set_error("repository name is too long" rg_repo_set_error("repository name is too long"
539 . " (maximum $rg_repo_max_len)");
544 . " (maximum $rg_repo_max_len > $len)");
540 545 return FALSE; return FALSE;
541 546 } }
542 547
 
... ... function rg_repo_info($db, $repo_id, $uid, $repo_name)
627 632 if (($rows == 0) && ($repo_id == 0)) { if (($rows == 0) && ($repo_id == 0)) {
628 633 // Repo not found, maybe it was renamed // Repo not found, maybe it was renamed
629 634 $_repo_id = rg_repo_lookup_by_old_name($db, $uid, $repo_name); $_repo_id = rg_repo_lookup_by_old_name($db, $uid, $repo_name);
630 if (($_repo_id === FALSE) || ($_repo_id == 0)) {
631 rg_log("\tRepo not found!");
635 if ($_repo_id === FALSE)
632 636 break; break;
633 }
634 637
635 $ret = rg_repo_info($db, $_repo_id, 0, "");
636 break;
638 if ($_repo_id > 0) {
639 $ret = rg_repo_info($db, $_repo_id, 0, "");
640 break;
641 }
637 642 } }
638 643
639 644 $ret['ok'] = 1; $ret['ok'] = 1;
640 645 if ($rows > 0) { if ($rows > 0) {
641 646 rg_repo_cosmetic($ret); rg_repo_cosmetic($ret);
642 647 $ret['exists'] = 1; $ret['exists'] = 1;
648 } else {
649 $ret['exists'] = 0;
643 650 } }
651 rg_log_ml("CHECK: ret=" . print_r($ret, TRUE));
644 652
645 653 rg_cache_set("repo_by_id::$repo_id", $ret); rg_cache_set("repo_by_id::$repo_id", $ret);
646 654
 
... ... function rg_repo_edit($db, $login_ui, &$new)
930 938 } }
931 939
932 940 $new['ok'] = 1; $new['ok'] = 1;
941 $new['exists'] = 1;
933 942 rg_cache_set("repo_by_id::" . $new['repo_id'], $new); rg_cache_set("repo_by_id::" . $new['repo_id'], $new);
934 943 rg_cache_set("repo_by_name::" . $login_ui['uid'] . "::" rg_cache_set("repo_by_name::" . $login_ui['uid'] . "::"
935 944 . $new['name'], $new['repo_id']); . $new['name'], $new['repo_id']);
 
... ... function rg_repo_git_done($db, $repo_id)
1139 1148 return $ret; return $ret;
1140 1149 } }
1141 1150
1142 /*
1143 * Add in queue a statistic file
1144 */
1145 function rg_repo_stats_push2file($a)
1146 {
1147 global $rg_state_dir;
1148
1149 $q = $rg_state_dir . "/qstats";
1150 if (!is_dir($q)) {
1151 $r = @mkdir($q, 0700);
1152 if ($r !== TRUE) {
1153 rg_internal_error("Cannot create dir [$q] ($php_errormsg)!");
1154 return FALSE;
1155 }
1156 }
1157
1158 $buf = serialize($a);
1159 $file = sha1($buf);
1160 $r = file_put_contents($q . "/" . $file, $buf);
1161 if ($r === FALSE) {
1162 rg_internal_error("Cannot store file in qstats ($php_errormsg)!");
1163 return FALSE;
1164 }
1165
1166 return $file;
1167 }
1168
1169 1151 /* /*
1170 1152 * High level function to delete rights ids * High level function to delete rights ids
1171 1153 */ */
1172 function rg_repo_admin_delete_rights($db, &$rg, $obj_id, &$errmsg)
1154 function rg_repo_admin_delete_rights($db, $rg, $obj_id, &$errmsg)
1173 1155 { {
1174 1156 $errmsg = array(); $errmsg = array();
1175 1157
 
... ... function rg_repo_admin_delete_rights($db, &$rg, $obj_id, &$errmsg)
1188 1170 } }
1189 1171
1190 1172 /* /*
1191 * High level function for Repo -> Admin -> Rights -> Repo/Refs rights menu.
1173 * High level function for Repo -> Admin -> Rights -> Repo/Refs/Path rights menu.
1192 1174 */ */
1193 function rg_repo_admin_rights($db, &$rg, $type)
1175 function rg_repo_admin_rights($db, $rg, $type)
1194 1176 { {
1195 1177 rg_log("rg_repo_admin_rights type=$type"); rg_log("rg_repo_admin_rights type=$type");
1196 1178
 
... ... function rg_repo_edit_high_level($db, &$rg)
1417 1399 $rg['ri']['name'] = ""; $rg['ri']['name'] = "";
1418 1400 $rg['ri']['max_commit_size'] = "0"; $rg['ri']['max_commit_size'] = "0";
1419 1401 $rg['ri']['description'] = ""; $rg['ri']['description'] = "";
1420 $rg['ri']['master_repo_id'] = "0";
1421 1402 $rg['ri']['public'] = "1"; $rg['ri']['public'] = "1";
1422 1403 } }
1423 1404 break; break;
 
... ... function rg_repo_edit_high_level($db, &$rg)
1430 1411 } }
1431 1412
1432 1413 $rg['ri']['repo_id'] = rg_var_uint("repo_id"); $rg['ri']['repo_id'] = rg_var_uint("repo_id");
1414 $rg['ri']['master'] = rg_var_uint("master");
1433 1415 $rg['ri']['name'] = rg_var_str("name"); // TODO: filter name! $rg['ri']['name'] = rg_var_str("name"); // TODO: filter name!
1434 1416 $rg['ri']['max_commit_size'] = rg_var_uint("max_commit_size"); $rg['ri']['max_commit_size'] = rg_var_uint("max_commit_size");
1435 1417 $rg['ri']['description'] = rg_var_str_core("description"); $rg['ri']['description'] = rg_var_str_core("description");
1436 1418 $rg['ri']['public'] = rg_var_bool("public"); $rg['ri']['public'] = rg_var_bool("public");
1437 $rg['ri']['master'] = rg_var_uint("master");
1438 1419 rg_repo_cosmetic($rg['ri']); rg_repo_cosmetic($rg['ri']);
1439 rg_log_ml("CHECK: after repo edit: rg[ri]=" . print_r($rg['ri'], TRUE));
1420 //rg_log_ml("CHECK: after repo edit: rg[ri]=" . print_r($rg['ri'], TRUE));
1440 1421
1441 1422 $r = rg_repo_edit($db, $rg['login_ui'], $rg['ri']); $r = rg_repo_edit($db, $rg['login_ui'], $rg['ri']);
1442 1423 if ($r === FALSE) { if ($r === FALSE) {
 
... ... function rg_repo_edit_high_level($db, &$rg)
1470 1451 $rg['rg_form_token'] = rg_token_get($db, $rg['sid']); $rg['rg_form_token'] = rg_token_get($db, $rg['sid']);
1471 1452 $hints = array(); $hints = array();
1472 1453 $hints[]['HTML:hint'] = rg_template("hints/repo/create_repo.html", $rg); $hints[]['HTML:hint'] = rg_template("hints/repo/create_repo.html", $rg);
1473 $rg['HTML:hints'] = rg_template_table("hints/list", $hints, $rg);
1454 $rg['HTML:repo_edit_hints'] = rg_template_table("hints/list", $hints, $rg);
1474 1455 $ret .= rg_template("repo/add_edit.html", $rg); $ret .= rg_template("repo/add_edit.html", $rg);
1475 1456 } }
1476 1457
File inc/rights.inc.php changed (mode: 100644) (index 9f267f3..c478ed8)
... ... function rg_rights_get($db, $obj_id, $type, $owner, $uid, $right_id)
320 320 break; break;
321 321
322 322 $r = array_merge($r, $x); $r = array_merge($r, $x);
323 $from_cache = FALSE;
323
324 // We store the big list
325 rg_cache_set($key, $r);
324 326 } else { } else {
325 327 rg_log("CHECK: rights returned from cache for key $key"); rg_log("CHECK: rights returned from cache for key $key");
326 $from_cache = TRUE;
327 328 } }
328 329
329 330 // now, filter by uid and right_id // now, filter by uid and right_id
 
... ... function rg_rights_get($db, $obj_id, $type, $owner, $uid, $right_id)
336 337 } }
337 338 $ret['ok'] = 1; $ret['ok'] = 1;
338 339
339 // We store the big list
340 if (!$from_cache)
341 rg_cache_set($key, $r);
342 340 break; break;
343 341 } }
344 342
File inc/sql.inc.php changed (mode: 100644) (index 4a80b29..3d481c0)
... ... $rg_sql_conn = array();
9 9
10 10 $rg_sql_error = ""; $rg_sql_error = "";
11 11
12
12 13 /* /*
13 14 * Set error string * Set error string
14 15 */ */
 
... ... function rg_sql_error()
24 25 return $rg_sql_error; return $rg_sql_error;
25 26 } }
26 27
28 /*
29 * Set application name to be able to identify the scripts
30 */
31 $rg_sql_app = "rg-unk";
32 function rg_sql_app($name)
33 {
34 global $rg_sql_app;
35
36 $rg_sql_app = $name;
37 }
38
27 39 /* /*
28 40 * Connect to database * Connect to database
29 41 */ */
 
... ... function rg_sql_open_nodelay($h)
91 103 function rg_sql_open($str) function rg_sql_open($str)
92 104 { {
93 105 global $rg_sql_conn; global $rg_sql_conn;
106 global $rg_sql_app;
94 107
95 108 $free_index = count($rg_sql_conn); $free_index = count($rg_sql_conn);
96 109 $rg_sql_conn[$free_index] = array(); $rg_sql_conn[$free_index] = array();
97 $rg_sql_conn[$free_index]['str'] = $str;
110 $rg_sql_conn[$free_index]['str'] = $str
111 . " application_name=" . $rg_sql_app;
98 112
99 113 //rg_log("Delay connection to [$str], index $free_index."); //rg_log("Delay connection to [$str], index $free_index.");
100 114 return $free_index; return $free_index;
File inc/struct.inc.php changed (mode: 100644) (index e6ebaec..bd9ae25)
... ... function rg_sql_struct_get_current_ver($db)
473 473 { {
474 474 global $rg_sql_schema_ver; global $rg_sql_schema_ver;
475 475
476 rg_log_enter("sql_struct_get_current_ver:");
476 rg_log_enter("sql_struct_get_current_ver");
477 477
478 478 $ret = FALSE; $ret = FALSE;
479 479 while (1) { while (1) {
File root/index.php changed (mode: 100644) (index 6ae4eb2..c9805d6)
... ... rg_log("Start! ver=$rocketgit_version");
69 69
70 70
71 71 // database connection // database connection
72 rg_sql_app("rg-web");
72 73 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
73 74
74 75 $good = 0; $good = 0;
File root/themes/default/mail/user/repo/new.body.txt changed (mode: 100644) (index f2dc483..6277b53)
1 1 Hello! Hello!
2 2
3 Repository '@@ri.name@@' was created.
4
5 Anonymous rights:
6 @@ri.rights_text@@
3 @@if(@@ri.public == 1){{Public}}{{Private}} repository '@@ri.name@@' was created.
7 4
8 5 Description: Description:
9 6 @@ri.description@@ @@ri.description@@
File root/themes/default/mail/user/repo/update.body.txt changed (mode: 100644) (index 678c559..04880b1)
... ... Hello!
4 4 @@if(@@ri.old.description_md5@@ != @@ri.description_md5@@){{ @@if(@@ri.old.description_md5@@ != @@ri.description_md5@@){{
5 5 Description changed to: Description changed to:
6 6 @@ri.description@@}}{{}} @@ri.description@@}}{{}}
7 @@if(@@ri.old.rights@@ != @@ri.rights@@){{
8 New anonymous rights:
9 @@ri.rights_text@@
10 }}{{}}
7 @@if(@@ri.public@@ == 1){{Repo is public.}}{{Repo is private.}}
11 8 Link to repository: @@ri.url@@ Link to repository: @@ri.url@@
12 9
13 10 IP: @@IP@@ IP: @@IP@@
File root/themes/default/repo/add_edit.html changed (mode: 100644) (index ede60ce..4715d89)
39 39 </form> </form>
40 40 </div> </div>
41 41
42 @@hints@@
42 @@repo_edit_hints@@
File root/themes/default/repo/bug/bug_add_edit.html changed (mode: 100644) (index afa6036..952fec6)
39 39 </form> </form>
40 40 </div> </div>
41 41
42 @@hints@@
42 @@bug_edit_hints@@
File samples/config.php changed (mode: 100644) (index 848351f..0e20126)
5 5 $rg_base = "/home/rocketgit"; $rg_base = "/home/rocketgit";
6 6
7 7 // Database // Database
8 $rg_sql = "host=localhost user=rocketgit dbname=rocketgit application_name=rocketgit";
8 $rg_sql = "host=localhost user=rocketgit dbname=rocketgit"
9 . " connect_timeout=10";
9 10 $rg_sql_debug = 1; $rg_sql_debug = 1;
10 11
11 12 // Session // Session
 
... ... $rg_ssh_port = 22;
78 79 // Git port - put 0 to disable (standard is 9418) // Git port - put 0 to disable (standard is 9418)
79 80 $rg_git_port = 9418; $rg_git_port = 9418;
80 81
82 // Time limit scripts
83 set_time_limit(30);
84
85 // Allow events to be registered, even if user press "stop"
86 ignore_user_abort(TRUE);
87
81 88 ?> ?>
File scripts/cron.php changed (mode: 100644) (index 8fc6848..31e5202)
... ... rg_lock_or_exit("cron.lock");
25 25
26 26 rg_log("Start (ver=$rocketgit_version)..."); rg_log("Start (ver=$rocketgit_version)...");
27 27
28 rg_sql_app("rg-cron");
28 29 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
29 30 if ($db === FALSE) { if ($db === FALSE) {
30 31 rg_log("Cannot connect to database (" . rg_sql_error() . ")!"); rg_log("Cannot connect to database (" . rg_sql_error() . ")!");
File scripts/events.php changed (mode: 100644) (index 7cb03ac..c2dbebf)
... ... rg_log_set_sid("000000"); // to spread the logs
35 35
36 36 rg_log("Start (ver=$rocketgit_version)..."); rg_log("Start (ver=$rocketgit_version)...");
37 37
38 rg_sql_app("rg-events");
38 39 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
39 40 if ($db === FALSE) { if ($db === FALSE) {
40 41 rg_internal_error("Cannot connect to database!"); rg_internal_error("Cannot connect to database!");
File scripts/q.php changed (mode: 100644) (index 3f875d7..0844ee8)
... ... rg_lock_or_exit("q.lock");
31 31
32 32 rg_log("Start (ver=$rocketgit_version)..."); rg_log("Start (ver=$rocketgit_version)...");
33 33
34 rg_sql_app("rg-q");
34 35 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
35 36 if ($db === FALSE) { if ($db === FALSE) {
36 37 rg_log("Cannot connect to database!"); rg_log("Cannot connect to database!");
File scripts/remote.php changed (mode: 100644) (index f0bd2cd..2c88f32)
... ... rg_log("_SERVER: " . rg_array2string($_SERVER));
53 53 $label = @file_get_contents("/proc/self/attr/current"); $label = @file_get_contents("/proc/self/attr/current");
54 54 rg_log("SELINUX: " . $label); rg_log("SELINUX: " . $label);
55 55
56 rg_sql_app("rg-remote");
56 57 $db = rg_sql_open($rg_sql); $db = rg_sql_open($rg_sql);
57 58 if ($db === FALSE) if ($db === FALSE)
58 59 fatal("Internal error (db)!"); fatal("Internal error (db)!");
File tests/Makefile changed (mode: 100644) (index 84808fd..779eddb)
... ... hook_update_anon_nm:
54 54
55 55 .PHONY: clean .PHONY: clean
56 56 clean: clean:
57 @rm -f *.log *.strace *.out *.lock err-*
57 @rm -f *.log *.strace *.strace.* *.out *.lock err-*
File tests/bug.php changed (mode: 100644) (index 6139a7f..39e7701)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/bug.inc.php"); require_once($INC . "/bug.inc.php");
8 9 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
File tests/cache.php changed (mode: 100644) (index 98cea4b..59cd47a)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
File tests/common.php changed (mode: 100644) (index a0825f5..017697b)
1 1 <?php <?php
2 $INC = "../inc";
2 $INC = dirname(__FILE__) . "/../inc";
3 3 require_once($INC . "/state.inc.php"); require_once($INC . "/state.inc.php");
4 4 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
5 5 require_once($INC . "/struct.inc.php"); require_once($INC . "/struct.inc.php");
6 6 require_once($INC . "/fixes.inc.php"); require_once($INC . "/fixes.inc.php");
7 7
8 // Defaults
9 $rg_base = dirname(__FILE__);
10 $rg_sql_debug = 1;
11 $rg_session_time = 3600;
12 $rg_keys_file = "afile.txt";
13 $rg_scripts = dirname(dirname(__FILE__));
14 $rg_repo_allow = '/^[\pL\pN\pP_]*$/uUD';
15 $rg_repo_min_len = 1;
16 $rg_repo_max_len = 100;
17 $rg_user_allow = '/^[\pL\pN\pP_]*$/uUD';
18 $rg_user_min_len = 1;
19 $rg_user_max_len = 20;
20 $rg_ssh_paras = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty";
21 $rg_admin_name = "RocketGit Admin (test)";
22 $rg_admin_email = "admin@site.tld";
23 $rg_account_allow_creation = 1;
24 $rg_account_email_confirm = 0;
25 $rg_max_ssh_keys = 10;
26 $rg_log_dir = dirname(__FILE__);
27 $rg_web_log_dir = dirname(__FILE__);
28 $rg_state_dir = dirname(__FILE__);
29 $rg_lock_dir = dirname(__FILE__);
30 $rg_repos = "base";
31 $rg_theme_dir = "themes";
32 $rg_theme = "util";
33 $rg_lang = "en";
34 $rg_cache_enable = FALSE;
35 $rg_event_socket = "";
36
37 if (isset($rg_no_db) && $rg_no_db)
38 return;
39
40 $db = rg_sql_open("dbname=trg");
8 rg_sql_app("rg-tests");
9 $db = rg_sql_open($rg_sql);
41 10 if ($db === FALSE) { if ($db === FALSE) {
42 11 rg_log("Cannot create a database (" . rg_sql_error() . ")!"); rg_log("Cannot create a database (" . rg_sql_error() . ")!");
43 12 exit(1); exit(1);
44 13 } }
45 14
46 // Force schema ver 0 to be able to apply updates
47 $r = rg_state_set($db, "schema_version", "0");
48 if ($r !== TRUE) {
49 echo "Cannot reset schema (" . rg_state_error() . ")!\n";
50 exit(1);
51 }
15 if (isset($rg_no_db) && $rg_no_db)
16 return;
17
18 rg_log("Redo schema...");
52 19
53 $r = rg_sql_struct_update($db, RG_DROP_TABLES|RG_IGNORE_ERRORS);
20 $r = rg_sql_struct_update($db, 0);
54 21 if ($r !== TRUE) { if ($r !== TRUE) {
55 22 rg_log("Cannot create struct (" . rg_sql_error() . ")!"); rg_log("Cannot create struct (" . rg_sql_error() . ")!");
56 23 exit(1); exit(1);
File tests/config.php added (mode: 100644) (index 0000000..6a2ce3a)
1 <?php
2
3 // Defaults
4 $rg_base = dirname(__FILE__);
5 $rg_sql = "dbname=trg connect_timeout=10";
6 $rg_sql_debug = 1;
7 $rg_session_time = 3600;
8 $rg_keys_file = "afile.txt";
9 $rg_scripts = dirname(dirname(__FILE__));
10 $rg_repo_allow = '/^[\pL\pN\pP_]*$/uUD';
11 $rg_repo_min_len = 1;
12 $rg_repo_max_len = 100;
13 $rg_user_allow = '/^[\pL\pN\pP_]*$/uUD';
14 $rg_user_min_len = 1;
15 $rg_user_max_len = 20;
16 $rg_ssh_paras = "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty";
17 $rg_admin_name = "RocketGit Admin (test)";
18 $rg_admin_email = "admin@site.tld";
19 $rg_account_allow_creation = 1;
20 $rg_account_email_confirm = 0;
21 $rg_max_ssh_keys = 10;
22 $rg_log_dir = dirname(__FILE__);
23 $rg_web_log_dir = dirname(__FILE__);
24 $rg_state_dir = dirname(__FILE__);
25 $rg_lock_dir = dirname(__FILE__);
26 $rg_repos = "base";
27 $rg_theme_dir = "themes";
28 $rg_theme = "util";
29 $rg_lang = "en";
30 $rg_cache_enable = FALSE;
31 $rg_event_socket = "";
32
33 ?>
File tests/email.php changed (mode: 100644) (index aabb6ef..f6aba01)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9
File tests/event.php changed (mode: 100644) (index a178f2d..2336628)
... ... ini_set("track_errors", "On");
5 5 // override the default // override the default
6 6 $rg_event_socket = "event.sock"; $rg_event_socket = "event.sock";
7 7
8 $INC = "../inc";
8 $INC = dirname(__FILE__) . "/../inc";
9 require_once(dirname(__FILE__) . "/config.php");
9 10 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
10 11 require_once($INC . "/events.inc.php"); require_once($INC . "/events.inc.php");
11 12 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
File tests/git.php changed (mode: 100644) (index 27767db..f5fe1aa)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/git.inc.php"); require_once($INC . "/git.inc.php");
8 9
File tests/git2.php changed (mode: 100644) (index 59c32e2..6eeb09e)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/git.inc.php"); require_once($INC . "/git.inc.php");
8 9
File tests/hook_update.sh changed (mode: 100755) (index f9d0eaa..fc009b9)
1 1 #!/bin/bash #!/bin/bash
2 2
3 export ROCKETGIT_CONF_FILE="`pwd`/common.php"
3 tests=`pwd`
4
5 export ROCKETGIT_CONF_FILE="`pwd`/config.php"
6 export ROCKETGIT_LOGIN_UID=1234
7 export ROCKETGIT_REPO_ID=5678
8 export ROCKETGIT_IP="127.0.0.1"
9 export ROCKETGIT_REPO_PATH="`pwd`/hook_update_dest.git"
10 export ROCKETGIT_REPO_UID=22
4 11
5 12 rm -rf hook_update_*.git rm -rf hook_update_*.git
6 13 mkdir hook_update_dest.git mkdir hook_update_dest.git
 
... ... mkdir hook_update_dest.git
8 15 cd hook_update_dest.git cd hook_update_dest.git
9 16 git init --bare git init --bare
10 17 ) )
11 cp ../hooks/update hook_update_dest.git/hooks/
18 cp -v ../hooks/update hook_update_dest.git/hooks/
12 19
13 20 git clone hook_update_dest.git hook_update_src.git git clone hook_update_dest.git hook_update_src.git
14 21
15 22 cd hook_update_src.git cd hook_update_src.git
16 23
24 php ${tests}/hook_update_help.php init
25 if [ "${?}" != "0" ]; then
26 echo "Cannot init user and repo!"
27 exit 1
28 fi
29
30 echo
17 31 echo "=== Testing push without rights..." echo "=== Testing push without rights..."
18 32 echo "aaa" > a echo "aaa" > a
19 33 git add a git add a
20 git commit -m "a" a
34 git commit -m "a" a >/dev/null || exit 1
21 35 echo "bbb" >> a echo "bbb" >> a
22 git commit -m "b" a
36 git commit -m "b" a >/dev/null || exit 1
37 #strace -s200 -ff -o ${tests}/hook_update.strace \
23 38 git push origin master git push origin master
24 39 if [ "${?}" != "1" ]; then if [ "${?}" != "1" ]; then
25 40 echo "Should not work!" echo "Should not work!"
 
... ... if [ "${?}" != "1" ]; then
27 42 fi fi
28 43 echo "=== Testing push with rights..." echo "=== Testing push with rights..."
29 44 export ROCKETGIT_REPO_RIGHTS="CP" export ROCKETGIT_REPO_RIGHTS="CP"
30 #strace -o cata.strace -ff -s200 \
45 php ${tests}/hook_update_help.php refs
46 #strace -s200 -ff -o ${tests}/hook_update.strace \
31 47 git push origin master git push origin master
32 48 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
33 49 echo "Should work!" echo "Should work!"
34 50 exit 1 exit 1
35 51 fi fi
36 52
53 echo
37 54 echo "=== Testing not fast-forward without rights..." echo "=== Testing not fast-forward without rights..."
38 55 git reset --hard HEAD~1 git reset --hard HEAD~1
39 56 echo "bbb" > a echo "bbb" > a
 
... ... if [ "${?}" != "1" ]; then
45 62 fi fi
46 63 echo "=== Testing not fast-forward with rights..." echo "=== Testing not fast-forward with rights..."
47 64 export ROCKETGIT_REPO_RIGHTS="COP" export ROCKETGIT_REPO_RIGHTS="COP"
65 php ${tests}/hook_update_help.php refs
48 66 git push --force origin master git push --force origin master
49 67 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
50 68 echo "Should work!" echo "Should work!"
51 69 exit 1 exit 1
52 70 fi fi
53 71
72 echo
54 73 echo "=== Testing un-annotated tag creation without rights..." echo "=== Testing un-annotated tag creation without rights..."
55 74 git tag tag1 git tag tag1
56 75 git push --tags origin git push --tags origin
 
... ... if [ "${?}" != "1" ]; then
60 79 fi fi
61 80 echo "=== Testing un-annotated tag creation with rights..." echo "=== Testing un-annotated tag creation with rights..."
62 81 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}Y" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}Y"
82 php ${tests}/hook_update_help.php refs
63 83 git push --tags origin git push --tags origin
64 84 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
65 85 echo "Should work!" echo "Should work!"
66 86 exit 1 exit 1
67 87 fi fi
68 88
89 echo
69 90 echo "=== Testing un-annotated tag modify without rights..." echo "=== Testing un-annotated tag modify without rights..."
70 91 git tag -d tag1 git tag -d tag1
71 92 git tag tag1 HEAD~1 git tag tag1 HEAD~1
 
... ... if [ "${?}" != "1" ]; then
76 97 fi fi
77 98 echo "=== Testing un-annotated tag modify with rights..." echo "=== Testing un-annotated tag modify with rights..."
78 99 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}U" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}U"
100 php ${tests}/hook_update_help.php refs
79 101 git push --force --tags origin git push --force --tags origin
80 102 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
81 103 echo "Should work!" echo "Should work!"
82 104 exit 1 exit 1
83 105 fi fi
84 106
107 echo
85 108 echo "=== Testing un-annotated tag deletion without rights..." echo "=== Testing un-annotated tag deletion without rights..."
86 109 git tag -d tag1 git tag -d tag1
87 110 git push origin :refs/tags/tag1 git push origin :refs/tags/tag1
 
... ... if [ "${?}" != "1" ]; then
91 114 fi fi
92 115 echo "=== Testing un-annotated tag deletion with rights..." echo "=== Testing un-annotated tag deletion with rights..."
93 116 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}u" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}u"
117 php ${tests}/hook_update_help.php refs
94 118 git push origin :refs/tags/tag1 git push origin :refs/tags/tag1
95 119 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
96 120 echo "Should work!" echo "Should work!"
97 121 exit 1 exit 1
98 122 fi fi
99 123
124 echo
100 125 echo "=== Testing merge-commit without rights (${ROCKETGIT_REPO_RIGHTS})..." echo "=== Testing merge-commit without rights (${ROCKETGIT_REPO_RIGHTS})..."
101 126 git checkout -b branch1 git checkout -b branch1
102 127 echo "ccc" >> a echo "ccc" >> a
 
... ... git checkout master
105 130 echo "a" > b; git add b echo "a" > b; git add b
106 131 git commit -m "c" b git commit -m "c" b
107 132 git merge -m "x" branch1 git merge -m "x" branch1
108 git push
133 git push origin master
109 134 if [ "${?}" != "1" ]; then if [ "${?}" != "1" ]; then
110 135 echo "Should not work!" echo "Should not work!"
111 136 exit 1 exit 1
112 137 fi fi
113 138 echo "=== Testing merge-commit with rights..." echo "=== Testing merge-commit with rights..."
114 139 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}M" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}M"
115 git push
140 php ${tests}/hook_update_help.php refs
141 git push origin master
116 142 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
117 143 echo "Should work!" echo "Should work!"
118 144 exit 1 exit 1
119 145 fi fi
120 146
147 echo
121 148 echo "=== Testing bad-whitespace without rights..." echo "=== Testing bad-whitespace without rights..."
122 149 echo -e " \t \ta \t\n \r\n" > b echo -e " \t \ta \t\n \r\n" > b
123 150 git commit -m "d" b git commit -m "d" b
124 git push
151 git push origin master
125 152 if [ "${?}" != "1" ]; then if [ "${?}" != "1" ]; then
126 153 echo "Should not work!" echo "Should not work!"
127 154 exit 1 exit 1
128 155 fi fi
129 156 echo "=== Testing bad-whitespace with rights..." echo "=== Testing bad-whitespace with rights..."
130 157 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}W" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}W"
131 git push
158 php ${tests}/hook_update_help.php refs
159 git push origin master
132 160 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
133 161 echo "Should work!" echo "Should work!"
134 162 exit 1 exit 1
135 163 fi fi
136 164
165 echo
137 166 echo "=== Testing branch delete without rights..." echo "=== Testing branch delete without rights..."
138 167 git push origin branch1 git push origin branch1
139 168 git push origin :branch1 git push origin :branch1
 
... ... if [ "${?}" != "1" ]; then
143 172 fi fi
144 173 echo "=== Testing branch delete with rights..." echo "=== Testing branch delete with rights..."
145 174 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}D" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}D"
175 php ${tests}/hook_update_help.php refs
146 176 git push origin :branch1 git push origin :branch1
147 177 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
148 178 echo "Should work!" echo "Should work!"
149 179 exit 1 exit 1
150 180 fi fi
151 181
182 echo
152 183 echo "=== Testing annotated tag create without rights..." echo "=== Testing annotated tag create without rights..."
153 184 git tag -a tag2 -m "xxx" git tag -a tag2 -m "xxx"
154 185 git push origin --tags git push origin --tags
 
... ... if [ "${?}" != "1" ]; then
158 189 fi fi
159 190 echo "=== Testing annotated tag create with rights..." echo "=== Testing annotated tag create with rights..."
160 191 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}S" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}S"
192 php ${tests}/hook_update_help.php refs
161 193 git push origin --tags git push origin --tags
162 194 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
163 195 echo "Should work!" echo "Should work!"
164 196 exit 1 exit 1
165 197 fi fi
166 198
199 echo
167 200 echo "=== Testing annotated tag delete without rights (${ROCKETGIT_REPO_RIGHTS})..." echo "=== Testing annotated tag delete without rights (${ROCKETGIT_REPO_RIGHTS})..."
168 201 git tag -d tag2 git tag -d tag2
169 202 git push origin :refs/tags/tag2 git push origin :refs/tags/tag2
 
... ... if [ "${?}" != "1" ]; then
173 206 fi fi
174 207 echo "=== Testing annotated tag delete with rights..." echo "=== Testing annotated tag delete with rights..."
175 208 export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}n" export ROCKETGIT_REPO_RIGHTS="${ROCKETGIT_REPO_RIGHTS}n"
209 php ${tests}/hook_update_help.php refs
176 210 git push origin :refs/tags/tag2 git push origin :refs/tags/tag2
177 211 if [ "${?}" != "0" ]; then if [ "${?}" != "0" ]; then
178 212 echo "Should work!" echo "Should work!"
179 213 exit 1 exit 1
180 214 fi fi
181 215
216 echo
217 echo "=== Preparing for anonymous push..."
218 export GIT_NAMESPACE="hook_update_ns1"
219 git commit --amend -m "new"
220 echo "=== Testing anonymous push without rights..."
221 git push origin master
222 if [ "${?}" != "1" ]; then
223 echo "Should not work!"
224 exit 1
225 fi
226 echo "=== Testing anonymous push with rights..."
227 export ROCKETGIT_REPO_RIGHTS="HW"
228 php ${tests}/hook_update_help.php refs
229 git push origin master
230 if [ "${?}" != "0" ]; then
231 echo "Should work!"
232 exit 1
233 fi
182 234
183 235 cd .. cd ..
184 echo "Rights=${ROCKETGIT_REPO_RIGHTS}."
185 236
186 237 rm -rf hook_update_*.git rm -rf hook_update_*.git
187 238
File tests/keys.php changed (mode: 100644) (index d5e4efd..9dc8b13)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9 require_once($INC . "/keys.inc.php"); require_once($INC . "/keys.inc.php");
File tests/log.php changed (mode: 100644) (index a94138c..0d0ed41)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
File tests/prof.php changed (mode: 100644) (index dc658a6..554d000)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
File tests/repo.php changed (mode: 100644) (index 4f3a648..44b983b)
... ... ini_set("track_errors", "On");
4 4
5 5 $rg_cache_socket = "rg_cache_socket"; $rg_cache_socket = "rg_cache_socket";
6 6
7 $INC = "../inc";
7 $INC = dirname(__FILE__) . "/../inc";
8 require_once(dirname(__FILE__) . "/config.php");
8 9 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
9 10 require_once($INC . "/repo.inc.php"); require_once($INC . "/repo.inc.php");
10 11 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
 
... ... if ($c !== FALSE) {
82 83 } }
83 84
84 85 $uid = time(); $uid = time();
85 rg_log("Inserting a fake user");
86 rg_log("Inserting a fake user uid=$uid");
86 87 $sql = "INSERT INTO users (uid, username, realname, salt, pass, email, itime, suspended" $sql = "INSERT INTO users (uid, username, realname, salt, pass, email, itime, suspended"
87 88 . ", rights)" . ", rights)"
88 89 . " VALUES ($uid, 'user-$uid', 'realname-$uid', '', '', '', $uid, 0" . " VALUES ($uid, 'user-$uid', 'realname-$uid', '', '', '', $uid, 0"
89 90 . ", '')"; . ", '')";
90 91 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
91 92 if ($res === FALSE) { if ($res === FALSE) {
92 rg_log("Cannot insert a user (" . rg_sql_error() . ")!");
93 rg_log("Cannot insert a user uid $uid (" . rg_sql_error() . ")!");
93 94 exit(1); exit(1);
94 95 } }
95 96 $rg_ui = rg_user_info($db, $uid, "", ""); $rg_ui = rg_user_info($db, $uid, "", "");
 
... ... if ($rg_ui['exists'] != 1) {
98 99 exit(1); exit(1);
99 100 } }
100 101
102 // create fake user 12
103 $_uid = 12;
104 rg_log("Inserting a fake user uid=$_uid");
105 $sql = "INSERT INTO users (uid, username, realname, salt, pass, email, itime, suspended"
106 . ", rights)"
107 . " VALUES ($_uid, 'user-$_uid', 'realname-$_uid', '', '', '', $_uid, 0"
108 . ", '')";
109 $res = rg_sql_query($db, $sql);
110 if ($res === FALSE) {
111 rg_log("Cannot insert user uid $_uid (" . rg_sql_error() . ")!");
112 exit(1);
113 }
114
101 115 rg_log("Creating a repo"); rg_log("Creating a repo");
102 116 $new = array(); $new = array();
103 117 $new['repo_id'] = 0; $new['repo_id'] = 0;
 
... ... $repo_id = $new['repo_id'];
116 130
117 131 $ri = rg_repo_info($db, $repo_id, 0, ""); $ri = rg_repo_info($db, $repo_id, 0, "");
118 132 if ($ri['exists'] != 1) { if ($ri['exists'] != 1) {
119 rg_log("ri: " . print_r($ri, TRUE));
133 rg_log_ml("ri: " . print_r($ri, TRUE));
120 134 rg_log("Cannot lookup repo_id $repo_id!"); rg_log("Cannot lookup repo_id $repo_id!");
121 135 exit(1); exit(1);
122 136 } }
 
... ... $a['rights'] = "P";
148 162 $a['prio'] = 13; $a['prio'] = 13;
149 163 $a['ip'] = "1.1.1.1"; $a['ip'] = "1.1.1.1";
150 164 $a['misc'] = ""; $a['misc'] = "";
165 $a['description'] = "desc <>";
151 166 $v = rg_rights_set($db, "repo", $a); $v = rg_rights_set($db, "repo", $a);
152 167 if ($v === FALSE) { if ($v === FALSE) {
153 168 rg_log("Cannot give rights (1)!"); rg_log("Cannot give rights (1)!");
154 169 exit(1); exit(1);
155 170 } }
156 171
157 rg_log("non-owner gets correct rights: F gets from default rights.");
172 rg_log("non-owner gets correct rights: A gets from injected rights.");
158 173 $a = array(); $a = array();
159 174 $a['right_id'] = 0; $a['right_id'] = 0;
160 175 $a['obj_id'] = $ri['repo_id']; $a['obj_id'] = $ri['repo_id'];
161 176 $a['who'] = 400; $a['who'] = 400;
162 177 $a['uid'] = 12; $a['uid'] = 12;
163 $a['rights'] = "AaB";
178 $a['rights'] = "aB"; // Access bug tracker + Add bugs
164 179 $a['prio'] = 50; $a['prio'] = 50;
165 180 $a['ip'] = ""; $a['ip'] = "";
166 181 $a['misc'] = ""; $a['misc'] = "";
182 $a['description'] = "rights for uid 12";
167 183 $r = rg_rights_set($db, "repo", $a); $r = rg_rights_set($db, "repo", $a);
168 184 if ($r !== TRUE) { if ($r !== TRUE) {
169 185 rg_log("Cannot set rights (" . rg_rights_error() . ")!"); rg_log("Cannot set rights (" . rg_rights_error() . ")!");
170 186 exit(1); exit(1);
171 187 } }
172 $e = "F";
188 $e = "A"; // will not match the above right but the one injected
173 189 $r = rg_rights_get($db, $ri['repo_id'], "repo", $uid, $a['uid'], 0); $r = rg_rights_get($db, $ri['repo_id'], "repo", $uid, $a['uid'], 0);
174 $c = isset($r['list'][0]['rights']) ? $r['list'][0]['rights'] : "BAD";
190 $c = isset($r['list'][0]['rights']) ? $r['list'][0]['rights'] : "_BAD_";
175 191 if (strcmp($c, $e) != 0) { if (strcmp($c, $e) != 0) {
176 192 rg_log("Non-owner did not get correct rights: c=$c e=$e."); rg_log("Non-owner did not get correct rights: c=$c e=$e.");
177 193 rg_log_ml("r=" . print_r($r, TRUE)); rg_log_ml("r=" . print_r($r, TRUE));
 
... ... $a['rights'] = "E";
188 204 $a['prio'] = 100; $a['prio'] = 100;
189 205 $a['ip'] = ""; $a['ip'] = "";
190 206 $a['misc'] = ""; $a['misc'] = "";
207 $a['description'] = "rights for uid 500";
191 208 $v = rg_rights_set($db, "repo", $a); $v = rg_rights_set($db, "repo", $a);
192 209 if ($v === FALSE) { if ($v === FALSE) {
193 210 rg_log("Owner cannot set separate rights for him!"); rg_log("Owner cannot set separate rights for him!");
 
... ... if ($r === FALSE) {
200 217 rg_log("Cannot list rights (" . rg_repo_error() . ")"); rg_log("Cannot list rights (" . rg_repo_error() . ")");
201 218 exit(1); exit(1);
202 219 } }
203 print_r($r);
220 if (count($r) != 2) {
221 rg_log_ml("r=" . print_r($r, TRUE));
222 rg_log("Cannot load all rights!");
223 exit(1);
224 }
204 225 // TODO: we should test if expected fields are returned! // TODO: we should test if expected fields are returned!
205 226
206
207 227 rg_log("Testing the rename of the repos"); rg_log("Testing the rename of the repos");
208 228 $repo_name = "renameA"; $repo_name = "renameA";
209 229 $rg_repos = "repos"; $rg_repos = "repos";
File tests/rights.php changed (mode: 100644) (index a4ddacd..2ebf8cd)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/rights.inc.php"); require_once($INC . "/rights.inc.php");
8 9
 
... ... $a['rights'] = "abc";
69 70 $a['misc'] = "misc1"; $a['misc'] = "misc1";
70 71 $a['ip'] = "1.1.1.1 2.2.2.2 10.0.0.0/8"; $a['ip'] = "1.1.1.1 2.2.2.2 10.0.0.0/8";
71 72 $a['prio'] = 13; $a['prio'] = 13;
73 $a['description'] = "desc1";
72 74 $r = rg_rights_set($db, "type1", $a); $r = rg_rights_set($db, "type1", $a);
73 75 if ($r !== TRUE) { if ($r !== TRUE) {
74 76 echo "Seems I cannot set rights 1 (" . rg_rights_error() . ")\n"; echo "Seems I cannot set rights 1 (" . rg_rights_error() . ")\n";
File tests/sql.php changed (mode: 100644) (index 842ef80..9f4169c)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
8 9 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
File tests/state.php changed (mode: 100644) (index f0498a7..7a5ff0f)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
8 9 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
File tests/user.php changed (mode: 100644) (index 58e9c3a..5ce58ca)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/user.inc.php"); require_once($INC . "/user.inc.php");
8 9 require_once($INC . "/sql.inc.php"); require_once($INC . "/sql.inc.php");
File tests/util.php changed (mode: 100644) (index b402137..2f4db61)
2 2 error_reporting(E_ALL | E_STRICT); error_reporting(E_ALL | E_STRICT);
3 3 ini_set("track_errors", "On"); ini_set("track_errors", "On");
4 4
5 $INC = "../inc";
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
6 7 require_once($INC . "/init.inc.php"); require_once($INC . "/init.inc.php");
7 8 require_once($INC . "/util.inc.php"); require_once($INC . "/util.inc.php");
8 9 require_once($INC . "/log.inc.php"); require_once($INC . "/log.inc.php");
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