List of commits:
Subject Hash Author Date (UTC)
Functional test for Admin -> Settings -> SSH aa0f87c101fa0ca39559992b3ef5e415920e8d0d Catalin(ux) M. BOIE 2016-11-11 17:34:27
More SSH fixes: allow admin to limit what key types are allowed and the max number of keys. ab10c1c851c68b399d6ef6afb2fbf362f61d328c Catalin(ux) M. BOIE 2016-11-07 20:35:29
TODO update and typo corrections. 4f3aee242f4465d1c27dc1f171a72ab06ae8b822 Catalin(ux) M. BOIE 2016-11-06 12:39:17
Added possibility to use AuthorizedKeysCommand for performance reasons bce5d32d2b419cb9bc53d54de2a915ac1342432e Catalin(ux) M. BOIE 2016-11-06 12:35:15
Restart rocketgit-fpm service if needed 5742bea67f2e784e2b2bb9e97f005fc621c4119d Catalin(ux) M. BOIE 2016-11-02 19:56:53
Added CORS headers so API will work 57b172971ff1329d02dc1220ec77fe9a875d6633 Catalin(ux) M. BOIE 2016-11-02 19:56:17
Added git hosting solution comparison page 8eca6c104373fd0dbcde54691edfd9e81a3a59be Catalin(ux) M. BOIE 2016-11-02 19:54:26
Be sure a key is present or use a default one (api) 842d587f948ff4ec9de56e2ebfd591d96b066a43 Catalin(ux) M. BOIE 2016-10-13 22:45:51
Small correction in wording agains CLA 70dc902b1c84e6ee416d7af2af8bef319dbb7504 Catalin(ux) M. BOIE 2016-10-11 15:50:07
Make it the default: word-wrap: break-word 1512f51eba93b6dd296246bf20432ec9223148d9 Catalin(ux) M. BOIE 2016-10-08 07:53:19
Footer: reverse last two columns d9fe4e8adf980996d5ca06387a0a2c49236e7ad4 Catalin(ux) M. BOIE 2016-10-08 07:51:55
Post configuration must include also web conf file 3583e8915579dc8e4c9a508bac7998a3e612e501 Catalin(ux) M. BOIE 2016-10-08 07:50:00
ssl_request_log -> rocketgit-ssl_request_log 639e5532748729cd8a6ac8e4cf082b24e15e2eeb Catalin(ux) M. BOIE 2016-10-08 07:47:45
Add 'SSLCipherSuite PROFILE=SYSTEM' to the SSL configuration 100d73878b3da1718cf97c58d016ed182c690a9b Catalin(ux) M. BOIE 2016-10-08 06:33:09
Instruct login user to create a repo if she/he has none. f6f2f438deadb1ec80d32acbc8947dcc849dca19 Catalin(ux) M. BOIE 2016-10-08 06:24:57
Small changes at vm docs 8106a47f5bf89990ba7f7dbb0f8feb319ba4d883 Catalin(ux) M. BOIE 2016-10-05 03:32:37
No need to login to find out the ip address 55a3abd3dda66d9d0dccdc0fc27dc3dc3e7c3fa1 Catalin(ux) M. BOIE 2016-10-05 03:25:47
Bump version to 0.62 61acc979d8c3bb629e03dc371bba1f604f300205 Catalin(ux) M. BOIE 2016-10-04 18:49:31
TODO updates cc78fa90ebdb7605013f2ba40b7d196d708d7415 Catalin(ux) M. BOIE 2016-10-04 18:49:04
Allow php-fpm to use lock files and to regenerate authorized_keys file 5970fcb677e3443ff96549413df105c9956f0abf Catalin(ux) M. BOIE 2016-10-04 18:48:35
Commit aa0f87c101fa0ca39559992b3ef5e415920e8d0d - Functional test for Admin -> Settings -> SSH
Author: Catalin(ux) M. BOIE
Author date (UTC): 2016-11-11 17:34
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2016-11-11 17:34
Parent(s): ab10c1c851c68b399d6ef6afb2fbf362f61d328c
Signing key:
Tree: d520c221ca7d845690904753faefb6b8f6c32d81
File Lines added Lines deleted
tests/Makefile 4 1
tests/helpers.inc.php 8 8
tests/http_confirm.php 2 2
tests/http_keys.php 78 0
tests/repo.php 1 1
File tests/Makefile changed (mode: 100644) (index 7e96863..a474f18)
1 tests := http_forgot \
1 tests := http_keys http_forgot \
2 2 api wh_cloud pr_anon wh_http ssh http_totp totp git_log1.sh \ api wh_cloud pr_anon wh_http ssh http_totp totp git_log1.sh \
3 3 http_admin http_bug \ http_admin http_bug \
4 4 http_create_account http_login http_settings http_csrf http_top \ http_create_account http_login http_settings http_csrf http_top \
 
