File README changed (mode: 100644) (index 3bc6337..90bf862) |
23 |
23 |
# systemctl enable httpd.service |
# systemctl enable httpd.service |
24 |
24 |
# systemctl start httpd.service |
# systemctl start httpd.service |
25 |
25 |
|
|
|
26 |
|
. Activate sshd (for ssh:// access) |
|
27 |
|
# systemctl enable sshd.service |
|
28 |
|
# systemctl start sshd.service |
|
29 |
|
|
26 |
30 |
. Activate xinetd (for git:// access) |
. Activate xinetd (for git:// access) |
27 |
31 |
# systemctl enable xinetd.service |
# systemctl enable xinetd.service |
28 |
32 |
# systemctl start xinetd.service |
# systemctl start xinetd.service |
29 |
33 |
|
|
30 |
34 |
. Configure PostgreSQL server |
. Configure PostgreSQL server |
31 |
35 |
# systemctl enable postgresql.service |
# systemctl enable postgresql.service |
32 |
|
# service postgresql initdb (TAKE CARE! YOU MAY DESTROY ALL YOUR DATA!) |
|
|
36 |
|
# postgresql-setup initdb (TAKE CARE! YOU MAY DESTROY ALL YOUR DATA!) |
33 |
37 |
# systemctl start postgresql.service |
# systemctl start postgresql.service |
34 |
38 |
|
|
35 |
39 |
. Create a PostgreSQL user and database |
. Create a PostgreSQL user and database |
|
49 |
53 |
- If the web server and the db are not on the same host, you need to |
- If the web server and the db are not on the same host, you need to |
50 |
54 |
replace 127.0.0.1/::1 with your "safe network". You may want to use |
replace 127.0.0.1/::1 with your "safe network". You may want to use |
51 |
55 |
md5 for authentication. Also, you may want to change 'listen_addresses' |
md5 for authentication. Also, you may want to change 'listen_addresses' |
52 |
|
to '*'. |
|
|
56 |
|
to '*'. You may also want to activate SSL. Check PostgreSQL manual. |
53 |
57 |
|
|
54 |
58 |
. Run instalation script |
. Run instalation script |
55 |
59 |
# php /usr/share/rocketgit/admin/init.php |
# php /usr/share/rocketgit/admin/init.php |
File TODO changed (mode: 100644) (index 53e593e..fad2d2b) |
1 |
1 |
== BEFORE FIRST RELEASE! == |
== BEFORE FIRST RELEASE! == |
|
2 |
|
[ ] Add some hints. |
|
3 |
|
[ ] Hints for ssh are not indented! |
|
4 |
|
[ ] Allow user to specify if is on windows/linux/etc. to be able to give |
|
5 |
|
tailored hints. |
|
6 |
|
[ ] |
|
7 |
|
|
|
8 |
|
|
|
9 |
|
== Medium == |
|
10 |
|
[ ] http://rg.embedromix.ro:8000/user/catab/a13/admin/rights?edit_uid=19 |
|
11 |
|
should give an error! |
|
12 |
|
[ ] Pay attention to: https://github.com/sitaramc/gitolite/wiki: |
|
13 |
|
Please DO NOT send me pull requests via github. Instead, send me an |
|
14 |
|
email saying what URL and what branch to pull. (The pull system forces |
|
15 |
|
a --no-ff even if the merge is at the top of my branch and doesn't |
|
16 |
|
need one. It also gives me no chance to fix up minor typos, add any |
|
17 |
|
more text to the commit message, etc. I can do that afterward, but |
|
18 |
|
this forces a "push -f" or a trivial "typofix" commit). |
|
19 |
|
[ ] We should have a 'domain' variable for virtual hosting and use them in |
|
20 |
|
paths for locks/queues/repos etc. |
|
21 |
|
[ ] Merge requests should use a shorter path? What if a merge request is for |
|
22 |
|
other branch? |
2 |
23 |
[ ] See diff for merge requests. |
[ ] See diff for merge requests. |
|
24 |
|
[ ] On master, list clones. |
|
25 |
|
[ ] Configuration: switch for SSL only. |
|
26 |
|
[ ] Internal mailing list? Or internal mail? |
|
27 |
|
[ ] We should have a cron/q/remote for every config file! |
|
28 |
|
Or, at least, to be host aware. |
|
29 |
|
[ ] It may be needed to use preg_quote! |
|
30 |
|
[ ] Install text files in /usr/share/doc |
3 |
31 |
[ ] JUNK1/JUNK2: http://rg.embedromix.ro:8000/user/catab/rocketgit/commit/afd1df2..f919c9b |
[ ] JUNK1/JUNK2: http://rg.embedromix.ro:8000/user/catab/rocketgit/commit/afd1df2..f919c9b |
4 |
|
[ ] Confirmation e-mail comes from rg1. |
|
5 |
32 |
[ ] rg_log: why the fd is NULL?! |
[ ] rg_log: why the fd is NULL?! |
6 |
|
[ ] Install text files in /usr/share/doc |
|
7 |
|
[ ] "log" does not list last entries! More exactly, seems the owner does not update repo! |
|
8 |
|
[ ] @@branch@@ is not defined for merge requests. Should it? Probably yes, to filter them. |
|
9 |
|
[ ] Create a repo and click on it; seems we get error (gabi)! |
|
10 |
|
[ ] Add permission to add bug tracker to a project. |
|
11 |
|
[ ] Remove all @@ DUMP @@s from templates. |
|
12 |
33 |
[ ] We are escaping when we insert in database _and_ when we output on screen! |
[ ] We are escaping when we insert in database _and_ when we output on screen! |
13 |
34 |
What should we do? |
What should we do? |
14 |
|
[ ] |
|
15 |
|
|
|
16 |
|
|
|
17 |
|
== Medium == |
|
|
35 |
|
[ ] Add permission to add bug tracker to a project. |
|
36 |
|
[ ] When repo is empty, weshould not show the Log/Tree menu. |
|
37 |
|
[ ] @@branch@@ is not defined for merge requests. Should it? Probably yes, to filter them. |
|
38 |
|
[ ] Fix diff output. Cannot deal with renames/removes/etc. |
18 |
39 |
[ ] Check admin creatin of an account. |
[ ] Check admin creatin of an account. |
19 |
40 |
[ ] Add possibility to reject merge requests, to apply, to delete etc. |
[ ] Add possibility to reject merge requests, to apply, to delete etc. |
20 |
41 |
[ ] Do we need to escape some chars in console (ssh rocketgit@host repo X)? |
[ ] Do we need to escape some chars in console (ssh rocketgit@host repo X)? |
|
34 |
55 |
[ ] Check webSSO for authentification. |
[ ] Check webSSO for authentification. |
35 |
56 |
[ ] Check http://gitlist.org/ |
[ ] Check http://gitlist.org/ |
36 |
57 |
[ ] use do {} while(0) to respect profiling! |
[ ] use do {} while(0) to respect profiling! |
37 |
|
[ ] If we do ssh without any command, be nice and show how to clone, |
|
38 |
|
show projects, rights etc. Check ssh.inc.php. |
|
39 |
58 |
[ ] Enforce Signoff-by lines per project (a new permission) |
[ ] Enforce Signoff-by lines per project (a new permission) |
40 |
59 |
= reject commits without signoff! |
= reject commits without signoff! |
41 |
60 |
Maybe, do it generic, allow a text field to enumerate what should be in a commit! |
Maybe, do it generic, allow a text field to enumerate what should be in a commit! |
42 |
61 |
Also, present a list with checkboxex: at least Signoff-by, Reported-by, Acked-by! |
Also, present a list with checkboxex: at least Signoff-by, Reported-by, Acked-by! |
43 |
62 |
[ ] Linus on why GitHub sucks: https://github.com/torvalds/linux/pull/17#issuecomment-5654674 |
[ ] Linus on why GitHub sucks: https://github.com/torvalds/linux/pull/17#issuecomment-5654674 |
44 |
63 |
[ ] Warn if commit messages are too long (no wrap). |
[ ] Warn if commit messages are too long (no wrap). |
45 |
|
[ ] Allow possibility to send an e-mail to mainteiner from web with a pull request |
|
|
64 |
|
[ ] Allow the possibility to send an e-mail to mainteiner from web with a pull request |
46 |
65 |
[ ] Check https://github.com/torvalds/linux/pull/17#issuecomment-5654674 |
[ ] Check https://github.com/torvalds/linux/pull/17#issuecomment-5654674 |
47 |
|
[ ] Merge requests e-mail: explanation of why to pull, diffstat! Maybe also the patch if is small. |
|
|
66 |
|
[ ] Merge requests e-mail: explanation of why to pull, diffstat! Maybe also the |
|
67 |
|
patch if is small. |
48 |
68 |
[ ] Check git-request-pull |
[ ] Check git-request-pull |
49 |
69 |
[ ] Show the size of a repository. Also when you ssh from terminal. |
[ ] Show the size of a repository. Also when you ssh from terminal. |
50 |
70 |
See git-count-objects and http://stackoverflow.com/questions/8185276/find-size-of-git-repo. |
See git-count-objects and http://stackoverflow.com/questions/8185276/find-size-of-git-repo. |
51 |
|
[ ] Logo for project. |
|
|
71 |
|
[ ] Logo for project. Blender? |
52 |
72 |
[ ] Default branch per project[/user]. |
[ ] Default branch per project[/user]. |
53 |
73 |
[ ] Main language of the project. |
[ ] Main language of the project. |
54 |
74 |
[ ] Web site for a project. |
[ ] Web site for a project. |
55 |
75 |
[ ] |
[ ] |
56 |
76 |
|
|
57 |
77 |
== Normal priority == |
== Normal priority == |
|
78 |
|
[ ] Show last time use of a ssh key, or how many times was used, or both. |
58 |
79 |
[ ] Add hint about "ssh rocketgit@server" to quickly find status etc. |
[ ] Add hint about "ssh rocketgit@server" to quickly find status etc. |
59 |
80 |
[ ] rg_redirect does not record profiling information! |
[ ] rg_redirect does not record profiling information! |
60 |
81 |
[ ] git bundle |
[ ] git bundle |
File inc/admin/users/add.php changed (mode: 100644) (index f3a981a..848a9d6) |
... |
... |
if ($doit == 1) { |
22 |
22 |
|
|
23 |
23 |
while (1) { |
while (1) { |
24 |
24 |
if (rg_user_ok($xuser) !== TRUE) { |
if (rg_user_ok($xuser) !== TRUE) { |
25 |
|
$errmsg[] = "Invalid user name (" . rg_user_error() . ")!"; |
|
|
25 |
|
$errmsg[] = "invalid user name (" . rg_user_error() . ")"; |
26 |
26 |
break; |
break; |
27 |
27 |
} |
} |
28 |
28 |
|
|
29 |
29 |
if (rg_user_pass_ok($xpass) !== TRUE) { |
if (rg_user_pass_ok($xpass) !== TRUE) { |
30 |
|
$errmsg[] = "Invalid password (" . rg_user_error() . ")!"; |
|
|
30 |
|
$errmsg[] = "invalid password (" . rg_user_error() . ")"; |
31 |
31 |
break; |
break; |
32 |
32 |
} |
} |
33 |
33 |
|
|
34 |
34 |
$_ui = rg_user_info($db, 0, $xuser, ""); |
$_ui = rg_user_info($db, 0, $xuser, ""); |
35 |
35 |
if ($_ui['ok'] != 1) { |
if ($_ui['ok'] != 1) { |
36 |
|
$errmsg[] = "Internal error."; |
|
|
36 |
|
$errmsg[] = "internal error"; |
37 |
37 |
break; |
break; |
38 |
38 |
} |
} |
39 |
39 |
|
|
40 |
40 |
if ($_ui['exists'] == 1) { |
if ($_ui['exists'] == 1) { |
41 |
|
$errmsg[] = "User already exists."; |
|
|
41 |
|
$errmsg[] = "user already exists"; |
42 |
42 |
break; |
break; |
43 |
43 |
} |
} |
44 |
44 |
|
|
|
... |
... |
if ($doit == 1) { |
54 |
54 |
$_u['session_time'] = $session_time; |
$_u['session_time'] = $session_time; |
55 |
55 |
$_u['confirm_token'] = ""; |
$_u['confirm_token'] = ""; |
56 |
56 |
if (!rg_user_edit($db, $_u)) { |
if (!rg_user_edit($db, $_u)) { |
57 |
|
$errmsg[] = "Cannot add user (" . rg_user_error() . ")."; |
|
|
57 |
|
$errmsg[] = "cannot add user (" . rg_user_error() . ")"; |
58 |
58 |
break; |
break; |
59 |
59 |
} |
} |
60 |
60 |
|
|
File inc/admin/users/edit.php changed (mode: 100644) (index 44aa430..bf9d8bd) |
... |
... |
if ($doit == 1) { |
26 |
26 |
while (1) { |
while (1) { |
27 |
27 |
$_ui = rg_user_info($db, 0, $xuser, ""); |
$_ui = rg_user_info($db, 0, $xuser, ""); |
28 |
28 |
if ($_ui['ok'] == 0) { |
if ($_ui['ok'] == 0) { |
29 |
|
$errmsg[] = "Internal error!"; |
|
|
29 |
|
$errmsg[] = "internal error"; |
30 |
30 |
break; |
break; |
31 |
31 |
} |
} |
32 |
32 |
|
|
33 |
33 |
if ($_ui['exists'] == 0) { |
if ($_ui['exists'] == 0) { |
34 |
|
$errmsg[] = "User does not exists!"; |
|
|
34 |
|
$errmsg[] = "user does not exists"; |
35 |
35 |
break; |
break; |
36 |
36 |
} |
} |
37 |
37 |
|
|
|
... |
... |
if ($doit == 1) { |
47 |
47 |
$_u['session_time'] = $session_time; |
$_u['session_time'] = $session_time; |
48 |
48 |
$_u['confirm_token'] = ""; |
$_u['confirm_token'] = ""; |
49 |
49 |
if (!rg_user_edit($db, $_u)) { |
if (!rg_user_edit($db, $_u)) { |
50 |
|
$errmsg[] = "Cannot change info (" . rg_user_error() . ")."; |
|
|
50 |
|
$errmsg[] = "cannot change info (" . rg_user_error() . ")"; |
51 |
51 |
break; |
break; |
52 |
52 |
} |
} |
53 |
53 |
|
|
|
... |
... |
if ($doit == 1) { |
60 |
60 |
|
|
61 |
61 |
$_ui = rg_user_info($db, $uid, "", ""); |
$_ui = rg_user_info($db, $uid, "", ""); |
62 |
62 |
if ($_ui['ok'] == 0) { |
if ($_ui['ok'] == 0) { |
63 |
|
$_user_edit .= "Internal error!"; |
|
|
63 |
|
$_user_edit .= "internal error!"; |
64 |
64 |
$show_form = 0; |
$show_form = 0; |
65 |
65 |
} else if ($_ui['exists'] == 0) { |
} else if ($_ui['exists'] == 0) { |
66 |
|
$_user_edit .= "User does not exist!<br />"; |
|
|
66 |
|
$_user_edit .= "user does not exist<br />"; |
67 |
67 |
$show_form = 0; |
$show_form = 0; |
68 |
68 |
} else { |
} else { |
69 |
69 |
$xuser = $_ui['username']; |
$xuser = $_ui['username']; |
File inc/git.inc.php changed (mode: 100644) (index 39035b7..47613f0) |
... |
... |
function rg_git_install_hooks($dst) |
53 |
53 |
rg_log("git_install_hooks: dst=$dst"); |
rg_log("git_install_hooks: dst=$dst"); |
54 |
54 |
|
|
55 |
55 |
if (file_exists($dst . "/hooks")) { |
if (file_exists($dst . "/hooks")) { |
56 |
|
//rg_log("hooks folder exists..."); |
|
57 |
|
$_dir = @readlink($dst . "/hooks"); |
|
58 |
|
if ($_dir !== FALSE) { |
|
59 |
|
//rg_log("\treadlink returned=[$_dir]"); |
|
60 |
|
if (strcmp($_dir, $rg_scripts . "/hooks") == 0) |
|
61 |
|
return TRUE; |
|
|
56 |
|
if (is_link($dst . "/hooks")) { |
|
57 |
|
$_dir = @readlink($dst . "/hooks"); |
|
58 |
|
if ($_dir !== FALSE) { |
|
59 |
|
if (strcmp($_dir, $rg_scripts . "/hooks") == 0) |
|
60 |
|
return TRUE; |
|
61 |
|
rg_log("\tWARN: readlink returned=[$_dir]"); |
|
62 |
|
} |
62 |
63 |
} |
} |
63 |
64 |
|
|
64 |
65 |
rg_log("\tNot a link to scripts one, make it..."); |
rg_log("\tNot a link to scripts one, make it..."); |
|
... |
... |
function rg_git_ls_tree($tree, $path) |
389 |
390 |
|
|
390 |
391 |
// We are forced to use print_r instead of array2string because |
// We are forced to use print_r instead of array2string because |
391 |
392 |
// it may be a multilevel array. |
// it may be a multilevel array. |
392 |
|
rg_log("DEBUG: ls-tree: " . print_r($ret, TRUE)); |
|
|
393 |
|
rg_log_ml("DEBUG: ls-tree: " . print_r($ret, TRUE)); |
393 |
394 |
|
|
394 |
395 |
return $ret; |
return $ret; |
395 |
396 |
} |
} |
|
... |
... |
function rg_git_log($max, $from, $to, $also_patch) |
512 |
513 |
|
|
513 |
514 |
rg_log("git_log: from=$from to=$to max=$max"); |
rg_log("git_log: from=$from to=$to max=$max"); |
514 |
515 |
|
|
|
516 |
|
//Test if we have an emptydir |
|
517 |
|
$_dir = getenv("GIT_DIR"); |
|
518 |
|
if (!file_exists($_dir . "/refs/heads/master")) { |
|
519 |
|
rg_log("\tRepo is empty."); |
|
520 |
|
return ""; |
|
521 |
|
} |
|
522 |
|
|
515 |
523 |
$max_count = ($max == 0) ? "" : " --max-count=$max"; |
$max_count = ($max == 0) ? "" : " --max-count=$max"; |
516 |
524 |
$patches = $also_patch ? " --patch" : ""; |
$patches = $also_patch ? " --patch" : ""; |
517 |
525 |
|
|
|
... |
... |
function rg_git_branches_and_tags($repo_dir, $base_url, $current_ref) |
1004 |
1012 |
} |
} |
1005 |
1013 |
} |
} |
1006 |
1014 |
|
|
1007 |
|
$ret['HTML:branches_and_tags'] = "<div class=\"branches_and_tags\">\n"; |
|
1008 |
|
$ret['HTML:branches_and_tags'] .= implode("\n", $_l); |
|
1009 |
|
$ret['HTML:branches_and_tags'] .= "</div>\n"; |
|
|
1015 |
|
if (!empty($_l)) { |
|
1016 |
|
$ret['HTML:branches_and_tags'] = "<div class=\"branches_and_tags\">\n"; |
|
1017 |
|
$ret['HTML:branches_and_tags'] .= implode("\n", $_l); |
|
1018 |
|
$ret['HTML:branches_and_tags'] .= "</div>\n"; |
|
1019 |
|
} |
1010 |
1020 |
|
|
1011 |
1021 |
rg_log("rg_git_branches_and_tags: ret:" . rg_array2string($ret)); |
rg_log("rg_git_branches_and_tags: ret:" . rg_array2string($ret)); |
1012 |
1022 |
|
|
File inc/keys.inc.php changed (mode: 100644) (index 99ca553..d7746af) |
... |
... |
function rg_keys_error() |
19 |
19 |
} |
} |
20 |
20 |
|
|
21 |
21 |
/* |
/* |
22 |
|
* Validate key |
|
|
22 |
|
* Extracts info about a ssh key |
23 |
23 |
*/ |
*/ |
24 |
|
function rg_keys_valid($s) |
|
|
24 |
|
function rg_keys_info($key) |
25 |
25 |
{ |
{ |
26 |
|
$v = explode(" ", $s); |
|
27 |
|
if (!isset($v[1])) { |
|
28 |
|
rg_keys_set_error("Malformed input (missing fields)"); |
|
29 |
|
return FALSE; |
|
30 |
|
} |
|
|
26 |
|
$t = explode(" ", $key, 3); |
31 |
27 |
|
|
32 |
|
$decoded = base64_decode(trim($v[1])); |
|
33 |
|
if ($decoded === FALSE) { |
|
34 |
|
rg_keys_set_error("Malformed input (base64 failed)"); |
|
35 |
|
return FALSE; |
|
36 |
|
} |
|
|
28 |
|
$ret = array(); |
|
29 |
|
$ret['ok'] = 0; |
37 |
30 |
|
|
38 |
|
return $decoded; |
|
39 |
|
} |
|
|
31 |
|
if (!isset($t[1])) { |
|
32 |
|
rg_keys_set_error("malformed ssh key (missing fields)"); |
|
33 |
|
return $ret; |
|
34 |
|
} |
40 |
35 |
|
|
41 |
|
/* |
|
42 |
|
* Generates the fingerprint of a key |
|
43 |
|
*/ |
|
44 |
|
function rg_keys_fingerprint($key) |
|
45 |
|
{ |
|
46 |
|
$decoded = rg_keys_valid($key); |
|
47 |
|
if ($decoded === FALSE) |
|
48 |
|
return rg_keys_error(); |
|
|
36 |
|
$ret['type'] = $t[0]; |
|
37 |
|
$ret['key'] = isset($t[1]) ? $t[1] : ""; |
|
38 |
|
$ret['comment'] = isset($t[2]) ? $t[2] : ""; |
49 |
39 |
|
|
50 |
|
$digest = md5($decoded); |
|
|
40 |
|
$d = base64_decode($ret['key']); |
|
41 |
|
if ($d === FALSE) { |
|
42 |
|
rg_keys_set_error("malformed input (base64 failed)"); |
|
43 |
|
return $ret; |
|
44 |
|
} |
|
45 |
|
$digest = md5($d); |
51 |
46 |
|
|
52 |
47 |
$a = array(); |
$a = array(); |
53 |
48 |
for ($i = 0; $i < 16; $i++) |
for ($i = 0; $i < 16; $i++) |
54 |
49 |
$a[] = substr($digest, $i * 2, 2); |
$a[] = substr($digest, $i * 2, 2); |
55 |
50 |
|
|
56 |
|
return implode(":", $a); |
|
|
51 |
|
$ret['fingerprint'] = implode(":", $a); |
|
52 |
|
|
|
53 |
|
$ret['ok'] = 1; |
|
54 |
|
return $ret; |
57 |
55 |
} |
} |
58 |
56 |
|
|
59 |
57 |
/* |
/* |
|
... |
... |
function rg_keys_remove($db, $rg_ui, $key_id) |
63 |
61 |
{ |
{ |
64 |
62 |
rg_prof_start("keys_remove"); |
rg_prof_start("keys_remove"); |
65 |
63 |
|
|
66 |
|
// mark dirty |
|
67 |
|
if (rg_state_set($db, "authorized_keys", 1) === FALSE) { |
|
68 |
|
rg_keys_set_error("Cannot make state dirty (" . rg_state_error() . ")!"); |
|
69 |
|
return FALSE; |
|
70 |
|
} |
|
71 |
|
|
|
72 |
64 |
// TODO: move this to caller? |
// TODO: move this to caller? |
73 |
65 |
$e_key_id = sprintf("%u", $key_id); |
$e_key_id = sprintf("%u", $key_id); |
74 |
66 |
|
|
|
... |
... |
function rg_keys_remove($db, $rg_ui, $key_id) |
77 |
69 |
. " AND key_id = $e_key_id"; |
. " AND key_id = $e_key_id"; |
78 |
70 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
79 |
71 |
if ($res === FALSE) { |
if ($res === FALSE) { |
80 |
|
rg_keys_set_error("Cannot delete key $key_id (" . rg_sql_error() . ")"); |
|
|
72 |
|
rg_keys_set_error("cannot delete key $key_id (" . rg_sql_error() . ")"); |
81 |
73 |
return FALSE; |
return FALSE; |
82 |
74 |
} |
} |
83 |
75 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
84 |
76 |
|
|
|
77 |
|
// mark dirty |
|
78 |
|
if (rg_state_set($db, "authorized_keys", 1) === FALSE) { |
|
79 |
|
rg_keys_set_error("cannot make state dirty (" . rg_state_error() . ")!"); |
|
80 |
|
return FALSE; |
|
81 |
|
} |
|
82 |
|
|
85 |
83 |
rg_prof_end("keys_remove"); |
rg_prof_end("keys_remove"); |
86 |
84 |
|
|
87 |
85 |
return TRUE; |
return TRUE; |
|
... |
... |
function rg_keys_add($db, $rg_ui, $key) |
121 |
119 |
$itime = time(); |
$itime = time(); |
122 |
120 |
$e_key = rg_sql_escape($db, $key); |
$e_key = rg_sql_escape($db, $key); |
123 |
121 |
|
|
124 |
|
if (rg_keys_valid($key) === FALSE) |
|
|
122 |
|
$ki = rg_keys_info($key); |
|
123 |
|
if ($ki['ok'] != 1) |
125 |
124 |
return FALSE; |
return FALSE; |
126 |
125 |
|
|
127 |
126 |
// check if we are over the maximum |
// check if we are over the maximum |
|
... |
... |
function rg_keys_add($db, $rg_ui, $key) |
137 |
136 |
return FALSE; |
return FALSE; |
138 |
137 |
} |
} |
139 |
138 |
|
|
140 |
|
// set dirty |
|
141 |
|
if (rg_state_set($db, "authorized_keys", 1) === FALSE) { |
|
142 |
|
rg_keys_set_error("cannot make state dirty: " . rg_state_error()); |
|
143 |
|
return FALSE; |
|
144 |
|
} |
|
145 |
|
|
|
146 |
139 |
$sql = "INSERT INTO keys (itime, uid, key)" |
$sql = "INSERT INTO keys (itime, uid, key)" |
147 |
140 |
. " VALUES ($itime, " . $rg_ui['uid'] . ", '$e_key')" |
. " VALUES ($itime, " . $rg_ui['uid'] . ", '$e_key')" |
148 |
141 |
. " RETURNING key_id"; |
. " RETURNING key_id"; |
149 |
142 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
150 |
143 |
if ($res === FALSE) { |
if ($res === FALSE) { |
151 |
|
rg_keys_set_error("Cannot insert key (" . rg_sql_error() . ")"); |
|
|
144 |
|
rg_keys_set_error("cannot insert key (" . rg_sql_error() . ")"); |
152 |
145 |
return FALSE; |
return FALSE; |
153 |
146 |
} |
} |
154 |
147 |
$row = rg_sql_fetch_array($res); |
$row = rg_sql_fetch_array($res); |
155 |
148 |
$id = $row['key_id']; |
$id = $row['key_id']; |
156 |
149 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
157 |
150 |
|
|
|
151 |
|
// set dirty |
|
152 |
|
if (rg_state_set($db, "authorized_keys", 1) === FALSE) { |
|
153 |
|
rg_keys_set_error("cannot make state dirty: " . rg_state_error()); |
|
154 |
|
return FALSE; |
|
155 |
|
} |
|
156 |
|
|
158 |
157 |
rg_prof_end("keys_add"); |
rg_prof_end("keys_add"); |
159 |
158 |
|
|
160 |
159 |
return $id; |
return $id; |
|
... |
... |
function rg_keys_regen($db) |
199 |
198 |
return FALSE; |
return FALSE; |
200 |
199 |
} |
} |
201 |
200 |
|
|
|
201 |
|
// mark file as clean |
|
202 |
|
rg_state_set($db, "authorized_keys", 0); |
|
203 |
|
|
202 |
204 |
$sql = "SELECT uid, key FROM keys"; |
$sql = "SELECT uid, key FROM keys"; |
203 |
205 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
204 |
206 |
if ($res === FALSE) { |
if ($res === FALSE) { |
|
... |
... |
function rg_keys_regen($db) |
229 |
231 |
return FALSE; |
return FALSE; |
230 |
232 |
} |
} |
231 |
233 |
|
|
232 |
|
// mark file as clean |
|
233 |
|
rg_state_set($db, "authorized_keys", 0); |
|
234 |
|
|
|
235 |
234 |
rg_prof_end("keys_regen"); |
rg_prof_end("keys_regen"); |
236 |
235 |
|
|
237 |
236 |
return TRUE; |
return TRUE; |
|
... |
... |
function rg_keys_list($db, $rg_ui, $url) |
253 |
252 |
return FALSE; |
return FALSE; |
254 |
253 |
} |
} |
255 |
254 |
|
|
256 |
|
$ret = "<div class=\"rg_keys_list\">\n"; |
|
257 |
|
$ret .= "<table width=\"100%\">\n"; |
|
258 |
|
$ret .= "<tr>\n"; |
|
259 |
|
$ret .= " <th>Date (UTC)</th>\n"; |
|
260 |
|
$ret .= " <th>Fingerprint</th>\n"; |
|
261 |
|
$ret .= " <th>Operations</th>\n"; |
|
262 |
|
$ret .= "</tr>\n"; |
|
|
255 |
|
$data = array(); |
263 |
256 |
while (($row = rg_sql_fetch_array($res))) { |
while (($row = rg_sql_fetch_array($res))) { |
264 |
|
$ret .= "<tr>\n"; |
|
265 |
|
$ret .= " <td>" . gmdate("Y-m-d H:i", $row['itime']) . "</td>\n"; |
|
266 |
|
$ret .= " <td>" . rg_keys_fingerprint($row['key']) . "</td>\n"; |
|
267 |
|
|
|
268 |
|
$oper = ""; |
|
269 |
|
$oper = "[<a href=\"$url&key_id=" . $row['key_id'] |
|
270 |
|
. "&delete=1\">Delete!</a>]"; |
|
271 |
|
$ret .= " <td>" . $oper . "</td>\n"; |
|
272 |
|
$ret .= "</tr>\n"; |
|
|
257 |
|
$ki = rg_keys_info($row['key']); |
|
258 |
|
if ($ki['ok'] != 1) { |
|
259 |
|
rg_internal_error("Invalid key in db!"); |
|
260 |
|
continue; |
|
261 |
|
} |
|
262 |
|
|
|
263 |
|
$t = $ki; |
|
264 |
|
$t['itime'] = gmdate("Y-m-d H:i", $row['itime']); |
|
265 |
|
|
|
266 |
|
$t['HTML:operations'] = "[<a href=\"$url" |
|
267 |
|
. "&key_id=" . $row['key_id'] |
|
268 |
|
. "&delete=1\">Delete</a>]"; |
|
269 |
|
|
|
270 |
|
$data[] = $t; |
273 |
271 |
} |
} |
274 |
|
$ret .= "</table>\n"; |
|
275 |
|
$ret .= "</div>\n"; |
|
276 |
272 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
277 |
273 |
|
|
|
274 |
|
$ret = rg_template_table("user/keys/list", $data, array()); |
|
275 |
|
|
278 |
276 |
rg_prof_end("keys_list"); |
rg_prof_end("keys_list"); |
279 |
277 |
|
|
280 |
278 |
return $ret; |
return $ret; |
File inc/log.inc.php changed (mode: 100644) (index 8601be1..0c6640f) |
... |
... |
function rg_log_set_file($file) |
18 |
18 |
$rg_log_file = $file; |
$rg_log_file = $file; |
19 |
19 |
} |
} |
20 |
20 |
|
|
|
21 |
|
/* |
|
22 |
|
* Transforms strange chars to hexa |
|
23 |
|
*/ |
|
24 |
|
function rg_log_callback($matches) |
|
25 |
|
{ |
|
26 |
|
$n = pack("a*", $matches[0]); |
|
27 |
|
$tmp = unpack("H*", $n); |
|
28 |
|
return "[" . $tmp[1] . "]"; |
|
29 |
|
} |
|
30 |
|
|
21 |
31 |
function rg_log($str) |
function rg_log($str) |
22 |
32 |
{ |
{ |
23 |
33 |
global $rg_log_file; |
global $rg_log_file; |
|
... |
... |
function rg_log($str) |
34 |
44 |
|
|
35 |
45 |
$t = gettimeofday(); |
$t = gettimeofday(); |
36 |
46 |
|
|
37 |
|
$a = explode("\n", $str); |
|
38 |
47 |
$buf0 = gmdate("Y-m-d H:i:s", $t['sec']) . "." . sprintf("%03u", $t['usec'] / 1000); |
$buf0 = gmdate("Y-m-d H:i:s", $t['sec']) . "." . sprintf("%03u", $t['usec'] / 1000); |
39 |
48 |
$buf0 .= " " . $rg_log_sid . " "; |
$buf0 .= " " . $rg_log_sid . " "; |
40 |
49 |
$buf = ""; |
$buf = ""; |
41 |
|
foreach ($a as $line) { |
|
42 |
|
// TODO: replace string chars with [HH]; use /e |
|
43 |
|
$line = preg_replace('/[\\x00-\\x08\\x0a-\\x1f\\x7f-\\xff]/', "X", $line); |
|
44 |
|
$buf .= $buf0 . $line . "\n"; |
|
45 |
|
} |
|
|
50 |
|
$str = preg_replace_callback('/[^\pL\pN\pP\pS \t]/uU', "rg_log_callback", $str); |
|
51 |
|
$buf .= $buf0 . $str . "\n"; |
46 |
52 |
|
|
47 |
53 |
if ($rg_log_fd !== NULL) |
if ($rg_log_fd !== NULL) |
48 |
54 |
fwrite($rg_log_fd, $buf); |
fwrite($rg_log_fd, $buf); |
49 |
55 |
} |
} |
50 |
56 |
|
|
|
57 |
|
/* |
|
58 |
|
* Log a multiline string |
|
59 |
|
*/ |
|
60 |
|
function rg_log_ml($str) |
|
61 |
|
{ |
|
62 |
|
$lines = explode("\n", $str); |
|
63 |
|
if (empty($lines)) |
|
64 |
|
return; |
|
65 |
|
|
|
66 |
|
foreach ($lines as $line) |
|
67 |
|
rg_log($line); |
|
68 |
|
} |
|
69 |
|
|
51 |
70 |
function rg_fatal($msg) |
function rg_fatal($msg) |
52 |
71 |
{ |
{ |
53 |
72 |
rg_log("FATAL: $msg"); |
rg_log("FATAL: $msg"); |
54 |
73 |
|
|
55 |
74 |
$bt = debug_backtrace(); |
$bt = debug_backtrace(); |
56 |
|
rg_log("Backtrace: " . print_r($bt, TRUE)); |
|
|
75 |
|
rg_log_ml("Backtrace: " . print_r($bt, TRUE)); |
57 |
76 |
exit(1); |
exit(1); |
58 |
77 |
} |
} |
59 |
78 |
|
|
|
... |
... |
function rg_internal_error($msg) |
62 |
81 |
rg_log("Internal error: $msg"); |
rg_log("Internal error: $msg"); |
63 |
82 |
|
|
64 |
83 |
$bt = debug_backtrace(); |
$bt = debug_backtrace(); |
65 |
|
rg_log("Backtrace: " . print_r($bt, TRUE)); |
|
|
84 |
|
rg_log_ml("Backtrace: " . print_r($bt, TRUE)); |
66 |
85 |
} |
} |
67 |
86 |
|
|
68 |
87 |
// TODO: send mail or store all data in database |
// TODO: send mail or store all data in database |
|
... |
... |
function rg_security_violation($msg) |
71 |
90 |
rg_log("Security violation: $msg"); |
rg_log("Security violation: $msg"); |
72 |
91 |
|
|
73 |
92 |
$bt = debug_backtrace(); |
$bt = debug_backtrace(); |
74 |
|
rg_log("Backtrace: " . print_r($bt, TRUE)); |
|
|
93 |
|
rg_log_ml("Backtrace: " . print_r($bt, TRUE)); |
75 |
94 |
|
|
76 |
95 |
exit(1); |
exit(1); |
77 |
96 |
} |
} |
File inc/rights.inc.php changed (mode: 100644) (index 23ba88a..3afd2e7) |
... |
... |
function rg_rights_checkboxes($type, $passed_rights) |
82 |
82 |
global $rg_rights; |
global $rg_rights; |
83 |
83 |
|
|
84 |
84 |
if (!isset($rg_rights[$type])) { |
if (!isset($rg_rights[$type])) { |
85 |
|
rg_log("[$type] is not registered! " . print_r(debug_backtrace(), TRUE)); |
|
|
85 |
|
rg_internal_error("[$type] is not registered!"); |
86 |
86 |
return ""; |
return ""; |
87 |
87 |
} |
} |
88 |
88 |
|
|
|
... |
... |
function rg_rights_get($db, $type, $obj_id, $uid) |
157 |
157 |
. " LIMIT 1"; |
. " LIMIT 1"; |
158 |
158 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
159 |
159 |
if ($res === FALSE) { |
if ($res === FALSE) { |
160 |
|
rg_rights_set_error("Cannot get info (" . rg_sql_error() . ")!"); |
|
|
160 |
|
rg_rights_set_error("cannot get info (" . rg_sql_error() . ")!"); |
161 |
161 |
return $ret; |
return $ret; |
162 |
162 |
} |
} |
163 |
163 |
|
|
|
... |
... |
function rg_rights_set($db, $type, $obj_id, $uid, $rights) |
212 |
212 |
|
|
213 |
213 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
214 |
214 |
if ($res === FALSE) { |
if ($res === FALSE) { |
215 |
|
rg_rights_set_error("Cannot alter rights (" . rg_sql_error() . ")!"); |
|
|
215 |
|
rg_rights_set_error("cannot alter rights (" . rg_sql_error() . ")!"); |
216 |
216 |
return FALSE; |
return FALSE; |
217 |
217 |
} |
} |
218 |
218 |
rg_sql_free_result($res); |
rg_sql_free_result($res); |
|
... |
... |
function rg_rights_list($db, $type, $obj_id, $url) |
234 |
234 |
$sql = "SELECT * FROM rights WHERE type = '$type' AND obj_id = $obj_id"; |
$sql = "SELECT * FROM rights WHERE type = '$type' AND obj_id = $obj_id"; |
235 |
235 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
236 |
236 |
if ($res === FALSE) { |
if ($res === FALSE) { |
237 |
|
rg_rights_set_error("Cannot get info (" . rg_sql_error() . ")!"); |
|
|
237 |
|
rg_rights_set_error("cannot get info (" . rg_sql_error() . ")!"); |
238 |
238 |
return FALSE; |
return FALSE; |
239 |
239 |
} |
} |
240 |
240 |
|
|
File inc/user.inc.php changed (mode: 100644) (index dfe4d5f..f50d4e4) |
... |
... |
function rg_user_list($db, $url) |
518 |
518 |
$sql = "SELECT * FROM users ORDER BY username"; |
$sql = "SELECT * FROM users ORDER BY username"; |
519 |
519 |
$res = rg_sql_query($db, $sql); |
$res = rg_sql_query($db, $sql); |
520 |
520 |
if ($res === FALSE) { |
if ($res === FALSE) { |
521 |
|
rg_user_set_error("Cannot get info (" . rg_sql_error() . ")!"); |
|
|
521 |
|
rg_user_set_error("cannot get info (" . rg_sql_error() . ")!"); |
522 |
522 |
return FALSE; |
return FALSE; |
523 |
523 |
} |
} |
524 |
524 |
|
|
|
... |
... |
function rg_user_forgot_pass_mail($db, $email) |
709 |
709 |
. "If you want to reset the password, follow:\n" |
. "If you want to reset the password, follow:\n" |
710 |
710 |
. $proto . "://" |
. $proto . "://" |
711 |
711 |
. @$_SERVER['HTTP_HOST'] |
. @$_SERVER['HTTP_HOST'] |
712 |
|
. rg_re_url("/op/forgot_link") . "&forgot_token=" . $r['token'], |
|
|
712 |
|
. rg_re_url("/op/forgot_link") . "&forgot_token=" . $r['token'] |
|
713 |
|
. "\n\nRocketGit team", |
713 |
714 |
$headers, |
$headers, |
714 |
715 |
"-f $rg_admin_email")) { |
"-f $rg_admin_email")) { |
715 |
|
rg_user_set_error("Cannot send mail ($php_errormsg)!"); |
|
|
716 |
|
rg_user_set_error("cannot send mail ($php_errormsg)!"); |
716 |
717 |
return $ret; |
return $ret; |
717 |
718 |
} |
} |
718 |
719 |
|
|
|
... |
... |
function rg_user_confirm_send($email, $token) |
782 |
783 |
. "Please confirm your account creation following:\n" |
. "Please confirm your account creation following:\n" |
783 |
784 |
. $proto |
. $proto |
784 |
785 |
. @$_SERVER['HTTP_HOST'] |
. @$_SERVER['HTTP_HOST'] |
785 |
|
. rg_re_url("/op/confirm") . "&token=$token", |
|
|
786 |
|
. rg_re_url("/op/confirm") . "&token=" . $token |
|
787 |
|
. "\n\nRocketGit team", |
786 |
788 |
$headers, |
$headers, |
787 |
789 |
"-f $rg_admin_email")) { |
"-f $rg_admin_email")) { |
788 |
|
rg_user_set_error("Cannot send mail ($php_errormsg)!"); |
|
|
790 |
|
rg_user_set_error("cannot send mail ($php_errormsg)!"); |
789 |
791 |
return FALSE; |
return FALSE; |
790 |
792 |
} |
} |
791 |
793 |
|
|
File inc/user/repo-page.php changed (mode: 100644) (index 67824df..be8d7a9) |
... |
... |
if (rg_repo_ok($rr['repo']) !== TRUE) { |
13 |
13 |
return; |
return; |
14 |
14 |
} |
} |
15 |
15 |
|
|
16 |
|
$ri = rg_repo_info($db, $rr); |
|
17 |
|
if ($ri === FALSE) { |
|
18 |
|
$_repo_page .= "Internal error!"; |
|
19 |
|
return; |
|
20 |
|
} |
|
21 |
|
if (($ri['ok'] != 1) || ($ri['exists'] != 1) || ($ri['deleted'] == 1)) { |
|
22 |
|
$_repo_page .= "Invalid repository!"; |
|
23 |
|
return; |
|
|
16 |
|
// Git dir is done asynchronous, loop till is OK |
|
17 |
|
while (1) { |
|
18 |
|
$ri = rg_repo_info($db, $rr); |
|
19 |
|
if ($ri === FALSE) { |
|
20 |
|
$_repo_page .= "Internal error!"; |
|
21 |
|
return; |
|
22 |
|
} |
|
23 |
|
|
|
24 |
|
if (($ri['ok'] != 1) || ($ri['exists'] != 1) || ($ri['deleted'] == 1)) { |
|
25 |
|
$_repo_page .= "Invalid repository!"; |
|
26 |
|
return; |
|
27 |
|
} |
|
28 |
|
|
|
29 |
|
if ($ri['git_dir_done'] == 1) |
|
30 |
|
break; |
|
31 |
|
|
|
32 |
|
rg_log("git dir is not ready yet. Sleep 1 second and loop."); |
|
33 |
|
sleep(1); |
24 |
34 |
} |
} |
25 |
35 |
|
|
26 |
36 |
$ui = rg_user_info($db, 0, $rr['user'], ""); |
$ui = rg_user_info($db, 0, $rr['user'], ""); |
|
... |
... |
$_more = array( |
39 |
49 |
"git" => rg_re_repo_git($rr), |
"git" => rg_re_repo_git($rr), |
40 |
50 |
"can_admin" => $can_admin |
"can_admin" => $can_admin |
41 |
51 |
); |
); |
|
52 |
|
$_more = array_merge($_more, $ri); |
|
53 |
|
$_more['default_rights'] = implode(", ", rg_rights_text("repo", $ri['default_rights'])); |
|
54 |
|
$_more['max_commit_size'] = $ri['max_commit_size'] == 0 ? "unlimited" : rg_1024($ri['max_commit_size']); |
|
55 |
|
$_more['max_users'] = $ri['max_users'] == 0 ? "unlimited" : rg_1000($ri['max_users']); |
|
56 |
|
$_more['hints'] = ""; |
42 |
57 |
|
|
43 |
58 |
$repo_dir = rg_repo_name2base($rr) . $rr['repo'] . ".git"; |
$repo_dir = rg_repo_name2base($rr) . $rr['repo'] . ".git"; |
44 |
59 |
rg_log("repo_dir=$repo_dir"); |
rg_log("repo_dir=$repo_dir"); |
|
... |
... |
$_more['branches_and_tags'] = ""; |
54 |
69 |
$_repo_body = ""; |
$_repo_body = ""; |
55 |
70 |
$_repo_right = ""; |
$_repo_right = ""; |
56 |
71 |
|
|
|
72 |
|
// build urls list |
|
73 |
|
$urls = array(); |
|
74 |
|
if ($rg_ssh_port != 0) |
|
75 |
|
$urls[]['HTML:url'] = '<a href="' . $_more['ssh'] . '">' . $_more['ssh'] . '</a>'; |
|
76 |
|
if ($rg_git_port != 0) |
|
77 |
|
$urls[]['HTML:url'] = '<a href="' . $_more['git'] . '">' . $_more['git'] . '</a>'; |
|
78 |
|
$_more['HTML:urls'] = rg_template_table("repo/urls", $urls, $_more); |
|
79 |
|
|
57 |
80 |
if (strcmp($subop, "admin") == 0) { |
if (strcmp($subop, "admin") == 0) { |
58 |
81 |
if ($can_admin != 1) |
if ($can_admin != 1) |
59 |
82 |
rg_security_violation("User is not admin!"); |
rg_security_violation("User is not admin!"); |
|
... |
... |
if (strcmp($subop, "admin") == 0) { |
72 |
95 |
rg_log("DEBUG: _more: " . rg_array2string($_more)); |
rg_log("DEBUG: _more: " . rg_array2string($_more)); |
73 |
96 |
$_more = array_merge($_more, $bt); |
$_more = array_merge($_more, $bt); |
74 |
97 |
|
|
|
98 |
|
$hints = array(); |
|
99 |
|
if ($rg_ssh_port != 0) |
|
100 |
|
$hints[]['HTML:hint'] = rg_template("hints/repo/clone_ssh.html", $_more); |
|
101 |
|
if ($rg_git_port != 0) |
|
102 |
|
$hints[]['HTML:hint'] = rg_template("hints/repo/clone_git.html", $_more); |
|
103 |
|
if (rg_rights_allow($ri['default_rights'], "H")) // anonymous push? |
|
104 |
|
$hints[]['HTML:hint'] = rg_template("hints/repo/anon_push.html", $_more); |
|
105 |
|
rg_log("DEBUG: hints1: " . rg_array2string($hints)); |
|
106 |
|
$_more['HTML:hints'] = rg_template_table("hints/list", $hints, $_more); |
|
107 |
|
rg_log("DEBUG: hints: " . $_more['HTML:hints']); |
|
108 |
|
|
75 |
109 |
$_repo_body .= rg_template("repo/source.html", $_more); |
$_repo_body .= rg_template("repo/source.html", $_more); |
76 |
110 |
|
|
77 |
111 |
rg_log("DEBUG: subop=[$subop]"); |
rg_log("DEBUG: subop=[$subop]"); |
|
... |
... |
if (strcmp($subop, "admin") == 0) { |
121 |
155 |
rg_log("Error generating log (" . rg_git_error() . ")!"); |
rg_log("Error generating log (" . rg_git_error() . ")!"); |
122 |
156 |
$_repo_body .= "Error generating log!"; |
$_repo_body .= "Error generating log!"; |
123 |
157 |
// TODO: rg_internal_error? |
// TODO: rg_internal_error? |
|
158 |
|
} else if (empty($log)) { |
|
159 |
|
$_repo_body .= rg_template("repo/not_init.html", $_more); |
124 |
160 |
} else { |
} else { |
125 |
161 |
//rg_log("DEBUG: log: " . print_r($log, TRUE)); |
//rg_log("DEBUG: log: " . print_r($log, TRUE)); |
126 |
162 |
$_repo_body .= rg_git_log_template($log, |
$_repo_body .= rg_git_log_template($log, |
|
... |
... |
if (strcmp($subop, "admin") == 0) { |
191 |
227 |
} |
} |
192 |
228 |
} |
} |
193 |
229 |
|
|
194 |
|
$ri2 = $ri; |
|
195 |
|
$ri2['default_rights'] = implode(", ", rg_rights_text("repo", $ri['default_rights'])); |
|
196 |
|
$ri2['max_commit_size'] = $ri['max_commit_size'] == 0 ? "unlimited" : rg_1024($ri['max_commit_size']); |
|
197 |
|
$ri2['max_users'] = $ri['max_users'] == 0 ? "unlimited" : rg_1000($ri['max_users']); |
|
198 |
|
|
|
199 |
230 |
$_more['HTML:repo_body'] = $_repo_body; |
$_more['HTML:repo_body'] = $_repo_body; |
200 |
231 |
$_more['HTML:repo_right'] = $_repo_right; |
$_more['HTML:repo_right'] = $_repo_right; |
201 |
|
$_repo_page = rg_template("repo/main.html", array_merge($ri2, $_more)); |
|
|
232 |
|
$_repo_page = rg_template("repo/main.html", $_more); |
202 |
233 |
?> |
?> |
File inc/util.inc.php changed (mode: 100644) (index 1cdf802..a58816b) |
... |
... |
function rg_re_bugpage($ui, $ri, $bug_id) |
183 |
183 |
|
|
184 |
184 |
function rg_re_repo_ssh($rr) |
function rg_re_repo_ssh($rr) |
185 |
185 |
{ |
{ |
|
186 |
|
global $rg_ssh_host; |
186 |
187 |
global $rg_ssh_port; |
global $rg_ssh_port; |
187 |
188 |
|
|
188 |
189 |
if ($rg_ssh_port == 22) |
if ($rg_ssh_port == 22) |
189 |
190 |
$port = ""; |
$port = ""; |
190 |
191 |
else |
else |
191 |
192 |
$port = ":" . $rg_ssh_port; |
$port = ":" . $rg_ssh_port; |
192 |
|
return "ssh://rocketgit@" . $_SERVER['SERVER_NAME'] . $port |
|
|
193 |
|
return "ssh://rocketgit@" . $rg_ssh_host . $port |
193 |
194 |
. $rr['prefix'] . "/" . $rr['user'] . "/" . $rr['repo']; |
. $rr['prefix'] . "/" . $rr['user'] . "/" . $rr['repo']; |
194 |
195 |
} |
} |
195 |
196 |
|
|
|
... |
... |
function rg_menu($a, $rg_ui, $op, $subop) |
342 |
343 |
return $ret; |
return $ret; |
343 |
344 |
} |
} |
344 |
345 |
|
|
|
346 |
|
/* |
|
347 |
|
* Provides a link to a image, taking in consideration the theme |
|
348 |
|
* Used by rg_prepare_image. |
|
349 |
|
*/ |
|
350 |
|
function rg_image_callback($matches) |
|
351 |
|
{ |
|
352 |
|
global $rg_scripts; |
|
353 |
|
global $rg_theme; |
|
354 |
|
|
|
355 |
|
$n = $matches[1]; |
|
356 |
|
$url = "/themes/" . $rg_theme . "/" . $n; |
|
357 |
|
$xfile = $rg_scripts . "/root" . $url; |
|
358 |
|
if (!is_file($xfile)) |
|
359 |
|
$url = "/themes/default/" . $n; |
|
360 |
|
|
|
361 |
|
return $url; |
|
362 |
|
} |
|
363 |
|
|
|
364 |
|
/* |
|
365 |
|
* Prepare an image taking in consideration the them. It will use rg_img as |
|
366 |
|
* callback. |
|
367 |
|
*/ |
|
368 |
|
function rg_prepare_image($line) |
|
369 |
|
{ |
|
370 |
|
return preg_replace_callback('/@@IMG:(.*)@@/U', "rg_image_callback", $line); |
|
371 |
|
} |
|
372 |
|
|
345 |
373 |
/* |
/* |
346 |
374 |
* Replace conditionals |
* Replace conditionals |
347 |
375 |
* @@if(X)_@@A@@_@@B@@ - if X is 0 will return @@B@@, else @@A@@ |
* @@if(X)_@@A@@_@@B@@ - if X is 0 will return @@B@@, else @@A@@ |
|
... |
... |
function rg_prepare_replace(&$data, &$what, &$values) |
378 |
406 |
//$what['FINAL'] = "/@@.*@@/U"; |
//$what['FINAL'] = "/@@.*@@/U"; |
379 |
407 |
//$values['FINAL'] = ""; |
//$values['FINAL'] = ""; |
380 |
408 |
|
|
381 |
|
//rg_log("DEBUG: what: " . print_r($what, TRUE)); |
|
382 |
|
//rg_log("DEBUG: values: " . print_r($values, TRUE)); |
|
|
409 |
|
//rg_log_ml("DEBUG: what: " . print_r($what, TRUE)); |
|
410 |
|
//rg_log_ml("DEBUG: values: " . print_r($values, TRUE)); |
|
411 |
|
} |
|
412 |
|
|
|
413 |
|
/* |
|
414 |
|
* Loads a file if exists, else return "" |
|
415 |
|
*/ |
|
416 |
|
function rg_file_get_contents($f) |
|
417 |
|
{ |
|
418 |
|
if (!file_exists($f)) |
|
419 |
|
return ""; |
|
420 |
|
|
|
421 |
|
return @file_get_contents($f); |
383 |
422 |
} |
} |
384 |
423 |
|
|
385 |
424 |
/* |
/* |
|
... |
... |
function rg_template_table($dir, $data, $more) |
390 |
429 |
global $rg_theme; |
global $rg_theme; |
391 |
430 |
global $rg_scripts; |
global $rg_scripts; |
392 |
431 |
|
|
393 |
|
$dir = $rg_scripts . "/root/themes/" . $rg_theme . "/" . $dir; |
|
394 |
|
if (!is_dir($dir)) |
|
395 |
|
$dir = $rg_scripts . "/themes/default/" . $dir; |
|
|
432 |
|
$xdir = $rg_scripts . "/root/themes/" . $rg_theme . "/" . $dir; |
|
433 |
|
if (!is_dir($xdir)) |
|
434 |
|
$xdir = $rg_scripts . "/root/themes/default/" . $dir; |
396 |
435 |
|
|
397 |
436 |
$m_what = array(); $m_values = array(); |
$m_what = array(); $m_values = array(); |
398 |
437 |
rg_prepare_replace($more, $m_what, $m_values); |
rg_prepare_replace($more, $m_what, $m_values); |
399 |
438 |
rg_prepare_conditionals($more, $m_what, $m_values); |
rg_prepare_conditionals($more, $m_what, $m_values); |
400 |
439 |
|
|
401 |
440 |
if (!is_array($data) || (count($data) == 0)) { |
if (!is_array($data) || (count($data) == 0)) { |
402 |
|
$no_data = @file_get_contents($dir . "/nodata.html"); |
|
403 |
|
if ($no_data === FALSE) |
|
404 |
|
$no_data = ""; |
|
|
441 |
|
$no_data = rg_file_get_contents($xdir . "/nodata.html"); |
405 |
442 |
return preg_replace($m_what, $m_values, $no_data); |
return preg_replace($m_what, $m_values, $no_data); |
406 |
443 |
} |
} |
407 |
444 |
|
|
408 |
|
$head = @file_get_contents($dir . "/header.html"); |
|
409 |
|
if ($head === FALSE) |
|
410 |
|
$head = ""; |
|
411 |
|
|
|
412 |
|
$line = @file_get_contents($dir . "/line.html"); |
|
413 |
|
if ($line === FALSE) |
|
414 |
|
$line = ""; |
|
415 |
|
|
|
416 |
|
$foot = @file_get_contents($dir . "/footer.html"); |
|
417 |
|
if ($foot === FALSE) |
|
418 |
|
$foot = ""; |
|
|
445 |
|
$head = rg_file_get_contents($xdir . "/header.html"); |
|
446 |
|
$line = rg_file_get_contents($xdir . "/line.html"); |
|
447 |
|
$foot = rg_file_get_contents($xdir . "/footer.html"); |
|
448 |
|
$between = rg_file_get_contents($xdir . "/between.html"); |
419 |
449 |
|
|
420 |
450 |
$head = preg_replace($m_what, $m_values, $head); |
$head = preg_replace($m_what, $m_values, $head); |
421 |
451 |
$foot = preg_replace($m_what, $m_values, $foot); |
$foot = preg_replace($m_what, $m_values, $foot); |
|
452 |
|
$between = preg_replace($m_what, $m_values, $between); |
422 |
453 |
|
|
423 |
454 |
$body = ""; |
$body = ""; |
|
455 |
|
$first = 1; |
424 |
456 |
foreach ($data as $index => $info) { |
foreach ($data as $index => $info) { |
425 |
457 |
$what = $m_what; $values = $m_values; |
$what = $m_what; $values = $m_values; |
426 |
458 |
|
|
427 |
459 |
rg_prepare_replace($info, $what, $values); |
rg_prepare_replace($info, $what, $values); |
428 |
460 |
rg_prepare_conditionals($info, $what, $values); |
rg_prepare_conditionals($info, $what, $values); |
429 |
461 |
|
|
|
462 |
|
$line = rg_prepare_image($line); |
|
463 |
|
|
|
464 |
|
if ($first == 1) { |
|
465 |
|
$first = 0; |
|
466 |
|
} else { |
|
467 |
|
$body .= $between; |
|
468 |
|
} |
|
469 |
|
|
430 |
470 |
$body .= preg_replace($what, $values, $line); |
$body .= preg_replace($what, $values, $line); |
431 |
471 |
} |
} |
432 |
472 |
|
|
|
... |
... |
function rg_template($file, $data) |
438 |
478 |
global $rg_scripts; |
global $rg_scripts; |
439 |
479 |
global $rg_theme; |
global $rg_theme; |
440 |
480 |
|
|
441 |
|
$file = $rg_scripts . "/root/themes/" . $rg_theme . "/" . $file; |
|
442 |
|
if (!is_file($file)) |
|
443 |
|
$file = $rg_scripts . "/themes/default/" . $file; |
|
|
481 |
|
$xfile = $rg_scripts . "/root/themes/" . $rg_theme . "/" . $file; |
|
482 |
|
if (!is_file($xfile)) |
|
483 |
|
$xfile = $rg_scripts . "/root/themes/default/" . $file; |
444 |
484 |
|
|
445 |
|
$body = @file_get_contents($file); |
|
446 |
|
if ($body === FALSE) |
|
|
485 |
|
$body = rg_file_get_contents($xfile); |
|
486 |
|
if (empty($body)) |
447 |
487 |
return ""; |
return ""; |
448 |
488 |
|
|
449 |
489 |
$what = array(); |
$what = array(); |
|
... |
... |
function rg_template($file, $data) |
452 |
492 |
rg_prepare_replace($data, $what, $values); |
rg_prepare_replace($data, $what, $values); |
453 |
493 |
rg_prepare_conditionals($data, $what, $values); |
rg_prepare_conditionals($data, $what, $values); |
454 |
494 |
|
|
|
495 |
|
$body = rg_prepare_image($body); |
|
496 |
|
|
455 |
497 |
return preg_replace($what, $values, $body); |
return preg_replace($what, $values, $body); |
456 |
498 |
} |
} |
457 |
499 |
|
|
|
... |
... |
function rg_template_list($c) |
481 |
523 |
*/ |
*/ |
482 |
524 |
function rg_template_errmsg($a) |
function rg_template_errmsg($a) |
483 |
525 |
{ |
{ |
|
526 |
|
if (empty($a)) |
|
527 |
|
return ""; |
|
528 |
|
|
484 |
529 |
$b = array(); |
$b = array(); |
485 |
530 |
foreach ($a as $junk => $err) |
foreach ($a as $junk => $err) |
486 |
531 |
$b[] = array("error" => $err); |
$b[] = array("error" => $err); |
|
... |
... |
function rg_exec($cmd) |
494 |
539 |
{ |
{ |
495 |
540 |
rg_prof_start("exec($cmd)"); |
rg_prof_start("exec($cmd)"); |
496 |
541 |
|
|
|
542 |
|
rg_log("Executing [$cmd]..."); |
|
543 |
|
|
497 |
544 |
$ret = array(); |
$ret = array(); |
498 |
545 |
$ret['ok'] = 0; |
$ret['ok'] = 0; |
499 |
546 |
$ret['errmsg'] = ""; |
$ret['errmsg'] = ""; |
|
... |
... |
function rg_dir_load($dir) |
571 |
618 |
global $php_errormsg; |
global $php_errormsg; |
572 |
619 |
|
|
573 |
620 |
$ret = array(); |
$ret = array(); |
|
621 |
|
if (!file_exists($dir)) { |
|
622 |
|
rg_log("$dir does not exists!"); |
|
623 |
|
return $ret; |
|
624 |
|
} |
|
625 |
|
|
574 |
626 |
$d = @scandir($dir); |
$d = @scandir($dir); |
575 |
627 |
if ($d === FALSE) { |
if ($d === FALSE) { |
576 |
628 |
rg_log("Cannot scan dir $dir ($php_errormsg)."); |
rg_log("Cannot scan dir $dir ($php_errormsg)."); |
File root/index.php changed (mode: 100644) (index 1f486b3..3b1b94a) |
... |
... |
ini_set("track_errors", "On"); |
4 |
4 |
|
|
5 |
5 |
$INC = dirname(__FILE__) . "/../inc"; |
$INC = dirname(__FILE__) . "/../inc"; |
6 |
6 |
require_once("/etc/rocketgit/config.php"); |
require_once("/etc/rocketgit/config.php"); |
|
7 |
|
require_once($INC . "/init.inc.php"); |
7 |
8 |
require_once($INC . "/log.inc.php"); |
require_once($INC . "/log.inc.php"); |
8 |
9 |
include_once($INC . "/sql.inc.php"); |
include_once($INC . "/sql.inc.php"); |
9 |
10 |
include_once($INC . "/struct.inc.php"); |
include_once($INC . "/struct.inc.php"); |
|
... |
... |
$op = ""; $subop = ""; $subsubop = ""; $cop = ""; |
25 |
26 |
$rr = array("user" => "", "repo" => "", "prefix" => ""); |
$rr = array("user" => "", "repo" => "", "prefix" => ""); |
26 |
27 |
$paras = array(); |
$paras = array(); |
27 |
28 |
$rg_ui = array(); |
$rg_ui = array(); |
28 |
|
$more = array(); |
|
29 |
29 |
|
|
30 |
30 |
// We have variable 'vv' passed from webserver - build 'op' and rest of paras |
// We have variable 'vv' passed from webserver - build 'op' and rest of paras |
31 |
31 |
$vv = rg_var_str("vv"); |
$vv = rg_var_str("vv"); |
|
... |
... |
rg_log("_COOKIE: " . rg_array2string($_COOKIE)); |
82 |
82 |
rg_log("Start! cop=[$cop] op=$op subop=$subop subsubop=$subsubop" |
rg_log("Start! cop=[$cop] op=$op subop=$subop subsubop=$subsubop" |
83 |
83 |
. " doit=$doit sid=$sid rr: " . rg_array2string($rr)); |
. " doit=$doit sid=$sid rr: " . rg_array2string($rr)); |
84 |
84 |
rg_log("paras: " . implode("|", $paras)); |
rg_log("paras: " . implode("|", $paras)); |
|
85 |
|
rg_log("DEBUG: locale: " . setlocale(LC_ALL, 0)); |
85 |
86 |
|
|
86 |
87 |
|
|
87 |
88 |
// database connection |
// database connection |
File root/themes/default/main.css changed (mode: 100644) (index 68706a8..d767b96) |
... |
... |
body { |
7 |
7 |
font-family: arial, helvetica, sans-serif; |
font-family: arial, helvetica, sans-serif; |
8 |
8 |
font-size: 10pt; |
font-size: 10pt; |
9 |
9 |
line-height: 105%; |
line-height: 105%; |
|
10 |
|
background-color: #EEEEEE; |
10 |
11 |
} |
} |
11 |
12 |
|
|
12 |
13 |
table { |
table { |
|
... |
... |
th, td { |
28 |
29 |
|
|
29 |
30 |
#container { background-color: #eeeeee; overflow: hidden; } |
#container { background-color: #eeeeee; overflow: hidden; } |
30 |
31 |
|
|
31 |
|
.white_border { border: 1px solid #eeeeee; } |
|
32 |
|
|
|
33 |
32 |
#menus { float: left; } |
#menus { float: left; } |
34 |
33 |
|
|
35 |
34 |
.menu { padding: 6px 0px; } |
.menu { padding: 6px 0px; } |
|
... |
... |
th, td { |
71 |
70 |
border-top: 1px solid #cccccc; |
border-top: 1px solid #cccccc; |
72 |
71 |
padding: 5px; |
padding: 5px; |
73 |
72 |
overflow: hidden; |
overflow: hidden; |
|
73 |
|
min-height: 400px; |
|
74 |
|
margin-left: 10px; |
|
75 |
|
line-height: 120%; |
74 |
76 |
} |
} |
75 |
77 |
|
|
76 |
78 |
#footer { |
#footer { |
|
... |
... |
th, td { |
81 |
83 |
} |
} |
82 |
84 |
|
|
83 |
85 |
.formarea { |
.formarea { |
84 |
|
margin: 5px auto; |
|
|
86 |
|
margin-top: 5px; |
85 |
87 |
background-color: #dddddd; |
background-color: #dddddd; |
86 |
88 |
padding: 5px; |
padding: 5px; |
87 |
|
width: 800px; |
|
88 |
89 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
89 |
90 |
border: 1px solid #cccccc; |
border: 1px solid #cccccc; |
90 |
91 |
line-height: 120%; |
line-height: 120%; |
|
... |
... |
label { |
178 |
179 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
179 |
180 |
font-size: 8pt; |
font-size: 8pt; |
180 |
181 |
padding: 3px 3px; |
padding: 3px 3px; |
|
182 |
|
background-color: #EEBB60; |
181 |
183 |
} |
} |
182 |
184 |
.urls ul li a { |
.urls ul li a { |
183 |
185 |
text-decoration: none; |
text-decoration: none; |
|
... |
... |
label { |
203 |
205 |
background-color: #a0d0ff; |
background-color: #a0d0ff; |
204 |
206 |
} |
} |
205 |
207 |
|
|
|
208 |
|
.hints { |
|
209 |
|
margin-top: 5px; |
|
210 |
|
background-color: #A0FFA0; |
|
211 |
|
padding: 5px; |
|
212 |
|
border-radius: 4px 4px 4px 4px; |
|
213 |
|
border: 1px solid #cccccc; |
|
214 |
|
line-height: 120%; |
|
215 |
|
} |
|
216 |
|
|
|
217 |
|
.bug { |
|
218 |
|
margin-top: 5px; |
|
219 |
|
} |
|
220 |
|
.bug_body { |
|
221 |
|
margin-left: 5px; |
|
222 |
|
background-color: #A0FFA0; |
|
223 |
|
padding: 5px; |
|
224 |
|
border-radius: 4px 4px 4px 4px; |
|
225 |
|
border: 1px solid #cccccc; |
|
226 |
|
line-height: 120%; |
|
227 |
|
} |
|
228 |
|
|
File root/themes/try2/main.css copied from file root/themes/default/main.css (similarity 65%) (mode: 100644) (index 68706a8..563608f) |
4 |
4 |
} |
} |
5 |
5 |
|
|
6 |
6 |
body { |
body { |
7 |
|
font-family: arial, helvetica, sans-serif; |
|
|
7 |
|
font-family: helvetica, sans-serif; |
8 |
8 |
font-size: 10pt; |
font-size: 10pt; |
9 |
9 |
line-height: 105%; |
line-height: 105%; |
|
10 |
|
background-color: #FFFF99; |
10 |
11 |
} |
} |
11 |
12 |
|
|
12 |
13 |
table { |
table { |
13 |
14 |
border-collapse: collapse; |
border-collapse: collapse; |
14 |
|
border: 1px solid #000; |
|
|
15 |
|
border: 1px solid #000000; |
15 |
16 |
background-color: #eeeeee; |
background-color: #eeeeee; |
16 |
|
color: #000; |
|
|
17 |
|
color: #000000; |
17 |
18 |
border-spacing: 1px; |
border-spacing: 1px; |
18 |
19 |
padding: 1px; |
padding: 1px; |
19 |
20 |
} |
} |
|
... |
... |
th, td { |
26 |
27 |
word-wrap: break-word; |
word-wrap: break-word; |
27 |
28 |
} |
} |
28 |
29 |
|
|
29 |
|
#container { background-color: #eeeeee; overflow: hidden; } |
|
|
30 |
|
code { |
|
31 |
|
font-size: 8pt; |
|
32 |
|
font-weight: bold; |
|
33 |
|
} |
|
34 |
|
|
|
35 |
|
form input, form textarea { |
|
36 |
|
border: 1px solid #CCCCCC; |
|
37 |
|
font-size: 11pt; |
|
38 |
|
padding: 5px; |
|
39 |
|
} |
|
40 |
|
form input[type="submit"] { font-weight: bold; } |
30 |
41 |
|
|
31 |
|
.white_border { border: 1px solid #eeeeee; } |
|
|
42 |
|
#container { } |
32 |
43 |
|
|
33 |
44 |
#menus { float: left; } |
#menus { float: left; } |
34 |
45 |
|
|
35 |
|
.menu { padding: 6px 0px; } |
|
|
46 |
|
.menu { padding: 4px 0px; } |
36 |
47 |
.menu ul { list-style-type: none; } |
.menu ul { list-style-type: none; } |
37 |
48 |
.menu ul li { display: inline; } |
.menu ul li { display: inline; } |
38 |
49 |
.menu ul li a { |
.menu ul li a { |
39 |
50 |
text-decoration: none; |
text-decoration: none; |
40 |
51 |
color: #666666; |
color: #666666; |
41 |
|
font-size: 10pt; |
|
|
52 |
|
font-size: 11pt; |
42 |
53 |
padding: 3px 13px; |
padding: 3px 13px; |
43 |
|
border: 1px solid #cccccc; |
|
44 |
|
border-radius: 4px 4px 4px 4px; |
|
|
54 |
|
font-weight: bold; |
45 |
55 |
} |
} |
46 |
|
.menu ul li a:hover { border: 1px solid #999999; } |
|
47 |
|
.menu ul li a.selected { color: #bbbbbb; } |
|
48 |
|
.menu ul li a.selected:hover { border: 1px solid #cccccc; } |
|
|
56 |
|
.menu ul li a:hover { color: #AAAAAA; } |
|
57 |
|
.menu ul li a.selected { color: #BBBBBB; } |
|
58 |
|
.menu ul li a.selected:hover { color: #CCCCCC; } |
49 |
59 |
|
|
50 |
60 |
.junk {} |
.junk {} |
51 |
61 |
|
|
|
... |
... |
th, td { |
64 |
74 |
#header { |
#header { |
65 |
75 |
padding: 5px; |
padding: 5px; |
66 |
76 |
overflow: hidden; |
overflow: hidden; |
|
77 |
|
border-bottom: 1px solid #CCCCCC; |
67 |
78 |
} |
} |
68 |
79 |
|
|
69 |
80 |
#main { |
#main { |
70 |
81 |
clear: both; |
clear: both; |
71 |
|
border-top: 1px solid #cccccc; |
|
72 |
|
padding: 5px; |
|
73 |
82 |
overflow: hidden; |
overflow: hidden; |
|
83 |
|
padding-top: 10px; |
|
84 |
|
padding-left: 25px; |
|
85 |
|
padding-bottom: 10px; |
|
86 |
|
padding-right: 25px; |
|
87 |
|
min-height: 400px; |
|
88 |
|
line-height: 120%; |
|
89 |
|
float: left; |
|
90 |
|
background-color: #EEEEEE; |
|
91 |
|
width: 100%; |
74 |
92 |
} |
} |
75 |
93 |
|
|
76 |
94 |
#footer { |
#footer { |
77 |
95 |
clear: both; |
clear: both; |
78 |
|
border-top: 1px solid #cccccc; |
|
|
96 |
|
border-top: 1px solid #CCCCCC; |
79 |
97 |
padding: 5px 5px; |
padding: 5px 5px; |
80 |
98 |
overflow: hidden; |
overflow: hidden; |
81 |
99 |
} |
} |
82 |
100 |
|
|
83 |
101 |
.formarea { |
.formarea { |
84 |
|
margin: 5px auto; |
|
85 |
|
background-color: #dddddd; |
|
|
102 |
|
border: 1px solid #CCCCCC; |
86 |
103 |
padding: 5px; |
padding: 5px; |
87 |
|
width: 800px; |
|
88 |
104 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
89 |
|
border: 1px solid #cccccc; |
|
90 |
|
line-height: 120%; |
|
|
105 |
|
display: inline-block; |
91 |
106 |
} |
} |
92 |
107 |
|
|
93 |
108 |
.formarea_title { |
.formarea_title { |
94 |
109 |
font-weight: bold; |
font-weight: bold; |
95 |
|
font-size: 12pt; |
|
|
110 |
|
font-size: 13pt; |
|
111 |
|
border: 0px; |
|
112 |
|
border-bottom: 2px solid #CCCCCC; |
96 |
113 |
} |
} |
97 |
114 |
|
|
98 |
115 |
#profiling { |
#profiling { |
|
... |
... |
th, td { |
111 |
128 |
|
|
112 |
129 |
.form_item_title { |
.form_item_title { |
113 |
130 |
font-weight: bold; |
font-weight: bold; |
114 |
|
margin-bottom: 5px; |
|
115 |
131 |
} |
} |
116 |
132 |
|
|
117 |
133 |
label { |
label { |
|
... |
... |
label { |
120 |
136 |
} |
} |
121 |
137 |
|
|
122 |
138 |
.rg_keys_list { |
.rg_keys_list { |
123 |
|
margin: 20px auto; |
|
124 |
|
background-color: #dddddd; |
|
125 |
|
padding: 5px; |
|
126 |
|
width: 650px; |
|
127 |
|
border-radius: 4px 4px 4px 4px; |
|
128 |
|
border: 1px solid #cccccc; |
|
|
139 |
|
margin-top: 20px; |
129 |
140 |
} |
} |
130 |
141 |
|
|
131 |
142 |
.blob_title { |
.blob_title { |
|
... |
... |
label { |
139 |
150 |
border: 1px solid #cccccc; |
border: 1px solid #cccccc; |
140 |
151 |
padding: 3px; |
padding: 3px; |
141 |
152 |
margin-top: 5px; |
margin-top: 5px; |
|
153 |
|
display: inline-block; |
142 |
154 |
} |
} |
143 |
155 |
|
|
144 |
156 |
.diff {} |
.diff {} |
|
... |
... |
label { |
147 |
159 |
|
|
148 |
160 |
.numbers { text-align: right; } |
.numbers { text-align: right; } |
149 |
161 |
|
|
150 |
|
.repo_menu {} |
|
151 |
|
.repo_menu ul li {} |
|
|
162 |
|
.submenu { |
|
163 |
|
border: 1px solid #CCCCCC; |
|
164 |
|
border-bottom: 1px solid #CCCCCC; |
|
165 |
|
background-color: #FFFF99; |
|
166 |
|
margin-bottom: 3px; |
|
167 |
|
display: inline-block; |
|
168 |
|
} |
|
169 |
|
.submenu ul li {} |
|
170 |
|
|
|
171 |
|
.repo_container { } |
152 |
172 |
|
|
153 |
173 |
.repo_header { } |
.repo_header { } |
154 |
174 |
|
|
|
... |
... |
label { |
178 |
198 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
179 |
199 |
font-size: 8pt; |
font-size: 8pt; |
180 |
200 |
padding: 3px 3px; |
padding: 3px 3px; |
|
201 |
|
background-color: #E5E5FF; |
181 |
202 |
} |
} |
182 |
203 |
.urls ul li a { |
.urls ul li a { |
183 |
204 |
text-decoration: none; |
text-decoration: none; |
|
... |
... |
label { |
203 |
224 |
background-color: #a0d0ff; |
background-color: #a0d0ff; |
204 |
225 |
} |
} |
205 |
226 |
|
|
|
227 |
|
.hints { |
|
228 |
|
margin-top: 5px; |
|
229 |
|
background-color: #A0FFA0; |
|
230 |
|
padding: 5px; |
|
231 |
|
border-radius: 4px 4px 4px 4px; |
|
232 |
|
border: 1px solid #cccccc; |
|
233 |
|
line-height: 120%; |
|
234 |
|
font-size: 9pt; |
|
235 |
|
display: inline-block; |
|
236 |
|
} |
|
237 |
|
.hints ul { list-style-type: none; } |
|
238 |
|
.hints ul li { } |
|
239 |
|
.hints ul li a { } |
|
240 |
|
|
|
241 |
|
|
|
242 |
|
.bug { |
|
243 |
|
margin-top: 5px; |
|
244 |
|
} |
|
245 |
|
.bug_body { |
|
246 |
|
margin-left: 5px; |
|
247 |
|
background-color: #A0FFA0; |
|
248 |
|
padding: 5px; |
|
249 |
|
border-radius: 4px 4px 4px 4px; |
|
250 |
|
border: 1px solid #cccccc; |
|
251 |
|
line-height: 120%; |
|
252 |
|
display: inline-block; |
|
253 |
|
} |
|
254 |
|
|
File root/themes/try3/main.css copied from file root/themes/default/main.css (similarity 64%) (mode: 100644) (index 68706a8..dfd903b) |
4 |
4 |
} |
} |
5 |
5 |
|
|
6 |
6 |
body { |
body { |
7 |
|
font-family: arial, helvetica, sans-serif; |
|
|
7 |
|
font-family: helvetica, sans-serif; |
8 |
8 |
font-size: 10pt; |
font-size: 10pt; |
9 |
9 |
line-height: 105%; |
line-height: 105%; |
|
10 |
|
background-color: #FFFF99; |
10 |
11 |
} |
} |
11 |
12 |
|
|
12 |
13 |
table { |
table { |
13 |
14 |
border-collapse: collapse; |
border-collapse: collapse; |
14 |
|
border: 1px solid #000; |
|
|
15 |
|
border: 1px solid #000000; |
15 |
16 |
background-color: #eeeeee; |
background-color: #eeeeee; |
16 |
|
color: #000; |
|
|
17 |
|
color: #000000; |
17 |
18 |
border-spacing: 1px; |
border-spacing: 1px; |
18 |
19 |
padding: 1px; |
padding: 1px; |
19 |
20 |
} |
} |
|
... |
... |
th, td { |
26 |
27 |
word-wrap: break-word; |
word-wrap: break-word; |
27 |
28 |
} |
} |
28 |
29 |
|
|
29 |
|
#container { background-color: #eeeeee; overflow: hidden; } |
|
|
30 |
|
code { |
|
31 |
|
font-size: 8pt; |
|
32 |
|
font-weight: bold; |
|
33 |
|
} |
|
34 |
|
|
|
35 |
|
form input, form textarea { |
|
36 |
|
border: 1px solid #CCCCCC; |
|
37 |
|
font-size: 11pt; |
|
38 |
|
padding: 5px; |
|
39 |
|
} |
|
40 |
|
form input[type="submit"] { font-weight: bold; } |
30 |
41 |
|
|
31 |
|
.white_border { border: 1px solid #eeeeee; } |
|
|
42 |
|
#container { } |
32 |
43 |
|
|
33 |
|
#menus { float: left; } |
|
|
44 |
|
#menus { } |
34 |
45 |
|
|
35 |
|
.menu { padding: 6px 0px; } |
|
|
46 |
|
.menu { padding: 4px 0px; } |
36 |
47 |
.menu ul { list-style-type: none; } |
.menu ul { list-style-type: none; } |
37 |
48 |
.menu ul li { display: inline; } |
.menu ul li { display: inline; } |
38 |
49 |
.menu ul li a { |
.menu ul li a { |
39 |
50 |
text-decoration: none; |
text-decoration: none; |
40 |
51 |
color: #666666; |
color: #666666; |
41 |
|
font-size: 10pt; |
|
|
52 |
|
font-size: 11pt; |
42 |
53 |
padding: 3px 13px; |
padding: 3px 13px; |
43 |
|
border: 1px solid #cccccc; |
|
44 |
|
border-radius: 4px 4px 4px 4px; |
|
|
54 |
|
font-weight: bold; |
45 |
55 |
} |
} |
46 |
|
.menu ul li a:hover { border: 1px solid #999999; } |
|
47 |
|
.menu ul li a.selected { color: #bbbbbb; } |
|
48 |
|
.menu ul li a.selected:hover { border: 1px solid #cccccc; } |
|
|
56 |
|
.menu ul li a:hover { color: #AAAAAA; } |
|
57 |
|
.menu ul li a.selected { color: #BBBBBB; } |
|
58 |
|
.menu ul li a.selected:hover { color: #CCCCCC; } |
49 |
59 |
|
|
50 |
60 |
.junk {} |
.junk {} |
51 |
61 |
|
|
|
... |
... |
th, td { |
64 |
74 |
#header { |
#header { |
65 |
75 |
padding: 5px; |
padding: 5px; |
66 |
76 |
overflow: hidden; |
overflow: hidden; |
|
77 |
|
border-bottom: 1px solid #CCCCCC; |
67 |
78 |
} |
} |
68 |
79 |
|
|
69 |
80 |
#main { |
#main { |
70 |
|
clear: both; |
|
71 |
|
border-top: 1px solid #cccccc; |
|
72 |
|
padding: 5px; |
|
73 |
|
overflow: hidden; |
|
|
81 |
|
padding-top: 10px; |
|
82 |
|
padding-left: 25px; |
|
83 |
|
padding-bottom: 10px; |
|
84 |
|
padding-right: 25px; |
|
85 |
|
min-height: 400px; |
|
86 |
|
line-height: 120%; |
|
87 |
|
background-color: #EEEEEE; |
|
88 |
|
width: 100%; |
74 |
89 |
} |
} |
75 |
90 |
|
|
76 |
91 |
#footer { |
#footer { |
77 |
92 |
clear: both; |
clear: both; |
78 |
|
border-top: 1px solid #cccccc; |
|
|
93 |
|
border-top: 1px solid #CCCCCC; |
79 |
94 |
padding: 5px 5px; |
padding: 5px 5px; |
80 |
95 |
overflow: hidden; |
overflow: hidden; |
81 |
96 |
} |
} |
82 |
97 |
|
|
83 |
98 |
.formarea { |
.formarea { |
84 |
|
margin: 5px auto; |
|
85 |
|
background-color: #dddddd; |
|
|
99 |
|
border: 1px solid #CCCCCC; |
86 |
100 |
padding: 5px; |
padding: 5px; |
87 |
|
width: 800px; |
|
88 |
101 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
89 |
|
border: 1px solid #cccccc; |
|
90 |
|
line-height: 120%; |
|
|
102 |
|
display: table; |
91 |
103 |
} |
} |
92 |
104 |
|
|
93 |
105 |
.formarea_title { |
.formarea_title { |
94 |
106 |
font-weight: bold; |
font-weight: bold; |
95 |
|
font-size: 12pt; |
|
|
107 |
|
font-size: 13pt; |
|
108 |
|
border: 0px; |
|
109 |
|
border-bottom: 2px solid #CCCCCC; |
96 |
110 |
} |
} |
97 |
111 |
|
|
98 |
112 |
#profiling { |
#profiling { |
|
... |
... |
th, td { |
111 |
125 |
|
|
112 |
126 |
.form_item_title { |
.form_item_title { |
113 |
127 |
font-weight: bold; |
font-weight: bold; |
114 |
|
margin-bottom: 5px; |
|
115 |
128 |
} |
} |
116 |
129 |
|
|
117 |
130 |
label { |
label { |
|
... |
... |
label { |
120 |
133 |
} |
} |
121 |
134 |
|
|
122 |
135 |
.rg_keys_list { |
.rg_keys_list { |
123 |
|
margin: 20px auto; |
|
124 |
|
background-color: #dddddd; |
|
125 |
|
padding: 5px; |
|
126 |
|
width: 650px; |
|
127 |
|
border-radius: 4px 4px 4px 4px; |
|
128 |
|
border: 1px solid #cccccc; |
|
|
136 |
|
margin-top: 20px; |
129 |
137 |
} |
} |
130 |
138 |
|
|
131 |
139 |
.blob_title { |
.blob_title { |
|
... |
... |
label { |
139 |
147 |
border: 1px solid #cccccc; |
border: 1px solid #cccccc; |
140 |
148 |
padding: 3px; |
padding: 3px; |
141 |
149 |
margin-top: 5px; |
margin-top: 5px; |
|
150 |
|
display: table; |
142 |
151 |
} |
} |
143 |
152 |
|
|
144 |
153 |
.diff {} |
.diff {} |
|
... |
... |
label { |
147 |
156 |
|
|
148 |
157 |
.numbers { text-align: right; } |
.numbers { text-align: right; } |
149 |
158 |
|
|
150 |
|
.repo_menu {} |
|
151 |
|
.repo_menu ul li {} |
|
|
159 |
|
.submenu { |
|
160 |
|
border: 1px solid #CCCCCC; |
|
161 |
|
border-bottom: 1px solid #CCCCCC; |
|
162 |
|
background-color: #FFFF99; |
|
163 |
|
margin-bottom: 3px; |
|
164 |
|
display: table; |
|
165 |
|
} |
|
166 |
|
.submenu ul li {} |
|
167 |
|
|
|
168 |
|
.repo_container { } |
152 |
169 |
|
|
153 |
170 |
.repo_header { } |
.repo_header { } |
154 |
171 |
|
|
|
... |
... |
label { |
168 |
185 |
margin: 3px 0px; |
margin: 3px 0px; |
169 |
186 |
} |
} |
170 |
187 |
|
|
171 |
|
.repo_body { display: block; } |
|
|
188 |
|
.repo_body { display: table; } |
172 |
189 |
|
|
173 |
190 |
.urls { padding: 3px 0px; margin: 5px 0px; } |
.urls { padding: 3px 0px; margin: 5px 0px; } |
174 |
191 |
.urls ul { list-style-type: none; } |
.urls ul { list-style-type: none; } |
|
... |
... |
label { |
178 |
195 |
border-radius: 4px 4px 4px 4px; |
border-radius: 4px 4px 4px 4px; |
179 |
196 |
font-size: 8pt; |
font-size: 8pt; |
180 |
197 |
padding: 3px 3px; |
padding: 3px 3px; |
|
198 |
|
background-color: #E5E5FF; |
181 |
199 |
} |
} |
182 |
200 |
.urls ul li a { |
.urls ul li a { |
183 |
201 |
text-decoration: none; |
text-decoration: none; |
|
... |
... |
label { |
203 |
221 |
background-color: #a0d0ff; |
background-color: #a0d0ff; |
204 |
222 |
} |
} |
205 |
223 |
|
|
|
224 |
|
.hints { |
|
225 |
|
margin-top: 5px; |
|
226 |
|
background-color: #A0FFA0; |
|
227 |
|
padding: 5px; |
|
228 |
|
border-radius: 4px 4px 4px 4px; |
|
229 |
|
border: 1px solid #cccccc; |
|
230 |
|
line-height: 120%; |
|
231 |
|
font-size: 9pt; |
|
232 |
|
display: table; |
|
233 |
|
} |
|
234 |
|
.hints ul { list-style-type: none; } |
|
235 |
|
.hints ul li { } |
|
236 |
|
.hints ul li a { } |
|
237 |
|
|
|
238 |
|
|
|
239 |
|
.bug { |
|
240 |
|
margin-top: 5px; |
|
241 |
|
} |
|
242 |
|
.bug_body { |
|
243 |
|
margin-left: 5px; |
|
244 |
|
background-color: #A0FFA0; |
|
245 |
|
padding: 5px; |
|
246 |
|
border-radius: 4px 4px 4px 4px; |
|
247 |
|
border: 1px solid #cccccc; |
|
248 |
|
line-height: 120%; |
|
249 |
|
display: table; |
|
250 |
|
} |
|
251 |
|
|
File scripts/q.php changed (mode: 100644) (index 021ff62..92e7925) |
... |
... |
$_s = microtime(TRUE); |
10 |
10 |
require_once("/etc/rocketgit/config.php"); |
require_once("/etc/rocketgit/config.php"); |
11 |
11 |
|
|
12 |
12 |
$INC = dirname(__FILE__) . "/../inc"; |
$INC = dirname(__FILE__) . "/../inc"; |
|
13 |
|
require_once($INC . "/init.inc.php"); |
13 |
14 |
require_once($INC . "/log.inc.php"); |
require_once($INC . "/log.inc.php"); |
14 |
15 |
require_once($INC . "/sql.inc.php"); |
require_once($INC . "/sql.inc.php"); |
15 |
16 |
require_once($INC . "/struct.inc.php"); |
require_once($INC . "/struct.inc.php"); |
|
... |
... |
while (TRUE) { |
84 |
85 |
if ($row['master'] == 0) { |
if ($row['master'] == 0) { |
85 |
86 |
$r = rg_git_init($dst); |
$r = rg_git_init($dst); |
86 |
87 |
if ($r === FALSE) { |
if ($r === FALSE) { |
87 |
|
rg_log("\tCannot init master!"); |
|
|
88 |
|
rg_log("\tCannot init master (" . rg_git_error() . ")!"); |
88 |
89 |
continue; |
continue; |
89 |
90 |
} |
} |
90 |
91 |
|
|
|
... |
... |
while (TRUE) { |
93 |
94 |
$rr = array("repo_id" => $row['master']); |
$rr = array("repo_id" => $row['master']); |
94 |
95 |
$mi = rg_repo_info($db, $rr); |
$mi = rg_repo_info($db, $rr); |
95 |
96 |
if ($mi['exists'] != 1) { |
if ($mi['exists'] != 1) { |
96 |
|
rg_log("\tCannot find master!"); |
|
|
97 |
|
rg_log("\tCannot find master (" . rg_repo_error() . ")!"); |
97 |
98 |
continue; |
continue; |
98 |
99 |
} |
} |
99 |
100 |
|
|
100 |
101 |
$ui = rg_user_info($db, $mi['uid'], "", ""); |
$ui = rg_user_info($db, $mi['uid'], "", ""); |
101 |
102 |
if ($ui['ok'] != 1) { |
if ($ui['ok'] != 1) { |
102 |
103 |
rg_log("\tCannot lookup uid " |
rg_log("\tCannot lookup uid " |
103 |
|
. $mi['uid'] . " (" . rg_user_info() . ")!"); |
|
|
104 |
|
. $mi['uid'] . " (" . rg_user_error() . ")!"); |
104 |
105 |
continue; |
continue; |
105 |
106 |
} |
} |
106 |
107 |
|
|
|
... |
... |
while (TRUE) { |
111 |
112 |
$src = rg_repo_name2base($rr) . $mi['name'] . ".git"; |
$src = rg_repo_name2base($rr) . $mi['name'] . ".git"; |
112 |
113 |
$r = rg_git_clone($src, $dst); |
$r = rg_git_clone($src, $dst); |
113 |
114 |
if ($r === FALSE) { |
if ($r === FALSE) { |
114 |
|
rg_log("\tCould not create repo!"); |
|
|
115 |
|
rg_log("\tCould not create repo (" . rg_git_error() . ")!"); |
115 |
116 |
continue; |
continue; |
116 |
117 |
} |
} |
117 |
118 |
|
|