List of commits:
Subject Hash Author Date (UTC)
Cosmetic d48682ffe54991deedd4989a100a0607cafefab8 Catalin(ux) M. BOIE 2023-06-14 17:11:03
Fixed delete account op 4157f88a19d1b24934743d0193755a6dc3f98c13 Catalin(ux) M. BOIE 2023-06-14 17:10:22
Render readme files on the project page a8c09adb1bceed31f8070386158561b06470a98f Catalin(ux) M. BOIE 2023-06-14 17:09:17
Added rg_sid global variable to simplify the function calling 0047908fcd2ed0302a826487ddd15ca2579a9a83 Catalin(ux) M. BOIE 2023-06-14 17:06:39
Removed delta support for rpms because Fedora will remove it 2c26be90f4bc08a06ab03ab016e9ccaa843780e5 Catalin(ux) M. BOIE 2023-05-03 05:04:40
Added first payments option; fixes all around 7102aed9f239d529723799171553e8c4bd018440 Catalin(ux) M. BOIE 2023-05-02 22:36:28
Fixed a nasty typo in the build system; doc update; cosmetic 1934732b297d6476be7954fabdcaf9eb87678f5e Catalin(ux) M. BOIE 2022-12-21 12:51:53
Send client features to the builder dcf648353662409b9e39a422228ddb6a7c43358c Catalin(ux) M. BOIE 2022-12-21 11:10:00
Add support for SHA-256 git repos 8b88927d353c7b588909d0b1220c8922b32129c0 Catalin(ux) M. BOIE 2022-12-21 11:03:19
Look-up pkg_repo using pkg_repo uid f2b188b8cb151c376d8ee8c81f8e82c02ed93cd1 Catalin(ux) M. BOIE 2022-12-12 05:29:13
Cosmetic 04ae5ac6b9805198966a21755d1d430ef5b6a6dd Catalin(ux) M. BOIE 2022-12-11 17:17:39
Keep-alive mechanism for builder/worker 7e3add2ab41feefe37a858439934b8599fb30933 Catalin(ux) M. BOIE 2022-12-10 19:36:53
Bumped version to 0.76 09bb0cc92a9dfce513ce1289a22e71faf4ad1fe1 Catalin(ux) M. BOIE 2022-10-22 06:27:35
Cosmetic 45c59081c97489ccccd35efffa522607fee25a63 Catalin(ux) M. BOIE 2022-10-22 05:52:56
Mostly worker stuff ccf3a8d8da2ad1b0d97418fabb5028b40721835f Catalin(ux) M. BOIE 2022-10-22 05:50:04
wh: lambda: seems we cannot pass x-Amz-Client-Context header empty anymore 7f065b0fb6ceed5d2339afd7590f5a795ed3582e Catalin(ux) M. BOIE 2022-10-21 19:33:58
workers: wrong URL for delete a2b2ff5925b1ee9b4a033da93084c008b7af8c64 Catalin(ux) M. BOIE 2022-10-21 16:03:56
Typo 4557595fb985fb2a0a482a387ef0a61293b511ed Catalin(ux) M. BOIE 2022-03-29 17:06:57
Builder improvements 2c27620922c4990454dc3039b2f1c4a86388501f Catalin(ux) M. BOIE 2022-03-29 06:28:16
Extra space in debian/conffiles preventing Debian build 416ed9995151c29bffb4ca3f0f6901aab7cbaa8e Catalin(ux) M. BOIE 2022-03-28 19:36:06
Commit d48682ffe54991deedd4989a100a0607cafefab8 - Cosmetic
Author: Catalin(ux) M. BOIE
Author date (UTC): 2023-06-14 17:11
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2023-06-14 17:11
Parent(s): 4157f88a19d1b24934743d0193755a6dc3f98c13
Signer:
Signing key:
Signing status: N
Tree: 62d498825986cf90d557b50977e70a7419ae9158
File Lines added Lines deleted
History.txt 1 0
TODO 2 0
duilder.conf 1 1
inc/conn.inc.php 16 9
inc/struct.inc.php 2 0
inc/util.inc.php 1 1
rocketgit.spec 15 7
samples/nginx.conf 1 1
scripts/rgfs.php 66 24
File History.txt changed (mode: 100644) (index 90cec2b..fd1f7a6)
29 29 2022-02-16 - RocketGit 0.75 released. 2022-02-16 - RocketGit 0.75 released.
30 30 2022-10-22 - RocketGit 0.76 released - mostly worker stuff 2022-10-22 - RocketGit 0.76 released - mostly worker stuff
31 31 2022-11-17 - Trimble donated a HP server for the RocketGit project (Embedromix) 2022-11-17 - Trimble donated a HP server for the RocketGit project (Embedromix)
32 2023-05-02 - RocketGit 0.77 released.
32 33
File TODO changed (mode: 100644) (index c85b863..0418946)
78 78 [ ] [ ]
79 79
80 80 == Next next release == == Next next release ==
81 [ ] Would be nice to see what webhooks will execute after a push.
82 Maybe the events system can pass back some information to be shown to the user.
81 83 [ ] Clone by git (eg ninedogs) failes to checkout files. [ ] Clone by git (eg ninedogs) failes to checkout files.
82 84 [ ] I am showing this and I think the second message should not be sent anymore (hm, I think is not mine): [ ] I am showing this and I think the second message should not be sent anymore (hm, I think is not mine):
83 85 RocketGit: Error: you have no IPs validated; run 'ssh rocketgit@ssh.rocketgit.com totp' for help RocketGit: Error: you have no IPs validated; run 'ssh rocketgit@ssh.rocketgit.com totp' for help
File duilder.conf changed (mode: 100644) (index 92da4d4..b791516)
1 1 PRJ="rocketgit" PRJ="rocketgit"
2 VER="0.77"
2 VER="0.78"
3 3 REV="1" REV="1"
4 4 SHORT_DESCRIPTION="Light and fast Git hosting solution" SHORT_DESCRIPTION="Light and fast Git hosting solution"
5 5 EXCLUDE=".exclude" EXCLUDE=".exclude"
File inc/conn.inc.php changed (mode: 100644) (index 8110d34..53d4d9b)
... ... function rg_conn_shutdown($key, $what)
28 28 return; return;
29 29
30 30 if (($what == 0) || ($what == 2)) if (($what == 0) || ($what == 2))
31 $rg_conns[$key]['shutdow_read'] = 1;
31 $rg_conns[$key]['shutdown_read'] = 1;
32 32
33 33 if (($what == 1) || ($what == 2)) if (($what == 1) || ($what == 2))
34 $rg_conns[$key]['shutdow_write'] = 1;
34 $rg_conns[$key]['shutdown_write'] = 1;
35 35
36 @socket_shutdown($rg_conns[$key]['socket'], $what);
37 rg_log($key . ': shutdown ' . $what);
36 rg_log($key . ': marking socket for shutdown ' . $what);
38 37 } }
39 38
40 39 /* /*
 
... ... function rg_conn_destroy($key)
51 50 rg_log($key . ': bytes_recv=' . $rg_conns[$key]['bytes_recv'] rg_log($key . ': bytes_recv=' . $rg_conns[$key]['bytes_recv']
52 51 . ' bytes_sent=' . $rg_conns[$key]['bytes_sent']); . ' bytes_sent=' . $rg_conns[$key]['bytes_sent']);
53 52
54 if ($rg_conns[$key]['exit_on_close']) {
55 rg_log($key . ': exit_on_close is set, so exit');
56 exit(1);
57 }
53 @socket_close($rg_conns[$key]['socket']);
58 54
59 55 if (isset($rg_conns[$key]['func_destroy'])) if (isset($rg_conns[$key]['func_destroy']))
60 56 $rg_conns[$key]['func_destroy']($key); $rg_conns[$key]['func_destroy']($key);
 
... ... function rg_conn_destroy($key)
66 62 if (isset($rg_conns[$key]['socket'])) if (isset($rg_conns[$key]['socket']))
67 63 if (is_resource($rg_conns[$key]['socket'])) if (is_resource($rg_conns[$key]['socket']))
68 64 @socket_close($rg_conns[$key]['socket']); @socket_close($rg_conns[$key]['socket']);
65
66 if ($rg_conns[$key]['exit_on_close']) {
67 rg_log($key . ': exit_on_close is set, so exit');
68 exit(1);
69 }
70
69 71 unset($rg_conns[$key]); unset($rg_conns[$key]);
70 72 } }
71 73
 
... ... function rg_conn_send($key)
147 149 } }
148 150
149 151 $s['send'] = substr($s['send'], $r); $s['send'] = substr($s['send'], $r);
150 if (empty($s['send']))
152 if (empty($s['send'])) {
151 153 unset($rg_events['w'][$key]); unset($rg_events['w'][$key]);
154 if ($s['shutdown_write'] == 1) {
155 @socket_shutdown($s['socket'], 1 /*writing*/);
156 rg_log($key . ': shutdown write');
157 }
158 }
152 159
153 160 $s['bytes_sent'] += $r; $s['bytes_sent'] += $r;
154 161
File inc/struct.inc.php changed (mode: 100644) (index 1a5f424..e5d0784)
... ... $rg_sql_struct[50]['other'] = array(
786 786 $rg_sql_struct_parts['payments_history'] = array(); $rg_sql_struct_parts['payments_history'] = array();
787 787 // Here 0.77 was released // Here 0.77 was released
788 788
789 // Here 0.78 was released
790
789 791 // Do not forget to add the new created tables to statistics. Where? // Do not forget to add the new created tables to statistics. Where?
790 792
791 793 // The next line must be after all rg_sql_struct* definitions. // The next line must be after all rg_sql_struct* definitions.
File inc/util.inc.php changed (mode: 100644) (index f577923..285f642)
... ... function rg_socket_recv_wait($socket, $wait, $timeout)
2312 2312 break; break;
2313 2313
2314 2314 $tv_sec = intval($t - $limit); $tv_sec = intval($t - $limit);
2315 $tv_usec = (($t - $limit) * 1000) % 1000;
2315 $tv_usec = intval(($t - $limit) * 1000) % 1000;
2316 2316 } }
2317 2317
2318 2318 rg_prof_end('socket_recv_wait'); rg_prof_end('socket_recv_wait');
File rocketgit.spec changed (mode: 100644) (index 65585c4..7cf5090)
6 6
7 7 Summary: Light and fast Git hosting solution Summary: Light and fast Git hosting solution
8 8 Name: rocketgit Name: rocketgit
9 Version: 0.77
9 Version: 0.78
10 10 Release: 1 Release: 1
11 11 License: AGPLv3+ License: AGPLv3+
12 12 Group: Development/Tools Group: Development/Tools
 