... ... all: clean $(tests)
11 11 @-ls -l err-* @-ls -l err-*
12 12 @echo "Do not forget to check for errors in /var/log/rocketgit!" @echo "Do not forget to check for errors in /var/log/rocketgit!"
13 13
14 http_keys:
15 php http_keys.php
16
14 17 http_forgot: http_forgot:
15 18 php http_forgot.php php http_forgot.php
16 19
File tests/helpers.inc.php changed (mode: 100644) (index 9d498e9..55c29c6)
... ... function rg_test_create_repo($db, $rg_ui, &$extra)
148 148
149 149 $r = rg_repo_edit($db, $rg_ui, $extra); $r = rg_repo_edit($db, $rg_ui, $extra);
150 150 if ($r === FALSE) { if ($r === FALSE) {
151 rg_log("Cannot insert a repo (" . rg_repo_error() . ")!");
151 rg_log("Cannot insert a repo (" . rg_repo_error() . ")!");
152 152 exit(1); exit(1);
153 153 } }
154 154
 
... ... function rg_test_create_key($db, $rg_ui)
197 197
198 198 $r = rg_keys_add($db, $rg_ui, $skey); $r = rg_keys_add($db, $rg_ui, $skey);
199 199 if ($r === FALSE) { if ($r === FALSE) {
200 rg_log("Cannot add a key (" . rg_keys_error() . ")!");
200 rg_log("Cannot add a key (" . rg_keys_error() . ")!");
201 201 exit(1); exit(1);
202 202 } }
203 203
 
... ... function rg_test_upload_ssh_key($db, $rg_ui, $key_name, $good_sid)
293 293 } }
294 294 if (empty($r['tokens']['keys'])) { if (empty($r['tokens']['keys'])) {
295 295 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
296 rg_log('token not found!');
297 exit(1);
296 rg_log('token not found!');
297 exit(1);
298 298 } }
299 299
300 300 rg_log("Uploading the key..."); rg_log("Uploading the key...");
 
... ... function rg_test_sc_generate($db, $rg_ui, $good_sid)
341 341 } }
342 342 if (empty($r['tokens']['sc'])) { if (empty($r['tokens']['sc'])) {
343 343 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
344 rg_log('token not found!');
345 exit(1);
344 rg_log('token not found!');
345 exit(1);
346 346 } }
347 347
348 348 rg_log("Generating scratch codes..."); rg_log("Generating scratch codes...");
 
