List of commits:
Subject Hash Author Date (UTC)
Improve host name auto-detection problems to work in VM env b56dd82ac1db3ca2cc4478af65b27909f05dd228 Catalin(ux) M. BOIE 2017-07-06 17:58:10
compare: added number of lines c847d9da61749de86ffa0199f26cd68f4b80cc3a Catalin(ux) M. BOIE 2017-07-06 17:53:57
Added a make target to compute the number of lines 8695380c12480b1b7b8bc9c5f1ec63a115742d9f Catalin(ux) M. BOIE 2017-07-06 17:53:16
tests: fixed wh_http - time race closed 8f182423103c8fc2a4be10840b08be0564e2c814 Catalin(ux) M. BOIE 2017-07-02 07:01:12
Add texts about the under age and about what laws you have to respect 65af692eec97a62e7c2212e558aa3b6bc4d925ba Catalin(ux) M. BOIE 2017-07-01 20:21:06
If we get an error when checking the db version, just exit, do not try to do updates. 20a3c8e9fbcadcab05c1a24428b06c7dc6c39f7d Catalin(ux) M. BOIE 2017-06-30 18:56:45
rpm: Forgot to create nginx conf.d folder a2d33471bd782be5aea6ea72f8e21842fc3be07d Catalin(ux) M. BOIE 2017-06-25 10:25:42
Bumped version to 0.69 2411fe5ef068cf6a8b546edcecaac25363755275 Catalin(ux) M. BOIE 2017-06-25 08:20:15
TODO updates 56321b504fdcb1724f590981b29e6731ba0c8607 Catalin(ux) M. BOIE 2017-06-25 08:19:11
tests: switch to nginx; small fixes for the 'log' test 6c75b7de3db4135071155fcaebc4b7220ee966ed Catalin(ux) M. BOIE 2017-06-25 08:18:20
Apache sample config fixes a030309a796a84b99bc9568fe81291305492bf10 Catalin(ux) M. BOIE 2017-06-25 07:59:46
Small text changes 45797dbaf71ec5c922a8ed6e7b9497da64807eb4 Catalin(ux) M. BOIE 2017-06-25 07:58:25
tests: added a test with 500 10k commits ad3ce91ff291b9537ceca11995268e45a17407ef Catalin(ux) M. BOIE 2017-06-25 07:57:37
css: added warning_text class 17a1930f1661392629f3787cdd0150e971496512 Catalin(ux) M. BOIE 2017-06-25 07:56:48
web: the jump to a file did not work because of a wrong anchor bbb95d3a79ea686b3c145b532d072fc19c034297 Catalin(ux) M. BOIE 2017-06-25 07:53:52
css: when diff is too big, show it inline not as a ugly block 9fff8e0248793fc7a2d1346dc8af7ba1aa2fb7ea Catalin(ux) M. BOIE 2017-06-25 07:50:58
Small fixes to the 'download' section documentation a19ca599f6e6ec064952cc1d8f9ea3edd7947254 Catalin(ux) M. BOIE 2017-06-25 07:50:11
Fixes for base_url: did not work for docker (bad switch to https) 4aee622d5e845a9e308f7277af1a1b612fc0c173 Catalin(ux) M. BOIE 2017-06-25 07:49:17
Fixed the commit show page (showing multiple commits) 3e932d79f05be2593cb4c62a58cc0f98704ba5d7 Catalin(ux) M. BOIE 2017-06-25 07:48:21
nginx preparations in .spec file and remove hard dependency on a web server 9aac8ca0a8cb26da4552b9e55f1d4d6b3a4a5d14 Catalin(ux) M. BOIE 2017-06-25 07:46:46
Commit b56dd82ac1db3ca2cc4478af65b27909f05dd228 - Improve host name auto-detection problems to work in VM env
Author: Catalin(ux) M. BOIE
Author date (UTC): 2017-07-06 17:58
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2017-07-06 17:58
Parent(s): c847d9da61749de86ffa0199f26cd68f4b80cc3a
Signer:
Signing key:
Signing status: N
Tree: 4da3eb9e108b91ed490d91e1ab8c28517c7b13f1
File Lines added Lines deleted
README 1 1
inc/login/login.php 1 1
inc/user.inc.php 14 14
inc/user/confirm.php 2 1
inc/user/forgot.php 2 1
root/index.php 15 1
root/themes/default/admin/settings/web/hints.html 1 1
root/themes/default/admin/settings/web/main.html 2 2
samples/nginx.conf 4 4
File README changed (mode: 100644) (index 021f62a..4a18249)
155 155 create the admin account. create the admin account.
156 156
157 157 . As admin user, go to Admin -> Settings and check if any setting should be . As admin user, go to Admin -> Settings and check if any setting should be
158 tweaked.
158 tweaked. It is very important to set the 'Host name' value.
159 159
160 160 . You may want to install 'qrencode' package to be able to be able to see the . You may want to install 'qrencode' package to be able to be able to see the
161 161 two-factor authentication keys as QR images. two-factor authentication keys as QR images.
File inc/login/login.php changed (mode: 100644) (index 16fc389..66a34d0)
... ... while ($rg['doit'] == 1) {
22 22 } }
23 23
24 24 $r = rg_user_login_by_user_pass($db, $user, $pass, $login_token, $r = rg_user_login_by_user_pass($db, $user, $pass, $login_token,
25 $lock_ip, $rg['login_ui']);
25 $lock_ip, $rg['hostname'], $rg['login_ui']);
26 26 if ($r === FALSE) { if ($r === FALSE) {
27 27 $errmsg[] = rg_user_error(); $errmsg[] = rg_user_error();
28 28 break; break;
File inc/user.inc.php changed (mode: 100644) (index 4bab946..cb6325a)
... ... function rg_user_pass_valid($db, $uid, $pass)
885 885 /* /*
886 886 * Set session cookie * Set session cookie
887 887 */ */
888 function rg_user_set_session_cookie($db, $uid, $sess_time, $lock_ip)
888 function rg_user_set_session_cookie($db, $uid, $sess_time, $lock_ip, $domain)
889 889 { {
890 890 rg_log_enter("user_set_session_cookie: uid=$uid"); rg_log_enter("user_set_session_cookie: uid=$uid");
891 891
 
... ... function rg_user_set_session_cookie($db, $uid, $sess_time, $lock_ip)
902 902 rg_sess_add($db, $uid, $sid, $sess_time, $lock_ip); rg_sess_add($db, $uid, $sid, $sess_time, $lock_ip);
903 903 else else
904 904 $sid = "X" . $sid; $sid = "X" . $sid;
905 if (isset($_SERVER['SERVER_NAME'])) {
906 rg_log('DEBUG: setting cookie ' . $cookie_name . ' to ' . $sid);
907 setcookie($cookie_name, $sid, 0, '/', $_SERVER['SERVER_NAME'],
908 $secure, TRUE /*httponly*/);
909 }
905
906 rg_log('DEBUG: setting cookie \'' . $cookie_name . '\' to ' . $sid);
907 setcookie($cookie_name, $sid, 0, '/', $domain, $secure,
908 TRUE /*httponly*/);
910 909
911 910 rg_log_exit(); rg_log_exit();
912 911 return $sid; return $sid;
 
... ... function rg_user_set_session_cookie($db, $uid, $sess_time, $lock_ip)
915 914 /* /*
916 915 * Auto login the user * Auto login the user
917 916 */ */
918 function rg_user_auto_login($db, $uid, $lock_ip, &$ui)
917 function rg_user_auto_login($db, $uid, $lock_ip, $domain, &$ui)
919 918 { {
920 919 rg_prof_start("user_auto_login"); rg_prof_start("user_auto_login");
921 920 rg_log_enter("user_auto_login: uid=$uid lock_ip=$lock_ip"); rg_log_enter("user_auto_login: uid=$uid lock_ip=$lock_ip");
 
... ... function rg_user_auto_login($db, $uid, $lock_ip, &$ui)
932 931 } }
933 932
934 933 rg_user_set_session_cookie($db, $uid, $ui['session_time'], rg_user_set_session_cookie($db, $uid, $ui['session_time'],
935 $lock_ip);
934 $lock_ip, $domain);
936 935
937 936 $ret = TRUE; $ret = TRUE;
938 937 break; break;
 
... ... function rg_user_auto_login($db, $uid, $lock_ip, &$ui)
947 946 * Test if login is OK * Test if login is OK
948 947 */ */
949 948 function rg_user_login_by_user_pass($db, $user, $pass, $login_token, $lock_ip, function rg_user_login_by_user_pass($db, $user, $pass, $login_token, $lock_ip,
950 &$ui)
949 $domain, &$ui)
951 950 { {
952 951 global $rg_account_email_confirm; global $rg_account_email_confirm;
953 952
954 rg_prof_start("user_login_by_user_pass");
955 rg_log_enter("user_login_by_user_pass: user=$user"
956 . " login_token=$login_token lock_ip=$lock_ip");
953 rg_prof_start('user_login_by_user_pass');
954 rg_log_enter('user_login_by_user_pass: user=' . $user
955 . ' login_token=' . $login_token . ' lock_ip=' . $lock_ip
956 . ' domain=' . $domain);
957 957
958 958 $ui = rg_user_empty(); $ui = rg_user_empty();
959 959
 
... ... function rg_user_login_by_user_pass($db, $user, $pass, $login_token, $lock_ip,
1024 1024 rg_event_signal_daemon('', 0); rg_event_signal_daemon('', 0);
1025 1025
1026 1026 $ui = $ui0; $ui = $ui0;
1027 rg_user_auto_login($db, $ui['uid'], $lock_ip, $ui);
1027 rg_user_auto_login($db, $ui['uid'], $lock_ip, $domain, $ui);
1028 1028
1029 1029 $ret = TRUE; $ret = TRUE;
1030 1030 break; break;
 
... ... function rg_user_http_git($db, $rg, $paras)
2037 2037 } }
2038 2038 $authd = rg_user_login_by_user_pass($db, $u, $p, $authd = rg_user_login_by_user_pass($db, $u, $p,
2039 2039 '' /*login_token*/, TRUE /*lock IP*/, '' /*login_token*/, TRUE /*lock IP*/,
2040 $rg['login_ui']);
2040 $rg['hostname'], $rg['login_ui']);
2041 2041 break; break;
2042 2042 } }
2043 2043
File inc/user/confirm.php changed (mode: 100644) (index b289e84..7c1ece2)
... ... if ($uid !== FALSE) {
11 11
12 12 // auto-login // auto-login
13 13 $lock_ip = 0; // TODO: What should we do here? Present a form? $lock_ip = 0; // TODO: What should we do here? Present a form?
14 rg_user_auto_login($db, $uid, $lock_ip, $rg['login_ui']);
14 rg_user_auto_login($db, $uid, $lock_ip, $rg['hostname'],
15 $rg['login_ui']);
15 16 } else { } else {
16 17 // error // error
17 18 $_confirm = rg_template('user/bad_token.html', $rg, TRUE /*xss*/); $_confirm = rg_template('user/bad_token.html', $rg, TRUE /*xss*/);
File inc/user/forgot.php changed (mode: 100644) (index f0b68aa..5d5864c)
... ... if ($rg['doit'] == 1) {
38 38
39 39 rg_user_forgot_pass_destroy($db, $r['uid']); rg_user_forgot_pass_destroy($db, $r['uid']);
40 40 // auto-login // auto-login
41 if (!rg_user_auto_login($db, $r['uid'], $lock_ip, $rg['login_ui'])) {
41 if (!rg_user_auto_login($db, $r['uid'], $lock_ip,
42 $rg['hostname'], $rg['login_ui'])) {
42 43 $_forgot = rg_template("msg/internal_err.html", TRUE /* xss */); $_forgot = rg_template("msg/internal_err.html", TRUE /* xss */);
43 44 return; return;
44 45 } }
File root/index.php changed (mode: 100644) (index 3038b86..b5fe604)
... ... if (isset($_SERVER['SERVER_NAME'])) {
119 119 $sn = $_SERVER['SERVER_NAME']; $sn = $_SERVER['SERVER_NAME'];
120 120 $port = $_SERVER['SERVER_PORT']; $port = $_SERVER['SERVER_PORT'];
121 121
122 if (strcmp($sn, 'rg.domain.tld') == 0) {
123 $sn = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
124 $_t = explode(':', $sn);
125 if (isset($_t[1])) {
126 $sn = $_t[0];
127 $port = $_t[1];
128 rg_log('DEBUG: HTTP_HOST: we have port [' . $sn . ']'
129 . ' [' . $port . ']');
130 }
131 }
132 if (empty($sn))
133 $sn = php_uname('n');
134
122 135 if ($hostname === FALSE) { if ($hostname === FALSE) {
123 136 $hostname = $sn; $hostname = $sn;
124 137 } else if (empty($hostname)) { } else if (empty($hostname)) {
 
... ... rg_log("After login_by_sid, login_ui=" . rg_array2string($rg['login_ui']));
231 244 if (($rg['login_ui']['uid'] == 0) && (strncmp($rg['sid'], "X", 1) != 0)) if (($rg['login_ui']['uid'] == 0) && (strncmp($rg['sid'], "X", 1) != 0))
232 245 $rg['sid'] = ""; $rg['sid'] = "";
233 246 if (empty($rg['sid'])) { if (empty($rg['sid'])) {
234 $rg['sid'] = rg_user_set_session_cookie($db, 0 /*uid*/, 600, FALSE);
247 $rg['sid'] = rg_user_set_session_cookie($db, 0 /*uid*/, 600,
248 FALSE /*lock_ip*/, $rg['hostname']);
235 249 rg_log("User has no sid, generate one [" . $rg['sid'] . "]"); rg_log("User has no sid, generate one [" . $rg['sid'] . "]");
236 250 } }
237 251
File root/themes/default/admin/settings/web/hints.html changed (mode: 100644) (index f84c17f..10991c1)
2 2 - RocketGit will respect the host named defined in the web server to contruct - RocketGit will respect the host named defined in the web server to contruct
3 3 URLs; please make sure it is correct. Here you can overwrite it.<br /> URLs; please make sure it is correct. Here you can overwrite it.<br />
4 4 - It is recommended to disable HTTP access and allow only HTTPS.<br /> - It is recommended to disable HTTP access and allow only HTTPS.<br />
5 - Do not activate HTTP and/or HTTPS if are not enabled in the web server.
5 - Do not activate HTTP and/or HTTPS if they are not enabled in the web server.
File root/themes/default/admin/settings/web/main.html changed (mode: 100644) (index fc6bbf7..e4da2b3)
14 14 </p> </p>
15 15
16 16 <p> <p>
17 <label for="http_allow">HTTP access (put 0 to disallow, else, the port)</label><br />
17 <label for="http_allow">HTTP port (put 0 to disallow)</label><br />
18 18 <input type="text" name="http_allow" id="http_allow" value="@@http_allow@@" /> <input type="text" name="http_allow" id="http_allow" value="@@http_allow@@" />
19 19 </p> </p>
20 20
21 21 <p> <p>
22 <label for="https_allow">HTTPS access (put 0 to disallow, else, the port)</label><br />
22 <label for="https_allow">HTTPS port (put 0 to disallow)</label><br />
23 23 <input type="text" name="https_allow" id="https_allow" value="@@https_allow@@" /> <input type="text" name="https_allow" id="https_allow" value="@@https_allow@@" />
24 24 </p> </p>
25 25
File samples/nginx.conf changed (mode: 100644) (index 0a57d7e..8c7fefc)
6 6 server { server {
7 7 listen 80 backlog=128 rcvbuf=64k; listen 80 backlog=128 rcvbuf=64k;
8 8 listen [::]:80 backlog=128 rcvbuf=64k; listen [::]:80 backlog=128 rcvbuf=64k;
9 server_name rg.domain.tld # add here, space separated, more names;
9 server_name rg.domain.tld; # add here, space separated, more names
10 10 server_tokens off; server_tokens off;
11 11 root /usr/share/rocketgit/root; root /usr/share/rocketgit/root;
12 12
 
... ... server {
61 61
62 62 # HTTPS server # HTTPS server
63 63 server { server {
64 listen 443 ssl backlog=128 rcvbuf=64k;
65 listen [::]:443 ssl backlog=128 rcvbuf=64k;
66 server_name rg.domain.tld # add here, space separated, more names;
64 listen 443 ssl http2 backlog=128 rcvbuf=64k;
65 listen [::]:443 ssl http2 backlog=128 rcvbuf=64k;
66 server_name rg.domain.tld; # add here, space separated, more names
67 67 server_tokens off; server_tokens off;
68 68 root /usr/share/rocketgit/root; root /usr/share/rocketgit/root;
69 69
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