... ... for type in %{selinux_variants}; do
54 54 /usr/sbin/semodule -s ${type} -i \ /usr/sbin/semodule -s ${type} -i \
55 55 /usr/share/selinux/${type}/rocketgit.pp &> /dev/null || : /usr/share/selinux/${type}/rocketgit.pp &> /dev/null || :
56 56 done done
57 [ -r /tmp/rgsdebug ] && echo "fixfiles -R..."
58 /sbin/fixfiles -R %{name} restore || :
59 # restorecon is needed because fixfiles -R will not restore the locks!
60 [ -r /tmp/rgsdebug ] && echo "restorecon -R..."
61 [ -r /tmp/rgsdebug ] && echo "restorecon -R /var/lib/rocketgit was disabled because it takes too much time"
62 #/sbin/restorecon -R /var/lib/rocketgit || :
57 if [ $1 -eq 1 ]; then
58 # First install
59 [ -r /tmp/rgsdebug ] && echo "fixfiles -R..."
60 /sbin/fixfiles -R %{name} restore || :
61
62 # restorecon is needed because fixfiles -R will not restore the locks!
63 [ -r /tmp/rgsdebug ] && echo "restorecon -R /var/lib/rocketgit..."
64 /sbin/restorecon -R /var/lib/rocketgit || :
65 fi
66 /sbin/restorecon -R /etc/rocketgit
67 /sbin/restorecon -R /usr/share/rocketgit
68 /sbin/restorecon -R /var/log/rocketgit
69 /sbin/restorecon /var/lib/rocketgit
70 /sbin/restorecon /var/lib/rocketgit/*
63 71
64 72 [ -r /tmp/rgsdebug ] && echo "systemd_post fpm..." [ -r /tmp/rgsdebug ] && echo "systemd_post fpm..."
65 73 echo "systemd_post fpm..." echo "systemd_post fpm..."
File samples/nginx.conf changed (mode: 100644) (index c115778..1955e09)
... ... server {
59 59 proxy_set_header X-Original-IP $remote_addr/$remote_port; proxy_set_header X-Original-IP $remote_addr/$remote_port;
60 60 proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
61 61 proxy_set_header Connection "upgrade"; proxy_set_header Connection "upgrade";
62 proxy_read_timeout 30;
62 proxy_read_timeout 3600;
63 63 proxy_buffering off; proxy_buffering off;
64 64 } }
65 65
File scripts/rgfs.php changed (mode: 100644) (index 035ac3c..993a56d)
... ... require_once(__DIR__ . '/../inc/rgfs.inc.php');
21 21 require_once(__DIR__ . '/../inc/user/packages.inc.php'); require_once(__DIR__ . '/../inc/user/packages.inc.php');
22 22
23 23 define('RGFS_EPERM', 1); define('RGFS_EPERM', 1);
24 //define('RGFS_EACCESS', ?);
24 //define('RGFS_EACCESS', 2);
25 25 define('RGFS_ENOENT', 2); define('RGFS_ENOENT', 2);
26 26 define('RGFS_EIO', 5); define('RGFS_EIO', 5);
27 27 define('RGFS_EINVAL', 22); define('RGFS_EINVAL', 22);
28 define('RGFS_ENOTSUP', 95);
28 29
29 30 $rg_fs_ver = 0x01; $rg_fs_ver = 0x01;
30 31
 
... ... function rgfs_validate_and_store_meta($add_path, $remove_path, &$s)
170 171 return $ret; return $ret;
171 172 } }
172 173
174 function send_fatal_error(string $key, string $msg)
175 {
176 debug($key, $msg);
177 $p2 = pack('C', 0xFF); // fatal error
178 $p = pack('N', strlen($p2)) . $p2;
179 //debug($key, ' DEBUG: p: ' . $p);
180 rg_conn_enq($key, $p);
181 rg_conn_shutdown($key, 2 /* 1=write, 2=read/write */);
182 }
183
173 184 /* /*
174 185 * Dispatch a command from a worker (one json) * Dispatch a command from a worker (one json)
175 186 */ */
 