... ... function rg_test_wh_add_edit($db, $rg_ui, $good_sid, $htype, $extra)
391 391 } }
392 392 if (empty($r['tokens']['wh_add'])) { if (empty($r['tokens']['wh_add'])) {
393 393 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
394 rg_log_ml('Token not found!');
395 exit(1);
394 rg_log_ml('Token not found!');
395 exit(1);
396 396 } }
397 397
398 398 rg_log("Adding webhook..."); rg_log("Adding webhook...");
File tests/http_confirm.php changed (mode: 100644) (index d6c2705..8c1a476)
... ... rg_log_exit();
88 88
89 89 rg_log_enter('Trying with the wrong link...'); rg_log_enter('Trying with the wrong link...');
90 90 $data = array(); $headers = array(); $data = array(); $headers = array();
91 $r = do_req($link . 'XXX?rg_debug=1&t=http_confirm', $data, $headers);
91 $r = do_req($link . 'XXX?t=http_confirm', $data, $headers);
92 92 if (!strstr($r['body'], 'Invalid token')) { if (!strstr($r['body'], 'Invalid token')) {
93 93 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
94 94 rg_log('Somethign wrong with the token!'); rg_log('Somethign wrong with the token!');
 
... ... rg_log_exit();
98 98
99 99
100 100 rg_log_enter('Trying with the good link...'); rg_log_enter('Trying with the good link...');
101 $r = do_req($link . '?rg_debug=1&t=http_confirm', $data, $headers);
101 $r = do_req($link . '?t=http_confirm', $data, $headers);
102 102 if (!strstr($r['body'], 'Home page of user')) { if (!strstr($r['body'], 'Home page of user')) {
103 103 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
104 104 rg_log('Somethign wrong with the token!'); rg_log('Somethign wrong with the token!');
File tests/http_keys.php added (mode: 100644) (index 0000000..fc51b0a)
1 <?php
2 error_reporting(E_ALL | E_STRICT);
3 ini_set('track_errors', 'On');
4
5 $rg_cache_debug = TRUE;
6
7 $INC = dirname(__FILE__) . '/../inc';
8 require_once(dirname(__FILE__) . '/config.php');
9 require_once($INC . '/init.inc.php');
10 require_once($INC . '/util.inc.php');
11 require_once('helpers.inc.php');
12 require_once('http.inc.php');
13
14 rg_log_set_file('http_keys.log');
15
16 $rg_sql = 'host=localhost user=rocketgit dbname=rocketgit connect_timeout=10';
17 $rg_no_db = TRUE;
18 require_once('common.php');
19
20 $_testns = 'http_keys';
21 $rg_cache_enable = TRUE;
22 $rg_cache_debug = TRUE;
23
24 $rg_ui = array('is_admin' => 1);
25 rg_test_create_user($db, $rg_ui);
26 test_login($test_url, $rg_ui, $good_sid);
27
28
29 rg_log('');
30 rg_log_enter('Loading Admin -> Settings -> SSH...');
31 $data = array();
32 $headers = array("Cookie: sid=" . $good_sid);
33 $r = do_req($test_url . '/op/admin/settings/ssh', $data, $headers);
34 if ($r === FALSE) {
35 rg_log("Cannot load page!");
36 exit(1);
37 }
38 if (!isset($r['tokens']['admin_settings_ssh'])) {
39 rg_log_ml('r:' . print_r($r, TRUE));
40 rg_log("No token?!");
41 exit(1);
42 }
43 $token = $r['tokens']['admin_settings_ssh'];
44
45 rg_log('Posting the form...');
46 $data = array(
47 'doit' => 1,
48 'token' => $token
49 );
50 $list = array(
51 'max_ssh_keys' => 10,
52 'ssh_key_min_bits_rsa' => 2048,
53 'ssh_key_allow_dsa' => 0,
54 'ssh_key_min_bits_ecdsa' => 256,
55 'AuthorizedKeysCommand' => 1
56 );
57 foreach ($list as $var => $def) {
58 $v = rg_state_get($db, $var);
59 if ($v === FALSE) {
60 rg_log('Cannot load state!');
61 exit(1);
62 }
63 if (empty($v))
64 $data[$var] = $def;
65 else
66 $data[$var] = $v;
67 }
68 $r = do_req($test_url . '/op/admin/settings/ssh', $data, $headers);
69 if (!strstr($r['body'], 'Configuration has been successfully saved.')) {
70 rg_log_ml('r: ' . print_r($r, TRUE));
71 rg_log("Cannot post form!");
72 exit(1);
73 }
74 rg_log_exit();
75
76
77 rg_log('OK!');
78 ?>
File tests/repo.php changed (mode: 100644) (index 0b6bba9..1d25d4c)
... ... $first = array_shift($copy);
259 259 $c = isset($first['rights']) ? $first['rights'] : "_BAD_"; $c = isset($first['rights']) ? $first['rights'] : "_BAD_";
260 260 if (strcmp($c, $e) != 0) { if (strcmp($c, $e) != 0) {
261 261 rg_log_ml("rights_get: r=" . print_r($r, TRUE)); rg_log_ml("rights_get: r=" . print_r($r, TRUE));
262 rg_log("Non-owner (uid " . $a['uid']. ") did not get correct rights: c=$c e=$e.");
262 rg_log("Non-owner (uid " . $a['uid']. ") did not get correct rights: c=$c e=$e.");
263 263 exit(1); exit(1);
264 264 } }
265 265 rg_log_exit(); rg_log_exit();
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