File TODO changed (mode: 100644) (index 7837153..adc2088) |
11 |
11 |
[ ] 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. |
12 |
12 |
[ ] After creating the account, keep the user logged in and allow login |
[ ] After creating the account, keep the user logged in and allow login |
13 |
13 |
even if is not confirmed (option in config). |
even if is not confirmed (option in config). |
|
14 |
|
[ ] Fix the headers (+dkim) to avoid spam. |
|
15 |
|
[ ] logrotate is not working. |
|
16 |
|
[ ] |
14 |
17 |
|
|
15 |
18 |
|
|
16 |
19 |
== Medium == |
== Medium == |
|
20 |
|
[ ] Happy birthday for projects/users/etc. |
17 |
21 |
[ ] Check if if we remove rocketgit, the repos stay! |
[ ] Check if if we remove rocketgit, the repos stay! |
18 |
22 |
[ ] Bug rights: add note, anonymous add note, add label, add global search. |
[ ] Bug rights: add note, anonymous add note, add label, add global search. |
19 |
23 |
[ ] Allow user to specify if is on windows/linux/etc. to be able to give |
[ ] Allow user to specify if is on windows/linux/etc. to be able to give |
File hooks/update changed (mode: 100755) (index 41893c9..515c3d6) |
12 |
12 |
error_reporting(E_ALL); |
error_reporting(E_ALL); |
13 |
13 |
ini_set("track_errors", "On"); |
ini_set("track_errors", "On"); |
14 |
14 |
|
|
|
15 |
|
$_start = microtime(TRUE); |
|
16 |
|
|
15 |
17 |
require_once("/etc/rocketgit/config.php"); |
require_once("/etc/rocketgit/config.php"); |
16 |
18 |
|
|
17 |
19 |
$INC = $rg_scripts . "/inc"; |
$INC = $rg_scripts . "/inc"; |
|
... |
... |
$a['rights'] = getenv("ROCKETGIT_REPO_RIGHTS"); |
33 |
35 |
$a['repo_id'] = getenv("ROCKETGIT_REPO_ID"); |
$a['repo_id'] = getenv("ROCKETGIT_REPO_ID"); |
34 |
36 |
$a['ip'] = getenv("ROCKETGIT_IP"); |
$a['ip'] = getenv("ROCKETGIT_IP"); |
35 |
37 |
$a['namespace'] = getenv("GIT_NAMESPACE"); |
$a['namespace'] = getenv("GIT_NAMESPACE"); |
|
38 |
|
$a['repo_path'] = getenv("ROCKETGIT_REPO_PATH"); |
36 |
39 |
|
|
37 |
40 |
rg_log("Start " . rg_array2string($a)); |
rg_log("Start " . rg_array2string($a)); |
38 |
41 |
rg_log("_SERVER: " . rg_array2string($_SERVER)); |
rg_log("_SERVER: " . rg_array2string($_SERVER)); |
|
... |
... |
if (strncmp($a['refname'], "refs/tags/", 10) == 0) { |
66 |
69 |
rg_git_fatal("Unknown refname type provided [" . $a['refname'] . "]"); |
rg_git_fatal("Unknown refname type provided [" . $a['refname'] . "]"); |
67 |
70 |
} |
} |
68 |
71 |
|
|
69 |
|
@file_put_contents($repo_path . "/rg/hook-update", |
|
70 |
|
"repo: " . $repo . " ($repo_path)" |
|
|
72 |
|
@file_put_contents($a['repo_path'] . "/rg/hook-update", |
|
73 |
|
"repo: " . $a['repo_path'] |
71 |
74 |
. "\nat: " . sprintf("%u", $_start) |
. "\nat: " . sprintf("%u", $_start) |
72 |
|
. "\nuid: " . $uid |
|
73 |
|
. "\npara: $refname $old_rev $new_rev" |
|
|
75 |
|
. "\nuid: " . $a['uid'] |
|
76 |
|
. "\npara: " . $a['refname'] . " " . $a['old_rev'] . " " . $a['new_rev'] |
74 |
77 |
. "\nProfiling:\n" . rg_prof_text() |
. "\nProfiling:\n" . rg_prof_text() |
75 |
78 |
. "\n_SERVER: " . rg_array2string($_SERVER)); |
. "\n_SERVER: " . rg_array2string($_SERVER)); |
76 |
79 |
|
|
File inc/util.inc.php changed (mode: 100644) (index 7b95106..9bdf0f9) |
... |
... |
function rg_replace_conditionals_block($block, &$stack) |
403 |
403 |
//rg_log("cond is " . ($cond ? "TRUE" : "FALSE")); |
//rg_log("cond is " . ($cond ? "TRUE" : "FALSE")); |
404 |
404 |
|
|
405 |
405 |
// First, try to match a start of 'if' |
// First, try to match a start of 'if' |
406 |
|
$match1 = "@@if\s*\((.*?)\s*==\s*(.*?)\)\s*?{{"; |
|
|
406 |
|
$match1 = "@@if\s*\((.*?)\)\s*?{{"; |
407 |
407 |
$match2 = "{{"; |
$match2 = "{{"; |
408 |
408 |
$match3 = "}}"; |
$match3 = "}}"; |
409 |
409 |
$search = $match1 . '|' . $match2 . '|' . $match3; |
$search = $match1 . '|' . $match2 . '|' . $match3; |
|
... |
... |
function rg_replace_conditionals_block($block, &$stack) |
412 |
412 |
if ($r === FALSE) |
if ($r === FALSE) |
413 |
413 |
return FALSE; |
return FALSE; |
414 |
414 |
if ($r === 1) { |
if ($r === 1) { |
415 |
|
//rg_log("matches: " . rg_array2string($matches)); |
|
|
415 |
|
rg_log("matches: " . rg_array2string($matches)); |
416 |
416 |
|
|
417 |
417 |
$ret = ""; |
$ret = ""; |
418 |
418 |
if ($cond) |
if ($cond) |
419 |
419 |
$ret = $matches[1]; |
$ret = $matches[1]; |
420 |
420 |
|
|
421 |
|
$rest = $matches[5]; |
|
|
421 |
|
$rest = $matches[4]; |
422 |
422 |
if (strcmp($matches[2], "}}") == 0) { |
if (strcmp($matches[2], "}}") == 0) { |
423 |
423 |
// We pop from stack only at }} and not at {{ |
// We pop from stack only at }} and not at {{ |
424 |
424 |
//rg_log("}}: Pop the stack!"); |
//rg_log("}}: Pop the stack!"); |
|
... |
... |
function rg_replace_conditionals_block($block, &$stack) |
426 |
426 |
} else if (strcmp($matches[2], "{{") == 0) { |
} else if (strcmp($matches[2], "{{") == 0) { |
427 |
427 |
//rg_log("{{"); |
//rg_log("{{"); |
428 |
428 |
} else { |
} else { |
429 |
|
$left = trim($matches[3]); |
|
430 |
|
$right = trim($matches[4]); |
|
431 |
|
//rg_log("if left=[$left] right=[$right]"); |
|
432 |
|
$new_cond = strcmp($left, $right) == 0 ? TRUE : FALSE; |
|
|
429 |
|
rg_log("cond=" . $matches[3]); |
|
430 |
|
if (empty($matches[3])) { |
|
431 |
|
$new_cond = FALSE; |
|
432 |
|
} else { |
|
433 |
|
$r = preg_match('/^(.+?)(\s*(==|!=)?\s*(.*?))?$/su', |
|
434 |
|
$matches[3], $matches2); |
|
435 |
|
if ($r === FALSE) { |
|
436 |
|
rg_internal_error("Invalid condition!"); |
|
437 |
|
return FALSE; |
|
438 |
|
} |
|
439 |
|
rg_log("matches2: " . rg_array2string($matches2)); |
|
440 |
|
$left = trim($matches2[1]); |
|
441 |
|
$op = trim($matches2[3]); |
|
442 |
|
$right = trim($matches2[4]); |
|
443 |
|
rg_log("if left=[$left] op=[$op] right=[$right]"); |
|
444 |
|
if (empty($op)) { |
|
445 |
|
$new_cond = empty($left) ? FALSE : TRUE; |
|
446 |
|
} else if (strcmp($op, "==") == 0) { |
|
447 |
|
$new_cond = strcmp($left, $right) == 0 ? TRUE : FALSE; |
|
448 |
|
} else if (strcmp($op, "!=") == 0) { |
|
449 |
|
$new_cond = strcmp($left, $right) == 0 ? FALSE : TRUE; |
|
450 |
|
} else { |
|
451 |
|
rg_internal_error("Invalid operation!"); |
|
452 |
|
return FALSE; |
|
453 |
|
} |
|
454 |
|
} |
433 |
455 |
$not_new_cond = $new_cond ? FALSE : TRUE; |
$not_new_cond = $new_cond ? FALSE : TRUE; |
434 |
456 |
|
|
435 |
457 |
// We have to respect the outer block condition |
// We have to respect the outer block condition |
File root/themes/default/main.css changed (mode: 100644) (index 7e51383..599bd72) |
... |
... |
form input[type="submit"] { |
42 |
42 |
font-weight: bold; |
font-weight: bold; |
43 |
43 |
font-size: 11pt; |
font-size: 11pt; |
44 |
44 |
padding: 2px 6px 2px 6px; |
padding: 2px 6px 2px 6px; |
45 |
|
cursor: pointer; cursor: hand; |
|
|
45 |
|
cursor: pointer; |
46 |
46 |
border: 2px solid #DDDDDD; |
border: 2px solid #DDDDDD; |
47 |
47 |
background-image: -moz-linear-gradient(top, #EEEEEE, #CCCCCC); |
background-image: -moz-linear-gradient(top, #EEEEEE, #CCCCCC); |
48 |
48 |
} |
} |
|
... |
... |
form input[type="submit"] { |
53 |
53 |
display: inline-block; |
display: inline-block; |
54 |
54 |
} |
} |
55 |
55 |
|
|
56 |
|
.logo { padding: 3px 0; } |
|
|
56 |
|
.logo { padding: 3px 0px; } |
57 |
57 |
.logo a { |
.logo a { |
58 |
58 |
font-size: 14pt; |
font-size: 14pt; |
59 |
59 |
text-decoration: none; |
text-decoration: none; |
60 |
60 |
color: red; |
color: red; |
61 |
61 |
} |
} |
62 |
62 |
|
|
63 |
|
.user { padding 3px 0; } |
|
|
63 |
|
.user { padding: 3px 0px; } |
64 |
64 |
|
|
65 |
65 |
#menus { |
#menus { |
66 |
66 |
display: inline-block; |
display: inline-block; |
|
... |
... |
form input[type="submit"] { |
108 |
108 |
} |
} |
109 |
109 |
|
|
110 |
110 |
#main { |
#main { |
111 |
|
padding-top: 10px; |
|
112 |
|
padding-left: 25px; |
|
113 |
|
padding-right: 25px; |
|
114 |
|
padding-bottom: 10px; |
|
|
111 |
|
padding: 10px 15px; |
115 |
112 |
line-height: 120%; |
line-height: 120%; |
116 |
113 |
} |
} |
117 |
114 |
|
|
File root/themes/default/main.html changed (mode: 100644) (index d645f9c..721ac54) |
|
1 |
|
<br /> |
1 |
2 |
<h1>Welcome to RocketGit!</h1> |
<h1>Welcome to RocketGit!</h1> |
2 |
3 |
<br /> |
<br /> |
3 |
4 |
|
|
4 |
5 |
Our target is to be the best FLOSS software for managing Git projects. |
Our target is to be the best FLOSS software for managing Git projects. |
5 |
6 |
With your help, we will do it. Thanks!<br /> |
With your help, we will do it. Thanks!<br /> |
6 |
7 |
<br /> |
<br /> |
7 |
|
You can create an account <a href="/op/create_account">here<a/>.<br /> |
|
|
8 |
|
You can create an account <a href="/op/create_account">here</a>.<br /> |
File scripts/remote.php changed (mode: 100644) (index 3bcac66..df1f5a6) |
... |
... |
rg_log_set_file($rg_log_dir . "/remote.log"); |
21 |
21 |
|
|
22 |
22 |
function fatal($str) |
function fatal($str) |
23 |
23 |
{ |
{ |
24 |
|
global $php_errormsg; |
|
25 |
24 |
global $access_type; |
global $access_type; |
26 |
25 |
|
|
27 |
26 |
rg_log("Sending error: " . $str); |
rg_log("Sending error: " . $str); |
28 |
|
rg_log("php_errormsg: " . $php_errormsg); |
|
29 |
27 |
$str2 = "RocketGit: FATAL ERROR: " . $str . "\n"; |
$str2 = "RocketGit: FATAL ERROR: " . $str . "\n"; |
30 |
28 |
if ($access_type == 2) { // git |
if ($access_type == 2) { // git |
31 |
29 |
$str3 = "\n" . $str2; |
$str3 = "\n" . $str2; |
|
... |
... |
if (isset($_SERVER['SSH_CONNECTION'])) { |
89 |
87 |
fclose($f); |
fclose($f); |
90 |
88 |
$line_len = strlen($line); |
$line_len = strlen($line); |
91 |
89 |
|
|
|
90 |
|
rg_log("line=[$line]"); |
92 |
91 |
if ($line_len < 4) |
if ($line_len < 4) |
93 |
92 |
fatal("\tLine is too short!"); |
fatal("\tLine is too short!"); |
94 |
93 |
$len = @hexdec(substr($line, 0, 4)); |
$len = @hexdec(substr($line, 0, 4)); |
|
... |
... |
if (isset($_SERVER['SSH_CONNECTION'])) { |
99 |
98 |
$line = substr($line, 4); |
$line = substr($line, 4); |
100 |
99 |
$v = explode("\0", $line); |
$v = explode("\0", $line); |
101 |
100 |
$cmd_repo = trim($v[0]); |
$cmd_repo = trim($v[0]); |
102 |
|
$host = trim(substr($v[1], 5)); |
|
|
101 |
|
$host = isset($v[1]) ? trim(substr($v[1], 5)) : ""; |
103 |
102 |
|
|
104 |
103 |
$ip = getenv("REMOTE_HOST"); |
$ip = getenv("REMOTE_HOST"); |
105 |
104 |
} |
} |
File tests/util.php changed (mode: 100644) (index e78f681..972ec87) |
... |
... |
if (strcmp($r, $e) != 0) { |
172 |
172 |
exit(1); |
exit(1); |
173 |
173 |
} |
} |
174 |
174 |
|
|
|
175 |
|
rg_log("test rg_template with conditional formating (empty)"); |
|
176 |
|
$data = array(); |
|
177 |
|
$r = rg_template("t3/c6", $data); |
|
178 |
|
$r = preg_replace('/\s/', '', $r); |
|
179 |
|
$e = "A"; |
|
180 |
|
if (strcmp($r, $e) != 0) { |
|
181 |
|
echo "util.php: rg_template with conditionals is not working (r=$r e=$e)!\n"; |
|
182 |
|
exit(1); |
|
183 |
|
} |
|
184 |
|
|
|
185 |
|
rg_log("test rg_template with conditional formating (!empty)"); |
|
186 |
|
$data = array("AAA" => ""); |
|
187 |
|
$r = rg_template("t3/c7", $data); |
|
188 |
|
$r = preg_replace('/\s/', '', $r); |
|
189 |
|
$e = "B"; |
|
190 |
|
if (strcmp($r, $e) != 0) { |
|
191 |
|
echo "util.php: rg_template with conditionals is not working (r=$r e=$e)!\n"; |
|
192 |
|
exit(1); |
|
193 |
|
} |
|
194 |
|
|
175 |
195 |
// test rg_copy_tree |
// test rg_copy_tree |
176 |
196 |
$r = rg_copy_tree("tree1", "tree1.copy", 0755); |
$r = rg_copy_tree("tree1", "tree1.copy", 0755); |
177 |
197 |
if ($r !== TRUE) { |
if ($r !== TRUE) { |