List of commits:
Subject Hash Author Date (UTC)
Added unit test for e-mail confirmation 8a835c3ffa6f27c208fef6b4525f9aa571c603f6 Catalin(ux) M. BOIE 2016-03-27 11:41:35
Avoid caching in docker c8bc0ff648b60aa159c2a83d8ab1db3c574f19c3 Catalin(ux) M. BOIE 2016-03-14 16:32:25
Do not allow random input as reference fe5d01344b9131edeb2812f72549bf74d8242653 Catalin(ux) M. BOIE 2016-03-14 16:31:59
Bump version to 0.50 485f0f8bae787bfbd7c52c9b934af977d8a2b871 Catalin(ux) M. BOIE 2016-03-11 23:32:34
Fixed bug add menu 47d48b6bbf669bd51d6876521fa288d217dda5d2 Catalin(ux) M. BOIE 2016-03-11 23:32:02
docker small fixes 1e68d0bbf8e16365068636a4e813c8ae0db2be5c Catalin(ux) M. BOIE 2016-03-11 23:31:34
Corrected a problem in spec file 8d28fc4e9d66d9a07d1148d893176a99533f8796 Catalin(ux) M. BOIE 2016-03-11 17:33:18
Bump version to v0.49 1481eafa69e1b2f2e2922a7b26acc3dc9a56f1a3 Catalin(ux) M. BOIE 2016-03-11 17:26:13
Just some comments 96f8542619d772c29b9bb07e4a066b7302d6f35c Catalin(ux) M. BOIE 2016-03-11 17:25:29
TODO clean-ups 3e34a304a204792b1a1a0b403c88e3164441066c Catalin(ux) M. BOIE 2016-03-09 17:27:10
Document web hooks and anonymous push 449e2d788ec06a49cc93f7d058df51ec351b9244 Catalin(ux) M. BOIE 2016-03-09 17:26:29
Do not log password in logs 4e183a15605f4b338863ea97192e46e0cf62cfe8 Catalin(ux) M. BOIE 2016-03-09 17:25:52
Do not continue to show objects if repo returned an error cd2a6a06d7867bb5da19108c6ab575e741b8b08e Catalin(ux) M. BOIE 2016-03-09 03:50:28
Make more clearer the events error message c76dd790a73e04318f0fc58b22d7701858e7dadf Catalin(ux) M. BOIE 2016-03-08 20:57:37
Accept 301 as a valid HTTP code 368f187c74e54052dbeeddfe9b5a533b155a62c2 Catalin(ux) M. BOIE 2016-03-08 20:57:01
We need to copy also the tags in the namespace to not get errors when pushing tags a6fa7c067b29f2d3ae400e6cb9117d17225ce047 Catalin(ux) M. BOIE 2016-03-06 21:21:07
Clean some items on TODO regarding mr 2383950909474e510897f37e46c2cf7cc762ec89 Catalin(ux) M. BOIE 2016-03-06 21:20:37
Lots of fixes for pull requests 54c410d144ae9ebdcc17ad8d11865a378e89f576 Catalin(ux) M. BOIE 2016-03-06 20:07:06
Replaced rg_bug_next_id with the more generic rg_repo_next_id 7c3131ac2bff3afb08983a2ebd23736ced070fb1 Catalin(ux) M. BOIE 2016-02-17 16:07:12
text correction: Amazon user must also have S3 rights 6a97f6ef92bb455b02434f35218224a3cae4cf02 Catalin(ux) M. BOIE 2016-02-14 12:11:29
Commit 8a835c3ffa6f27c208fef6b4525f9aa571c603f6 - Added unit test for e-mail confirmation
Author: Catalin(ux) M. BOIE
Author date (UTC): 2016-03-27 11:41
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2016-03-27 11:54
Parent(s): c8bc0ff648b60aa159c2a83d8ab1db3c574f19c3
Signing key:
Tree: ae6d60d8cf66b50786e33e95bde37884ddddda5e
File Lines added Lines deleted
tests/http.inc.php 1 2
tests/http_confirm.php 111 0
tests/http_top.php 1 1
File tests/http.inc.php changed (mode: 100644) (index 625186d..c8410af)
... ... function do_req($url, &$data, &$headers)
154 154 if ($x === 1) { if ($x === 1) {
155 155 if (strncmp($url, "http://", 7) == 0) if (strncmp($url, "http://", 7) == 0)
156 156 $url = substr($url, 7); $url = substr($url, 7);
157 rg_log("redirect to url=$url");
158 157 $t = explode("/", $url, 2); $t = explode("/", $url, 2);
159 158 $new = "http://" . $t[0] . trim($matches[1]); $new = "http://" . $t[0] . trim($matches[1]);
160 //rg_log("Redirecting to $new...");
159 rg_log("Redirecting to $new...");
161 160 $data = array(); $data = array();
162 161 if (!empty($ret['sid'])) if (!empty($ret['sid']))
163 162 $headers = array("Cookie: sid=" . $ret['sid']); $headers = array("Cookie: sid=" . $ret['sid']);
File tests/http_confirm.php added (mode: 100644) (index 0000000..d6c2705)
1 <?php
2 error_reporting(E_ALL | E_STRICT);
3 ini_set("track_errors", "On");
4
5 $INC = dirname(__FILE__) . "/../inc";
6 require_once(dirname(__FILE__) . "/config.php");
7 require_once($INC . "/init.inc.php");
8 require_once($INC . "/util.inc.php");
9 require_once("http.inc.php");
10
11 rg_log_set_file("http_confirm.log");
12
13 $rg_sql = "host=localhost user=rocketgit dbname=rocketgit connect_timeout=10";
14 $rg_no_db = TRUE;
15 require_once("common.php");
16
17 $_testns = 'http_confirm';
18 $rg_cache_enable = TRUE;
19 $rg_cache_debug = TRUE;
20 $rg_event_socket = "/var/lib/rocketgit/sockets/event.sock";
21
22 $uniq = rg_id(10);
23
24 rg_log_enter('Loading confirmation form...');
25 // First we need to load the form so we can get the token
26 $r = do_req($test_url . "/op/create_account", $data, $headers);
27 if ($r === FALSE) {
28 rg_log("Cannot load create_account page!");
29 exit(1);
30 }
31 $good_sid = $r['sid'];
32 $good_token = $r['tokens']['user_edit_hl'];
33 rg_log_exit();
34
35
36 rg_log_enter('Adding an account...');
37 $data['token'] = $r['tokens']['user_edit_hl'];
38 $data['username'] = 'http_confirm-' . time();
39 $data['email'] = 'http_confirm-' . $uniq . '@a.b';
40 $data['pass'] = $uniq;
41 $data['pass2'] = $uniq;
42 $data['plan_id'] = 0;
43 $data['tos'] = 1;
44 $data['force_confirm'] = 1;
45 $data['doit'] = 1;
46 $headers = array("Cookie: sid=" . $good_sid);
47 $r = do_req($test_url . '/op/create_account?t=create_account', $data, $headers);
48 if (!strstr($r['body'], 'Your account has been successfully created')) {
49 rg_log_ml('body: ' . print_r($r['body'], TRUE));
50 rg_log('Cannot create account!');
51 exit(1);
52 }
53 rg_log_exit();
54
55
56 rg_log_enter('Finding uid...');
57 $sql = 'SELECT uid FROM users WHERE username = \'' . $data['username'] . '\'';
58 $res = rg_sql_query($db, $sql);
59 if ($res === FALSE) {
60 rg_log('Query error!');
61 exit(1);
62 }
63 $row = rg_sql_fetch_array($res);
64 rg_sql_free_result($res);
65 $uid = $row['uid'];
66 rg_log_exit();
67
68
69 rg_log_enter('Finding confirmation link...');
70 $key = 'DEBUG::' . $uid . '::mail';
71 $tries = 10;
72 while ($tries) {
73 $c = rg_cache_get($key);
74 if ($c !== FALSE)
75 break;
76
77 $tries--;
78 sleep(1);
79 }
80 rg_log_ml('c: ' . print_r($c, TRUE));
81 $t = explode('below:', $c['body']);
82 $t = ltrim($t[1]);
83 $t = explode("\n", $t);
84 $link = $t[0];
85 rg_log('Link=' . $link);
86 rg_log_exit();
87
88
89 rg_log_enter('Trying with the wrong link...');
90 $data = array(); $headers = array();
91 $r = do_req($link . 'XXX?rg_debug=1&t=http_confirm', $data, $headers);
92 if (!strstr($r['body'], 'Invalid token')) {
93 rg_log_ml('r: ' . print_r($r, TRUE));
94 rg_log('Somethign wrong with the token!');
95 exit(1);
96 }
97 rg_log_exit();
98
99
100 rg_log_enter('Trying with the good link...');
101 $r = do_req($link . '?rg_debug=1&t=http_confirm', $data, $headers);
102 if (!strstr($r['body'], 'Home page of user')) {
103 rg_log_ml('r: ' . print_r($r, TRUE));
104 rg_log('Somethign wrong with the token!');
105 exit(1);
106 }
107 rg_log_exit();
108
109
110 rg_log('OK!');
111 ?>
File tests/http_top.php changed (mode: 100644) (index b2cd64e..3a01417)
... ... $rg_cache_enable = TRUE;
22 22
23 23 $now = time(); $now = time();
24 24
25 // TODO: donate has some problems with input + border!
25 // TODO: donate has some problems with input + border (tidy)!
26 26 $_list = array("features", "discover", "download", "pricing", "tos", $_list = array("features", "discover", "download", "pricing", "tos",
27 27 "create_account", "login"); "create_account", "login");
28 28 foreach ($_list as $op) { foreach ($_list as $op) {
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