xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit 514ca23b83da81827e03c7ff8866aa29d75f0f5e

Random changes: TODO, CSS etc.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-12-11 17:56
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-12-11 17:56
Parent(s): d48b652f02ed413c089a462f493dbf7dbec27388
Signing key:
Tree: ac622d2ebf5e26c0ceb61b57177c8b7d8b568ea1
File Lines added Lines deleted
README 1 1
TODO 42 6
inc/repo.inc.php 8 3
inc/ssh.inc.php 4 8
inc/util.inc.php 1 1
root/themes/default/main.css 12 3
root/themes/default/repo/main.html 1 1
root/themes/default/user/settings/wh/add_edit.html 3 3
scripts/cache.php 1 1
File README changed (mode: 100644) (index 287f4f5..5182de9)
101 101 . Point your browser to the newly created server and you will be asked to . Point your browser to the newly created server and you will be asked to
102 102 create the admin account. create the admin account.
103 103
104 . You may want to install qrencode to be able to export two factor
104 . You may want to install qrencode to be able to be able to see the two factor
105 105 authentication keys as QR pictures. authentication keys as QR pictures.
106 106
107 107 == Thanks == == Thanks ==
File TODO changed (mode: 100644) (index 6d8ef97..92544c5)
1 1 == Where I stopped last time == == Where I stopped last time ==
2 [ ]
3 2
4 3 == BEFORE NEXT RELEASE == == BEFORE NEXT RELEASE ==
5 [ ] "Do not verify the certificate" - not clear which cert!
4 [ ] css: add 'position: fixed' to header (still have problems with
5 'display: table-row' for header, body, footer)
6 [ ] about CI: https://opensource.com/business/15/12/git-docker-continuous-integration-tex-documents
7 [ ] Integrate with https://semaphoreci.com/
8 [ ] Take a look at cgit interface: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=123d0ba9b8c92ce00d2a0b2f98c5f329353e70d1
9 [ ] Configure, first time, if we auto insert a "anon push" rule.
10 [ ] lock: web: show when a repo is locked
11 [ ] repo lock by ssh?
12 [ ] wh: Maybe separate push/create repo/create branch, to be able to have
13 custom filtering. For example, a regex for pushed refs, or a regex
14 for repo name, or a regex for branch name.
15 Seems we have a regex for all...
16 [ ] watch: really do something with the users watching a user.
17 when target created a repo, for example.
18 Also when target user is watching something else? Interesting!
19 [ ] watch: add unit test for user watch
20 [ ] watch: 'repo': url is not correct! Always redirects to "last events".
21 [ ] "Clone this repository using ssh (do not forget to upload a key first)"
22 Do a link to upload a key.
23 [ ] Important to state boldly: "You do not have to have an account
24 to contribute to a project!"
25 [ ] Code Deployment for Amazon (Dani).
26 [ ] Investigate unlogged PostgreSQL tables and hstore. To replace the custom
27 cache. (http://bonesmoses.org/2015/12/04/pg-phriday-displaced-durability/)
28 [ ] Some people may be behind a firewall and webhooks will not work correctly.
29 Add another type: socket, but in listen mode, and provide notifications
30 on that socket. Socket will remain opened as long as needed. Cool!
31 [ ] watch: pay attention to not send updates about private repos!
32 [ ] Tell the user how s/he can get an avatar.
33 [ ] watch: when a user is watching a user, what notifications should receive?
34 Create repo. Else?
35 [ ] watch: when a user is watching a repo, it already watches bugs?
36 Should s/he?
37 [ ] wh: last_output pollutes too must 'user::' namepsace. => too many data
38 loaded => bigger latency. And last_output is not very important
39 everywhere.
40 Maybe move whole wh outside of 'user' namespace? It is accessed seldom.
41 [ ] If user is not logged in, do not show "Edit", "Close" or "Delete" buttons.
42 [ ] Cache how many users watch a repo.
43 We should have a cron that recomputes the numbers?
6 44 [ ] wh: at push time the triggers are not called! [ ] wh: at push time the triggers are not called!
7 45 [ ] Auto subscribe users to blog, but allow them to unsubscribe from e-mail. [ ] Auto subscribe users to blog, but allow them to unsubscribe from e-mail.
8 46 [ ] Do a small tutorial on how you can create themes (Gabi). [ ] Do a small tutorial on how you can create themes (Gabi).
9 47 [ ] rate another repo (Gabi) [ ] rate another repo (Gabi)
10 48 [ ] suggestions: at least notify by e-mail. [ ] suggestions: at least notify by e-mail.
11 [ ] For pull request by anon push, add a button to send an e-mail with an
49 [ ] For pull requests by anon push, add a button to send an e-mail with an
12 50 authorization code to be able to destroy/edit pr. authorization code to be able to destroy/edit pr.
13 51 The e-mail can be taken from commits. The e-mail can be taken from commits.
14 52 Maybe we should reject pr with wrong e-mail addresses? Maybe we should reject pr with wrong e-mail addresses?
 
16 54 and teach user how to disable it. and teach user how to disable it.
17 55 [ ] When a php script exists, check that every db res was freed! [ ] When a php script exists, check that every db res was freed!
18 56 I found one case in keys.inc.php! I found one case in keys.inc.php!
19 [ ] Mark in cache that we updated first use to not update it too often.
20 [ ] Keep in history also the fetches?
57 [ ] Keep in history also the fetches? Too much data?
21 58 [ ] When showing files, show total number of lines, size in bytes, type, [ ] When showing files, show total number of lines, size in bytes, type,
22 59 button for download, history, blame, printable, history. button for download, history, blame, printable, history.
23 [ ] Suggest 4096 bits RSA keys instead of 2048.
24 60 [ ] https://rocketgit.com/user/user/repo/source/log [ ] https://rocketgit.com/user/user/repo/source/log
25 61 We may want to transform the author into a link to rocketgit user page. We may want to transform the author into a link to rocketgit user page.
26 62 [ ] Binary files show wrong on "Tree" menu. [ ] Binary files show wrong on "Tree" menu.
File inc/repo.inc.php changed (mode: 100644) (index 656c086..e3caa0f)
... ... function rg_repo_list_query($db, $url, $sql, $params)
1167 1167
1168 1168 /* /*
1169 1169 * List repos of page user 'ui'. * List repos of page user 'ui'.
1170 * @uid - owner of the to be listed repos
1170 1171 */ */
1171 1172 function rg_repo_list($db, $rg, $url, $uid) function rg_repo_list($db, $rg, $url, $uid)
1172 1173 { {
1173 1174 rg_log("repo_list: url=$url uid=" . $uid rg_log("repo_list: url=$url uid=" . $uid
1174 1175 . " login_uid=" . $rg['login_ui']['uid']); . " login_uid=" . $rg['login_ui']['uid']);
1175 1176
1176 $params = array("uid" => $uid);
1177 $params = array(
1178 "uid" => $uid,
1179 "login_uid" => $rg['login_ui']['uid']);
1177 1180
1178 $add = "";
1179 1181 if ($uid > 0) if ($uid > 0)
1180 $add = " AND uid = @@uid@@";
1182 $add = ' AND uid = @@uid@@';
1183 else
1184 $add = ' AND uid != @@login_uid@@';
1181 1185
1182 1186 // TODO: also admin must be able to see them? // TODO: also admin must be able to see them?
1183 1187 if (($rg['login_ui']['uid'] == 0) if (($rg['login_ui']['uid'] == 0)
 
... ... function rg_repo_search_high_level($db, $rg, $ui, $url)
1942 1946
1943 1947 /* /*
1944 1948 * Discover top menu * Discover top menu
1949 * @ui - act like login_ui
1945 1950 */ */
1946 1951 function rg_repo_discover($db, $op, $rg, $ui) function rg_repo_discover($db, $op, $rg, $ui)
1947 1952 { {
File inc/ssh.inc.php changed (mode: 100644) (index 7ef5d14..e5e09a0)
... ... function rg_ssh_repo($db, $uid, $paras)
69 69
70 70 echo 'Repo: ' . $ri['name'] . "\n"; echo 'Repo: ' . $ri['name'] . "\n";
71 71 echo 'Repo type: ' . ($ri['public'] == 1 ? 'public' : 'private') . "\n"; echo 'Repo type: ' . ($ri['public'] == 1 ? 'public' : 'private') . "\n";
72 echo 'Description:' . "\n";
73 $_d = explode("\n", $ri['description']);
74 if (!empty($_d)) {
75 foreach ($_d as $_line)
76 echo ' ' . $_line . "\n";
77 }
78 echo 'Creation time: ' . gmdate('Y-m-d', $ri['itime']) . ' UTC' . "\n";
79 echo 'Disk used: ' . rg_1024($ri['disk_used_mb'] * 1024 * 1024) . "\n";
72 echo 'Creation time: ' .
73 gmdate('Y-m-d', $ri['itime']) . ' UTC' . "\n";
74 echo 'Disk used: ' .
75 rg_1024($ri['disk_used_mb'] * 1024 * 1024) . "\n";
80 76
81 77 if ($ri['master'] > 0) { if ($ri['master'] > 0) {
82 78 $mri = rg_repo_info($db, $ri['master'], 0, ''); $mri = rg_repo_info($db, $ri['master'], 0, '');
File inc/util.inc.php changed (mode: 100644) (index fc68b0f..c86f9af)
... ... function sha512($m)
46 46 function rg_1024($v) function rg_1024($v)
47 47 { {
48 48 if ($v <= 9999) if ($v <= 9999)
49 return number_format($v);
49 return number_format($v) . 'B';
50 50 $v /= 1024; $v /= 1024;
51 51
52 52 if ($v <= 9999) if ($v <= 9999)
File root/themes/default/main.css changed (mode: 100644) (index 5fb57fc..67d1f1d)
... ... form input[type="submit"] {
74 74
75 75 form fieldset { margin-top: 5pt; padding: 3pt; } form fieldset { margin-top: 5pt; padding: 3pt; }
76 76
77 .form_inline {
78 display: inline-block;
79 }
80 .form_inline form { margin-top: 0 }
81 .form_inline form input[type="submit"] {
82 margin-top: 0;
83 padding: 0;
84 }
85
77 86 legend { padding: 0px 2pt; } legend { padding: 0px 2pt; }
78 87
79 88 #container { #container {
 
... ... legend { padding: 0px 2pt; }
177 186 } }
178 187
179 188 #main { #main {
180 margin-top: 10px;
181 189 width: 80%; width: 80%;
190 margin-top: 12pt;
182 191 margin-left: auto; margin-left: auto;
183 192 margin-right: auto; margin-right: auto;
184 padding: 10px 15px;
185 193 line-height: 120%; line-height: 120%;
186 194 display: table; display: table;
187 195 text-align: center; text-align: center;
 
... ... legend { padding: 0px 2pt; }
195 203 display: table-row; display: table-row;
196 204 width: 100%; width: 100%;
197 205 height: 28pt; height: 28pt;
206 xxx-position: fixed;
198 207 } }
199 208 #header_fake_table { #header_fake_table {
200 209 display: table; display: table;
 
... ... legend { padding: 0px 2pt; }
329 338 .repo_header { } .repo_header { }
330 339
331 340 .repo_title { .repo_title {
332 font-size: 15pt;
341 font-size: 16pt;
333 342 font-weight: bold; font-weight: bold;
334 343 color: #bbbbbb; color: #bbbbbb;
335 344 } }
File root/themes/default/repo/main.html changed (mode: 100644) (index f5454c2..9a3eac0)
7 7 (@@if(@@ri::public@@ == 1){{public}}{{private}}) (@@if(@@ri::public@@ == 1){{public}}{{private}})
8 8 (License: @@if("@@ri::license@@" == ""){{Unspecified}}{{@@ri::license@@}}) (License: @@if("@@ri::license@@" == ""){{Unspecified}}{{@@ri::license@@}})
9 9 (since @@ri::itime_nice@@) (since @@ri::itime_nice@@)
10 <div style="display: inline-block">@@watch_form@@ @@watch_error@@</div>
10 <div class="form_inline">@@watch_form@@ @@watch_error@@</div>
11 11 </div> </div>
12 12 <div class="repo_desc"> <div class="repo_desc">
13 13 @@ri::description_nlbr@@ @@ri::description_nlbr@@
File root/themes/default/user/settings/wh/add_edit.html changed (mode: 100644) (index b3ba0ad..f53fa18)
10 10
11 11 <p> <p>
12 12 <label for="url">URL (example: https://my_server_dot_com/hook.cgi; only http/https are supported)</label><br /> <label for="url">URL (example: https://my_server_dot_com/hook.cgi; only http/https are supported)</label><br />
13 <input type="text" name="wh::url" id="url" value="@@wh::url@@" />
13 <input type="text" name="wh::url" id="url" value="@@wh::url@@" size="80" />
14 14 </p> </p>
15 15
16 16 <p> <p>
 
31 31
32 32 <p> <p>
33 33 <label for="key">HMAC SHA512 key (optional, see hints)</label><br /> <label for="key">HMAC SHA512 key (optional, see hints)</label><br />
34 <input type="text" name="wh::key" id="key" value="@@wh::key@@" />
34 <input type="text" name="wh::key" id="key" value="@@wh::key@@" size="80" />
35 35 </p> </p>
36 36
37 37 <p> <p>
38 38 <label for="opaque">Opaque string (optional, will be sent in the request)</label><br /> <label for="opaque">Opaque string (optional, will be sent in the request)</label><br />
39 <input type="text" name="wh::opaque" id="opaque" value="@@wh::opaque@@" />
39 <input type="text" name="wh::opaque" id="opaque" value="@@wh::opaque@@" size="80" />
40 40 </p> </p>
41 41
42 42 <p> <p>
File scripts/cache.php changed (mode: 100644) (index 7d4a27c..6b9b850)
... ... ini_set("track_errors", "On");
7 7 set_time_limit(0); set_time_limit(0);
8 8
9 9 // Increment this if we need to restart this daemon (protocol changes etc.) // Increment this if we need to restart this daemon (protocol changes etc.)
10 $rg_cache_version = 35;
10 $rg_cache_version = 36;
11 11
12 12 $now = time(); $now = time();
13 13 $_s = microtime(TRUE); $_s = microtime(TRUE);
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://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

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