... ... function xdispatch_one($key, $tlv)
220 231 foreach ($list as $k) { foreach ($list as $k) {
221 232 // Stupid php // Stupid php
222 233 if (!isset($a[$k])) { if (!isset($a[$k])) {
223 debug($key, 'Client did not sent [' . $k . ']!');
224 rg_conn_shutdown($key, 2);
234 send_fatal_error($key,
235 'Client did not sent [' . $k . ']!');
225 236 return; return;
226 237 } }
227 238 // Stupid php: 'empty('0') is true'! // Stupid php: 'empty('0') is true'!
228 239 if (strcmp($a[$k], '0') == 0) if (strcmp($a[$k], '0') == 0)
229 240 continue; continue;
230 241 if (empty($a[$k])) { if (empty($a[$k])) {
231 debug($key, 'Client did sent empty [' . $k . ']!');
232 rg_conn_shutdown($key, 2);
242 send_fatal_error($key,
243 'Client did sent empty [' . $k . ']!');
233 244 return; return;
234 245 } }
235 246 } }
 
... ... function xdispatch_one($key, $tlv)
237 248 if ($a['uid'] > 0) { if ($a['uid'] > 0) {
238 249 $job_ui = rg_user_info($s['db'], $a['uid'], '', ''); $job_ui = rg_user_info($s['db'], $a['uid'], '', '');
239 250 if ($job_ui['exists'] != 1) { if ($job_ui['exists'] != 1) {
240 debug($key, 'invalid user id ' . $a['uid']);
241 rg_conn_shutdown($key, 2);
251 send_fatal_error($key,
252 'invalid user id ' . $a['uid']);
242 253 return; return;
243 254 } }
244 255 $a['job_username'] = $job_ui['username']; $a['job_username'] = $job_ui['username'];
 
... ... function xdispatch_one($key, $tlv)
246 257
247 258 $pri = rg_pkg_repo_info($s['db'], $a['uid'], $a['pkg_repo_id']); $pri = rg_pkg_repo_info($s['db'], $a['uid'], $a['pkg_repo_id']);
248 259 if ($pri['exists'] != 1) { if ($pri['exists'] != 1) {
249 debug($key, $pri['errmsg']);
250 rg_conn_shutdown($key, 2);
260 send_fatal_error($key, $pri['errmsg']);
251 261 return; return;
252 262 } }
253 263 if (strcmp($pri['rgfs_key'], $a['key']) != 0) { if (strcmp($pri['rgfs_key'], $a['key']) != 0) {
254 debug($key, 'rgfs key does not match'
264 send_fatal_error($key,
265 'rgfs key does not match'
255 266 . ' [' . substr($pri['rgfs_key'], 0, 1) . ']' . ' [' . substr($pri['rgfs_key'], 0, 1) . ']'
256 267 . ' != [' . substr($a['key'], 0, 1) . ']!'); . ' != [' . substr($a['key'], 0, 1) . ']!');
257 rg_conn_shutdown($key, 2);
258 268 return; return;
259 269 } }
260 270 // If it is a user pkg repo, for now, we allow only the owner. // If it is a user pkg repo, for now, we allow only the owner.
 
... ... function xdispatch_one($key, $tlv)
262 272 debug($key, 'uid does not match pri=' . $pri['uid'] debug($key, 'uid does not match pri=' . $pri['uid']
263 273 . ' != ' . $a['uid'] . '!'); . ' != ' . $a['uid'] . '!');
264 274 /* /*
265 rg_conn_shutdown($key, 2);
275 send_fatal_error($key, 'invalid pkg repo id');
266 276 return; return;
267 277 TODO: if a user knows the key of the rgfs, we will allow her! */ TODO: if a user knows the key of the rgfs, we will allow her! */
268 278 } }
 
