List of commits:
Subject Hash Author Date (UTC)
Do not create a namespace anymore if the user has the rights to push 13f8037ba76b57ae919758609c523dcbb6588745 Catalin(ux) M. BOIE 2017-03-19 19:44:07
Docker improvements c3c0f8ff3f5a2f9acfeea2e9bbf271cfeae4a8bd Catalin(ux) M. BOIE 2017-03-19 19:43:25
Small changes regarding more debugging in several places 03407e5f7562ac997612c56fd20fe067162ea8de Catalin(ux) M. BOIE 2017-03-19 19:42:58
Some improvements for comparison e3a06443fba2c22009f0bde4ea9c3f201a9803cb Catalin(ux) M. BOIE 2017-03-19 19:41:53
Functional tests improvements 6b82e5a1eaf800a15e42840bc9c889e32a7532f0 Catalin(ux) M. BOIE 2017-03-19 19:40:21
Do not report security violations generated by the functional tests 6028674aa0153d4bc1c46999516f87a6019df6d2 Catalin(ux) M. BOIE 2017-03-19 19:38:23
Admin init form: pass next to user to be able to be cached by browsers c3d9974e92a03a3ec4d093188842330bb7a0cad0 Catalin(ux) M. BOIE 2017-03-17 23:41:10
SELinux: Allow php-fpm to create log files 94962a7b15e91acfa609663185ceab365a89ac98 Catalin(ux) M. BOIE 2017-03-17 23:39:01
Allow anonymous push when using git:// or ssh:// 46d947874f12b7ac7f1ac3fa552f703c498082b2 Catalin(ux) M. BOIE 2017-03-02 22:17:48
tests: now we keep the state c75b10325c24e32b699f22a13c9374e80fe45a2b Catalin(ux) M. BOIE 2017-03-02 22:05:43
No need anymore for usr/lib 58a51962e9025457419fac5051d0840732aeff6c Catalin(ux) M. BOIE 2017-03-02 21:34:11
If nothing found in a folder, xargs will fail 9ea8a34050bc2ce4c53e942834f34eaffa5d4f06 Catalin(ux) M. BOIE 2017-03-02 19:50:55
Bump version to 0.66 4f63811dd434780c4342c087757b6003a9c20c9e Catalin(ux) M. BOIE 2017-03-02 17:54:40
Minor change on how do we call fgetcsv 175715a4739e8a33cbd939d847eed9d3d24e24be Catalin(ux) M. BOIE 2017-03-02 17:53:57
Cosmetic changes for comparison 780b0e99bf591c5081eed9ca9cbe2623d3cab22c Catalin(ux) M. BOIE 2017-03-02 17:53:29
Added a custom csv line parsing (partial) for when the program will be re-written in C 746560420021d148c58578af77c9f7bb05cc5918 Catalin(ux) M. BOIE 2017-03-02 17:53:05
Do not test doit != 1 because it can be a bigger number (thanks w3af!) 214dfb3cd1c7e5a3b5a0353a4c9f9b63cb6545f2 Catalin(ux) M. BOIE 2017-03-02 17:51:56
TODO add/delete 1c8ffca4d65be53acdfe21d4c3c0888707f5d10b Catalin(ux) M. BOIE 2017-03-02 17:50:28
Disable TRACE command in Apache sample conf 3c59e1ef1c87689940eb2bc0c73895101815471b Catalin(ux) M. BOIE 2017-03-02 17:47:13
Return error if a mr cannot be found 3eea0ed2eb3b7a103dac191b7047268baa95d20f Catalin(ux) M. BOIE 2017-03-02 17:40:46
Commit 13f8037ba76b57ae919758609c523dcbb6588745 - Do not create a namespace anymore if the user has the rights to push
Author: Catalin(ux) M. BOIE
Author date (UTC): 2017-03-19 19:44
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2017-03-19 19:44
Parent(s): c3c0f8ff3f5a2f9acfeea2e9bbf271cfeae4a8bd
Signing key:
Tree: fd64f26851a2f702496d6fbf25d6494048ba42e2
File Lines added Lines deleted
inc/git.inc.php 15 32
inc/repo.inc.php 4 5
inc/user.inc.php 1 3
scripts/remote.php 1 1
File inc/git.inc.php changed (mode: 100644) (index 0adca5e..2fb12de)
... ... function rg_git_update_branch($db, $a)
1474 1474 } else { } else {
1475 1475 rg_log("DEBUG: We are allowed to push."); rg_log("DEBUG: We are allowed to push.");
1476 1476
1477 // If we do not have a namespace, we let git to update the ref.
1478 // Not clear when we do not have a namespace.
1479 if (!empty($a['namespace'])) {
1480 // Updating main ref (not a namespace)
1481 $reason = $a['ui']['username']
1482 . ' pushed ref ' . $a['refname'];
1483 $r = rg_git_update_ref($a['repo_path'], $a['refname'],
1484 $a['old_rev'], $a['new_rev'], $reason);
1485 if ($r !== TRUE) {
1486 rg_git_fatal($a['refname']
1487 . "\nCannot update ref ("
1488 . rg_git_error() . ")");
1489 }
1490
1491 $ev = $a;
1492 $ev['category'] = 3007;
1493 $ev['prio'] = 50;
1494 $ev['ri'] = array(
1495 'repo_id' => $a['repo_id'],
1496 'name' => $a['repo_name'],
1497 'url' => rg_base_url() . $a['login_url']
1498 . '/' . $a['repo_name'],
1499 'clone_url' => $a['repo_clone_url_http']
1500 );
1501 unset($ev['repo_id']); unset($ev['repo_name']);
1502 $r = rg_event_add($db, $ev);
1503 if ($r !== TRUE)
1504 rg_git_fatal($a['refname'] . ": " . rg_event_error());
1505 rg_event_signal_daemon('', 0);
1506
1507 // TODO: Here, the namespace ref is not yet updated
1508 }
1477 $ev = $a;
1478 $ev['category'] = 3007;
1479 $ev['prio'] = 50;
1480 $ev['ri'] = array(
1481 'repo_id' => $a['repo_id'],
1482 'name' => $a['repo_name'],
1483 'url' => rg_base_url() . $a['login_url']
1484 . '/' . $a['repo_name'],
1485 'clone_url' => $a['repo_clone_url_http']
1486 );
1487 unset($ev['repo_id']); unset($ev['repo_name']);
1488 $r = rg_event_add($db, $ev);
1489 if ($r !== TRUE)
1490 rg_git_fatal($a['refname'] . ": " . rg_event_error());
1491 rg_event_signal_daemon('', 0);
1509 1492
1510 1493 if (strcmp($a['old_rev'], $rg_git_zero) == 0) { if (strcmp($a['old_rev'], $rg_git_zero) == 0) {
1511 1494 $history['history_category'] = REPO_CAT_GIT_BRANCH_CREATE; $history['history_category'] = REPO_CAT_GIT_BRANCH_CREATE;
File inc/repo.inc.php changed (mode: 100644) (index 9871f9e..0783004)
... ... function rg_repo_api($db, $a)
2406 2406 * @host - the host name accessed - may be different than the good one * @host - the host name accessed - may be different than the good one
2407 2407 * @ip - from where the connections come * @ip - from where the connections come
2408 2408 * @cmd: 'git-upload-pack' or 'git-receive-pack' * @cmd: 'git-upload-pack' or 'git-receive-pack'
2409 * @need_namespace_copy - true if we need to clone refs
2410 2409 * TODO: move it to user.inc.php?! * TODO: move it to user.inc.php?!
2411 2410 */ */
2412 2411 function rg_repo_fetch_push_helper($db, $host, $ip, $login_ui, $prefix, $user, function rg_repo_fetch_push_helper($db, $host, $ip, $login_ui, $prefix, $user,
2413 $repo, $cmd, $need_namespace_copy)
2412 $repo, $cmd)
2414 2413 { {
2415 2414 rg_prof_start('repo_fetch_push_helper'); rg_prof_start('repo_fetch_push_helper');
2416 2415 rg_log_enter('repo_fetch_push_helper: host=' . $host rg_log_enter('repo_fetch_push_helper: host=' . $host
2417 2416 . ' prefix=' . $prefix . ' user=' . $user . ' prefix=' . $prefix . ' user=' . $user
2418 . ' repo=' . $repo . ' cmd=' . $cmd
2419 . ' need_namespace_copy=' . ($need_namespace_copy ? 'yes' : 'no'));
2417 . ' repo=' . $repo . ' cmd=' . $cmd);
2420 2418
2421 2419 $ret = array('ok' => 0, 'allow' => 0, 'push_allowed' => 0); $ret = array('ok' => 0, 'allow' => 0, 'push_allowed' => 0);
2422 2420 while (1) { while (1) {
 
... ... function rg_repo_fetch_push_helper($db, $host, $ip, $login_ui, $prefix, $user,
2575 2573 putenv('ROCKETGIT_IP=' . $ip); putenv('ROCKETGIT_IP=' . $ip);
2576 2574 putenv('ROCKETGIT_ITIME=' . microtime(TRUE)); putenv('ROCKETGIT_ITIME=' . microtime(TRUE));
2577 2575 putenv('ROCKETGIT_HOST=' . $host); putenv('ROCKETGIT_HOST=' . $host);
2578 if (($ret['push'] == 1) && $need_namespace_copy) {
2576 if (($ret['push'] == 1) && ($ret['push_allowed'] == 0)) {
2577 rg_log('DEBUG: We need to clone the namespace...');
2579 2578 $namespace = 'rg_' . rg_id(8); $namespace = 'rg_' . rg_id(8);
2580 2579 rg_log('namespace is ' . $namespace); rg_log('namespace is ' . $namespace);
2581 2580 putenv('GIT_NAMESPACE=' . $namespace); putenv('GIT_NAMESPACE=' . $namespace);
File inc/user.inc.php changed (mode: 100644) (index 5442142..792e0a9)
... ... function rg_user_http_git($db, $rg, $paras)
1957 1957 } }
1958 1958
1959 1959 $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : ''; $host = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';
1960 $need_namespace_copy = strcmp($file, 'info/refs');
1961 1960 $r = rg_repo_fetch_push_helper($db, $host, $rg['ip'], $r = rg_repo_fetch_push_helper($db, $host, $rg['ip'],
1962 $rg['login_ui'], $prefix, $user, $repo, $service,
1963 $need_namespace_copy);
1961 $rg['login_ui'], $prefix, $user, $repo, $service);
1964 1962 rg_log_ml('DEBUG: repo_fetch_push_helper: ' . print_r($r, TRUE)); rg_log_ml('DEBUG: repo_fetch_push_helper: ' . print_r($r, TRUE));
1965 1963 if ($r['ok'] !== 1) { if ($r['ok'] !== 1) {
1966 1964 rg_log('DEBUG: set errror: ' . $r['error']); rg_log('DEBUG: set errror: ' . $r['error']);
File scripts/remote.php changed (mode: 100644) (index a9d778f..6c496a6)
... ... if (strstr($flags, 'W')) {
195 195 } }
196 196
197 197 $r = rg_repo_fetch_push_helper($db, $host, $ip, $login_ui, $prefix, $user, $r = rg_repo_fetch_push_helper($db, $host, $ip, $login_ui, $prefix, $user,
198 $repo, $cmd, TRUE /*need_namespace_copy*/);
198 $repo, $cmd);
199 199 rg_log_ml('DEBUG: repo_fetch_push_helper: ' . print_r($r, TRUE)); rg_log_ml('DEBUG: repo_fetch_push_helper: ' . print_r($r, TRUE));
200 200 if (($r['ok'] !== 1) || ($r['allow'] !== 1)) if (($r['ok'] !== 1) || ($r['allow'] !== 1))
201 201 fatal($r['error']); fatal($r['error']);
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://rocketgit.com/user/catalinux/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/catalinux/rocketgit

Clone this repository using git:
git clone git://git.rocketgit.com/user/catalinux/rocketgit

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