... ... function xdispatch_one($key, $tlv)
270 280
271 281 $sri = rg_pkg_subrepo_info($s['db'], $a['uid'], $a['pkg_subrepo_id']); $sri = rg_pkg_subrepo_info($s['db'], $a['uid'], $a['pkg_subrepo_id']);
272 282 if ($sri['exists'] != 1) { if ($sri['exists'] != 1) {
273 debug($key, $sri['errmsg']);
274 rg_conn_shutdown($key, 2);
283 send_fatal_error($key, $sri['errmsg']);
275 284 return; return;
276 285 } }
277 286 if ($sri['pkg_repo_id'] != $a['pkg_repo_id']) { if ($sri['pkg_repo_id'] != $a['pkg_repo_id']) {
278 debug($key, 'pkg_subrepo_id is not a child of pkg_repo_id!');
279 rg_conn_shutdown($key, 2);
287 send_fatal_error($key,
288 'pkg_subrepo_id is not a child of pkg_repo_id!');
280 289 return; return;
281 290 } }
282 291
 
... ... function xdispatch_one($key, $tlv)
284 293 if ($a['repo_id'] > 0) { if ($a['repo_id'] > 0) {
285 294 $ri = rg_repo_info($s['db'], $a['repo_id'], 0, ''); $ri = rg_repo_info($s['db'], $a['repo_id'], 0, '');
286 295 if ($ri['exists'] != 1) { if ($ri['exists'] != 1) {
287 debug($key, 'non-existing/no access repo id ' . $a['repo_id']);
288 rg_conn_shutdown($key, 2);
296 send_fatal_error($key,
297 'non-existing/no access repo id ' . $a['repo_id']);
289 298 return; return;
290 299 } }
291 300
 
... ... function xdispatch_one($key, $tlv)
294 303 debug($key, 'invalid repo_id: its uid is ' . $ri['uid'] debug($key, 'invalid repo_id: its uid is ' . $ri['uid']
295 304 . ' but job\'s uid is ' . $a['uid']); . ' but job\'s uid is ' . $a['uid']);
296 305 /* /*
297 rg_conn_shutdown($key, 2);
306 send_fatal_error($key, 'bla');
298 307 return; return;
299 308 TODO: user is authenticated, we will allow her */ TODO: user is authenticated, we will allow her */
300 309 } }
301 310
302 311 $repo_ui = rg_user_info($s['db'], $ri['uid'], '', ''); $repo_ui = rg_user_info($s['db'], $ri['uid'], '', '');
303 312 if ($repo_ui['exists'] != 1) { if ($repo_ui['exists'] != 1) {
304 debug($key, 'invalid user id ' . $ri['uid']);
305 rg_conn_shutdown($key, 2);
313 send_fatal_error($key,
314 'invalid user id ' . $ri['uid']);
306 315 return; return;
307 316 } }
308 317 $a['repo_uid'] = $ri['uid']; // TODO: propagate it to worker script $a['repo_uid'] = $ri['uid']; // TODO: propagate it to worker script
 
... ... function xdispatch_one($key, $tlv)
349 358 if (!file_exists($s['dir'])) { if (!file_exists($s['dir'])) {
350 359 $r = @mkdir($s['dir'], 0700, TRUE); $r = @mkdir($s['dir'], 0700, TRUE);
351 360 if ($r === FALSE) { if ($r === FALSE) {
352 debug($key, 'cannot create main dir: '
361 send_fatal_error($key,
362 'cannot create main dir: '
353 363 . rg_php_err()); . rg_php_err());
354 rg_conn_shutdown($key, 2);
355 364 return; return;
356 365 } }
357 366 } }
 
... ... function xdispatch_one($key, $tlv)
850 859 // We will not respect it for now. Ever? // We will not respect it for now. Ever?
851 860 break; break;
852 861
862 // 0x12 is generic variable
863
864 case 0x13: // getxattr
865 $t = @unpack('ntarget_len/nattr_name_len', $tlv['data']);
866 if ($t === FALSE) {
867 debug($key, 'unpack error: ' . rg_php_err());
868 $p2 .= pack('CN', 0x00, RGFS_EPERM);
869 break;
870 }
871
872 $t = @unpack('a' . $t['target_len'] . 'target/a'
873 . $t['attr_name_len'] . 'attr_name', $tlv['data'], 2 + 2);
874 if ($t === FALSE) {
875 debug($key, 'unpack error: ' . rg_php_err());
876 $p2 .= pack('CN', 0x00, RGFS_EPERM);
877 break;
878 }
879
880 debug($key, 'getxattr target=[' . $t['target'] . ']'
881 . ' attr_name=[' . $t['attr_name'] . ']');
882
883 $r = rgfs_validate($t['target'], $s);
884 if ($r['ok'] != 1) {
885 debug($key, $r['errmsg']);
886 $p2 .= pack('CN', 0x00, RGFS_EPERM);
887 break;
888 }
889
890 // For now, we return that they are not supported
891 $p2 .= pack('CN', 0x00, RGFS_ENOTSUP);
892 // todo $p2 .= pack('C', 0x01) . len_of_attr;
893 break;
894
853 895 default: default:
854 896 debug($key, 'invalid command: ' . rg_array2string($tlv)); debug($key, 'invalid command: ' . rg_array2string($tlv));
855 rg_conn_shutdown($key, 2);
897 send_fatal_error($key, 'invalid command');
856 898 return; return;
857 899 } }
858 900
Date/time (UTC) Type Misc Labels
2023-06-15 19:38 build fedora-38-x86_64 worker/r1 builder/color=fff worker_elap/3541s wait_time/50102s date/2023-06-15 time/04:43
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