List of commits:
Subject Hash Author Date (UTC)
TODO/cosmetic d4968bc1d9c8bbe3c4aba2479f3694a7a3863d0f Catalin(ux) M. BOIE 2021-11-17 18:04:36
More debug help 74f45188bffd7630d0c08648433749a3ef23c9af Catalin(ux) M. BOIE 2021-11-15 17:34:58
worker: Fixed a stupid bug leading to wrong distro upgrade command d9bc215557cd9a6f30dbc90434dc3aba46e39979 Catalin(ux) M. BOIE 2021-11-14 16:16:43
Silence an 'unpack' exception when we do not have enough bytes. add562b15d94501a0585001db526b241c251b6e6 Catalin(ux) M. BOIE 2021-11-14 11:25:01
Run struct and fixes under the same lock d046942317c73351473a18eb833318aec3f4d907 Catalin(ux) M. BOIE 2021-11-14 08:18:05
spec file small updates 7aef02df6ed5f6ce4d39cd2a926a79bcdc1a3c5a Catalin(ux) M. BOIE 2021-11-14 06:33:35
Typo b0087441b4d637c7bf6ed64b6c243ad2ec8f1493 Catalin(ux) M. BOIE 2021-11-14 06:15:00
spec: Added 'Replaces: rocketgit' to easy upgrade, fixed fixfiles c380f40fe86ddf70b99030a6f0be93d91137b909 Catalin(ux) M. BOIE 2021-11-14 06:14:25
Fixed non debug case of rg_debug_html 523f6784671e5f810b8435ad66ad21ea548219d8 Catalin(ux) M. BOIE 2021-11-14 05:58:37
Fix rate limit types 0de3ee35d0d0e46521d64a596232765fb5d618a3 Catalin(ux) M. BOIE 2021-11-14 05:58:03
commented request_slowlog_timeout 505877b567807e11f25695de58725f316f10043e Catalin(ux) M. BOIE 2021-11-13 17:32:46
systemctl git.socket rethinking 3c71e58760f6abc69db661098840c277d4fc13fb Catalin(ux) M. BOIE 2021-11-13 17:25:52
PHP FALSE verus NULL correction 42f8bc560a0ec2203f0974e203e6c33ec26aa983 Catalin(ux) M. BOIE 2021-11-13 16:31:33
.spec: some minor corrections 70c3a23f507d57c729e0d710ec99060e0e88c238 Catalin(ux) M. BOIE 2021-11-13 16:22:11
Rework locking for struct update da8c09e15e485563d9573de3aff2a7ad999d2527 Catalin(ux) M. BOIE 2021-11-13 16:15:45
gpg: specify rsa 4096 instead of default because it does not work on f34 eccdc02a82ce87f426eebc995988f907d914a3c7 Catalin(ux) M. BOIE 2021-11-13 16:15:15
Cosmetic 0b0a9f2d1922d4d28052c6b1fbe737cc4302ce73 Catalin(ux) M. BOIE 2021-11-13 16:14:37
PHP8 corrections 51f2cabc7298b5006bf8f0d215c1a338bee92cdb Catalin(ux) M. BOIE 2021-11-13 16:13:13
.spec: require openldap-servers to test LDAP 84e469d5d9fe81509ff3421bdb6517786ea96628 Catalin(ux) M. BOIE 2021-11-06 20:09:07
Cosmetic a4543d8257235dc5c93dd5eecdfb9caa3c2acafa Catalin(ux) M. BOIE 2021-11-02 07:04:36
Commit d4968bc1d9c8bbe3c4aba2479f3694a7a3863d0f - TODO/cosmetic
Author: Catalin(ux) M. BOIE
Author date (UTC): 2021-11-17 18:04
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2021-11-17 18:04
Parent(s): 74f45188bffd7630d0c08648433749a3ef23c9af
Signer:
Signing key:
Signing status: N
Tree: 22dd2388382aaf5bce54aae5fce1d26342af393f
File Lines added Lines deleted
TODO 6 0
inc/admin.inc.php 1 1
inc/bug.inc.php 3 3
inc/fixes.inc.php 5 5
inc/git.inc.php 5 5
inc/keys.inc.php 1 1
inc/repo.inc.php 2 2
inc/user.inc.php 2 2
inc/user/packages_rpm.inc.php 1 1
inc/wh/http/matrix.inc.php 1 1
scripts/builder.php 2 2
scripts/rgfs.php 3 1
scripts/worker.php 75 39
techdocs/rpm.txt 7 4
File TODO changed (mode: 100644) (index a1757bd..9acb01e)
60 60 Seems we are cloning the namespace, before knowing if the user can push! Seems we are cloning the namespace, before knowing if the user can push!
61 61
62 62 == FOR OTHER RELEASE == == FOR OTHER RELEASE ==
63 [ ] Seems we install dependencies from spec file twice!
64 [ ] worker: should I tunnel rgfs over the worker connection?
65 [ ] worker: stats - send also the number of bytes sent/received with builder
66 and git clone?
67 [ ] At push time, I can see if any webhook will match and I can list them!
68 [ ] Should we 'cut' root access for user workers? Same for net access.
63 69 [ ] Validate that URL is UTF-8. [ ] Validate that URL is UTF-8.
64 70 [ ] worker: prevent http:// instalation of packages. [ ] worker: prevent http:// instalation of packages.
65 71 [ ] SELinux: upgrade: I think I remove the module after the installation of [ ] SELinux: upgrade: I think I remove the module after the installation of
File inc/admin.inc.php changed (mode: 100644) (index adcc33d..7709d32)
... ... function rg_admin_mails_invites_high_level($db, $rg)
452 452 function rg_init($db, $rg) function rg_init($db, $rg)
453 453 { {
454 454 rg_prof_start("rg_init"); rg_prof_start("rg_init");
455 rg_log_enter("rg_init");
455 rg_log_enter('init');
456 456
457 457 $ret = ''; $ret = '';
458 458
File inc/bug.inc.php changed (mode: 100644) (index c7b7bc1..3c23c5b)
... ... function rg_bug_search_load($db, $repo_id, $uid, $name)
715 715 function rg_bug_search_save($db, $repo_id, $uid, $q) function rg_bug_search_save($db, $repo_id, $uid, $q)
716 716 { {
717 717 rg_prof_start("bug_search_save"); rg_prof_start("bug_search_save");
718 rg_log_enter("rg_bug_search_save: repo_id=$repo_id uid=$uid"
719 . " q=" . rg_array2string($q));
718 rg_log_enter('bug_search_save: repo_id=' . $repo_id . ' uid=' . $uid
719 . ' q=' . rg_array2string($q));
720 720
721 721 $ret = FALSE; $ret = FALSE;
722 722 while (1) { while (1) {
 
... ... function rg_bug_label_html($db, $labels)
1219 1219 */ */
1220 1220 function rg_bug_edit_high_level($db, &$rg) function rg_bug_edit_high_level($db, &$rg)
1221 1221 { {
1222 rg_log_enter("rg_bug_edit_high_level");
1222 rg_log_enter('bug_edit_high_level');
1223 1223 rg_log_debug('rg: ' . print_r($rg, TRUE)); rg_log_debug('rg: ' . print_r($rg, TRUE));
1224 1224
1225 1225 $ret = ""; $ret = "";
File inc/fixes.inc.php changed (mode: 100644) (index 48d7100..6188ed4)
... ... $rg_fixes_ver = count($rg_fixes);
61 61 */ */
62 62 function rg_fixes_repos_last_bug_id($db) function rg_fixes_repos_last_bug_id($db)
63 63 { {
64 rg_log_enter("rg_fixes_repos_last_bug_id");
64 rg_log_enter('fixes_repos_last_bug_id');
65 65
66 66 $ret = FALSE; $ret = FALSE;
67 67 while (1) { while (1) {
 
... ... function rg_fixes_wh_ver5($db)
576 576 */ */
577 577 function rg_fixes_repos_last_mr_id($db) function rg_fixes_repos_last_mr_id($db)
578 578 { {
579 rg_log_enter('rg_fixes_repos_last_mr_id');
579 rg_log_enter('fixes_repos_last_mr_id');
580 580
581 581 $error = FALSE; $error = FALSE;
582 582 $ret = FALSE; $ret = FALSE;
 
... ... function rg_fixes_repos_last_mr_id($db)
662 662 */ */
663 663 function rg_fixes_drop_if_exists($db) function rg_fixes_drop_if_exists($db)
664 664 { {
665 rg_log_enter('rg_fixes_drop_if_exists');
665 rg_log_enter('fixes_drop_if_exists');
666 666
667 667 $ret = TRUE; $ret = TRUE;
668 668 $list = array( $list = array(
 
... ... function rg_fixes_drop_if_exists($db)
692 692 */ */
693 693 function rg_fixes_fingerprint_sha256($db) function rg_fixes_fingerprint_sha256($db)
694 694 { {
695 rg_log_enter('rg_fixes_fingerprint_sha256');
695 rg_log_enter('fixes_fingerprint_sha256');
696 696
697 697 $ret = TRUE; $ret = TRUE;
698 698 while (1) { while (1) {
 
... ... function rg_fixes_fingerprint_sha256($db)
776 776 */ */
777 777 function rg_fixes_remove_cr($db) function rg_fixes_remove_cr($db)
778 778 { {
779 rg_log_enter('rg_fixes_remove_cr');
779 rg_log_enter('fixes_remove_cr');
780 780
781 781 $ret = FALSE; $ret = FALSE;
782 782 while (1) { while (1) {
File inc/git.inc.php changed (mode: 100644) (index d627a04..60c2814)
... ... function rg_git_shortlog($repo_path, $a, $b)
780 780 function rg_git_ls_tree($repo_path, $tree, $path) function rg_git_ls_tree($repo_path, $tree, $path)
781 781 { {
782 782 rg_prof_start("git_ls_tree"); rg_prof_start("git_ls_tree");
783 rg_log_enter("rg_git_ls_tree: repo_path=$repo_path"
784 . " tree=$tree path=$path");
783 rg_log_enter('git_ls_tree: repo_path=' . $repo_path
784 . ' tree=' . $tree . ' path=' . $path);
785 785
786 786 $ret = FALSE; $ret = FALSE;
787 787 while (1) { while (1) {
 
... ... function rg_git_files($old, $new)
1710 1710 global $rg_git_empty; global $rg_git_empty;
1711 1711
1712 1712 rg_prof_start("git_files"); rg_prof_start("git_files");
1713 rg_log_enter("rg_git_files old=$old new=$new");
1713 rg_log_enter('git_files old=' . $old . ' new=' . $new);
1714 1714
1715 1715 $ret = FALSE; $ret = FALSE;
1716 1716 while (1) { while (1) {
 
... ... function rg_git_parse_ref(&$paras)
2324 2324 function rg_git_diff_tree($tree1, $tree2) function rg_git_diff_tree($tree1, $tree2)
2325 2325 { {
2326 2326 rg_prof_start("git_diff_tree"); rg_prof_start("git_diff_tree");
2327 rg_log_enter("rg_git_diff_tree: tree1=$tree1 tree2=$tree2");
2327 rg_log_enter('git_diff_tree: tree1=' . $tree1 . ' tree2=' . $tree2);
2328 2328
2329 2329 $ret = FALSE; $ret = FALSE;
2330 2330 while (1) { while (1) {
 
... ... function rg_git_merge_tree($repo_path, $base, $a, $b)
2531 2531 global $rg_git_empty; global $rg_git_empty;
2532 2532
2533 2533 rg_prof_start('git_merge_tree'); rg_prof_start('git_merge_tree');
2534 rg_log_enter('rg_git_merge_tree base='
2534 rg_log_enter('git_merge_tree base='
2535 2535 . $base . ' a=' . $a . ' b=' . $b); . $base . ' a=' . $a . ' b=' . $b);
2536 2536
2537 2537 $ret = FALSE; $ret = FALSE;
File inc/keys.inc.php changed (mode: 100644) (index 29e5fd6..e61ae33)
... ... function rg_keys_weak($db, $ki)
197 197 function rg_keys_info($key) function rg_keys_info($key)
198 198 { {
199 199 rg_prof_start("keys_info"); rg_prof_start("keys_info");
200 rg_log_enter('rg_keys_info key=' . $key);
200 rg_log_enter('keys_info key=' . $key);
201 201
202 202 $ret = array(); $ret = array();
203 203 $ret['ok'] = 0; $ret['ok'] = 0;
File inc/repo.inc.php changed (mode: 100644) (index 4cf7435..8a47e7f)
... ... function rg_repo_nice($db, $repo_id)
1659 1659 */ */
1660 1660 function rg_repo_edit_high_level($db, &$rg) function rg_repo_edit_high_level($db, &$rg)
1661 1661 { {
1662 rg_log_enter("rg_repo_edit_high_level");
1662 rg_log_enter('repo_edit_high_level');
1663 1663
1664 1664 $ret = ""; $ret = "";
1665 1665
 
... ... function rg_repo_edit_high_level($db, &$rg)
1778 1778 */ */
1779 1779 function rg_repo_lock_high_level($db, &$rg) function rg_repo_lock_high_level($db, &$rg)
1780 1780 { {
1781 rg_log_enter("rg_repo_lock_high_level");
1781 rg_log_enter('repo_lock_high_level');
1782 1782
1783 1783 $ret = ""; $ret = "";
1784 1784
File inc/user.inc.php changed (mode: 100644) (index 51f292d..bb99223)
... ... function rg_user_login_by_user_pass($db, $user, $pass, $login_token,
1333 1333 $lock_ip, $https, $domain) $lock_ip, $https, $domain)
1334 1334 { {
1335 1335 rg_prof_start('user_login_by_user_pass'); rg_prof_start('user_login_by_user_pass');
1336 rg_log_enter('rg_user_login_by_user_pass');
1336 rg_log_enter('user_login_by_user_pass');
1337 1337
1338 1338 do { do {
1339 1339 $ret = rg_user_login_by_user_pass_helper($db, $user, $pass, $ret = rg_user_login_by_user_pass_helper($db, $user, $pass,
 
... ... function rg_process_input($content_length, $content_encoding, &$err)
2372 2372 */ */
2373 2373 function rg_user_http_git_cb_input($index, &$a, $stream) function rg_user_http_git_cb_input($index, &$a, $stream)
2374 2374 { {
2375 rg_log_enter('rg_user_http_git_cb_input');
2375 rg_log_enter('user_http_git_cb_input');
2376 2376
2377 2377 switch ($stream) { switch ($stream) {
2378 2378 case 1: // stdout case 1: // stdout
File inc/user/packages_rpm.inc.php changed (mode: 100644) (index 0733757..9f4a3b1)
... ... function rg_pkg_event_generate_dotrepo_rpm_callback($db, $ev)
73 73 */ */
74 74 function rg_pkg_prepare_ev_for_dotrepo($db, &$ev) function rg_pkg_prepare_ev_for_dotrepo($db, &$ev)
75 75 { {
76 rg_log_enter('rg_pkg_prepare_ev_for_dotrepo');
76 rg_log_enter('pkg_prepare_for_dotrepo');
77 77
78 78 $ret = array('ok' => 0); $ret = array('ok' => 0);
79 79 do { do {
File inc/wh/http/matrix.inc.php changed (mode: 100644) (index 4426c43..178f368)
... ... function rg_wh_matrix_fill_vars(&$rg, &$junk)
14 14
15 15 function rg_wh_matrix_send($db, $ev) function rg_wh_matrix_send($db, $ev)
16 16 { {
17 rg_log_enter('rg_wh_matrix_send');
17 rg_log_enter('wh_matrix_send');
18 18 //rg_log_debug('wh_matrix_send: ev: ' . rg_array2string($ev)); //rg_log_debug('wh_matrix_send: ev: ' . rg_array2string($ev));
19 19
20 20 $ret = FALSE; $ret = FALSE;
File scripts/builder.php changed (mode: 100644) (index ff7d9e6..745687f)
... ... function xdispatch_one($key, $data)
177 177 if ($u === NULL) { if ($u === NULL) {
178 178 $m = 'cannot decode JSON: ' . json_last_error_msg(); $m = 'cannot decode JSON: ' . json_last_error_msg();
179 179 $err = array('errstr' => $m); $err = array('errstr' => $m);
180 rg_log_ml($key . ': data=[' . $data . ']' . $m);
180 rg_log_ml($key . ': data=[' . $data . ']: ' . $m);
181 181 rg_conn_enq($key, json_encode($err) . "\n"); rg_conn_enq($key, json_encode($err) . "\n");
182 182 rg_conn_shutdown($key, 2); rg_conn_shutdown($key, 2);
183 183 break; break;
 
... ... function xdispatch_one($key, $data)
194 194 } }
195 195
196 196 $op = $u['op']; unset($u['op']); $op = $u['op']; unset($u['op']);
197 rg_log($key . ': op=' . $op);
197 rg_log_debug($key . ': op=' . $op);
198 198
199 199 if (strcmp($op, 'ANN') == 0) { if (strcmp($op, 'ANN') == 0) {
200 200 if (($u['boot_time'] < $now - 30) || ($u['boot_time'] > $now + 30)) { if (($u['boot_time'] < $now - 30) || ($u['boot_time'] > $now + 30)) {
File scripts/rgfs.php changed (mode: 100644) (index a6b5bdf..ef70564)
... ... function xdispatch_one($key, $tlv)
336 336 return; return;
337 337 } }
338 338 if (strcmp($pri['rgfs_key'], $a['key']) != 0) { if (strcmp($pri['rgfs_key'], $a['key']) != 0) {
339 debug($key, 'rgfs key does not match!');
339 debug($key, 'rgfs key does not match'
340 . ' [' . substr($pri['rgfs_key'], 0, 1) . ']'
341 . ' != [' . substr($a['key'], 0, 1) . ']!');
340 342 rg_conn_shutdown($key, 2); rg_conn_shutdown($key, 2);
341 343 return; return;
342 344 } }
File scripts/worker.php changed (mode: 100644) (index a8d4a1e..7489a0c)
... ... function rg_worker_libvirt_rights($f, $mode, $user, $group, &$reason, &$reason2)
364 364 */ */
365 365 function start_worker_build_tools($job, &$reason, &$reason2) function start_worker_build_tools($job, &$reason, &$reason2)
366 366 { {
367 global $conf;
368
369 $e = $job['env'];
370 $env = $conf['env'][$e];
371
367 372 $s = '' $s = ''
368 373 . '#!/bin/bash' . "\n" . '#!/bin/bash' . "\n"
369 374 . "\n" . "\n"
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
378 383 . 'export env=' . escapeshellarg($job['env']) . "\n" . 'export env=' . escapeshellarg($job['env']) . "\n"
379 384 . 'export env_distro=' . escapeshellarg($job['env_distro']) . "\n" . 'export env_distro=' . escapeshellarg($job['env_distro']) . "\n"
380 385 . 'export env_major=' . escapeshellarg($job['env_major']) . "\n" . 'export env_major=' . escapeshellarg($job['env_major']) . "\n"
381 . 'export env_arch=' . escapeshellarg($job['env_arch']) . "\n";
386 . 'export env_arch=' . escapeshellarg($job['env_arch']) . "\n"
387 . 'export rg_pkg_cmd="' . $env['pkg_cmd'] . '"' . "\n"
388 . '# Debian/Ubuntu stuff' . "\n"
389 . 'export DEBIAN_FRONTEND=noninteractive' . "\n"
390 . 'export APT_LISTCHANGES_FRONTEND=none' . "\n\n";
382 391
383 392 if (isset($job['rgfs_server'])) if (isset($job['rgfs_server']))
384 $s .= ''
385 . 'export RGFS_SERVER=' . escapeshellarg($job['rgfs_server']) . "\n"
386 . 'export RGFS_PORT=' . escapeshellarg($job['rgfs_port']) . "\n"
387 . 'export RGFS_URL=' . escapeshellarg($job['rgfs_url']) . "\n"
388 . 'export RGFS_DEBUG=100' . "\n"
389 . 'export RGFS_name=' . 'wj' . $job['id'] . "\n"
390 . 'export RGFS_head=' . escapeshellarg($job['head']) . "\n"
391 . 'export RGFS_repo_id=' . escapeshellarg($job['repo_id']) . "\n"
392 . 'export RGFS_uid=' . escapeshellarg($job['uid']) . "\n"
393 . 'export RGFS_job_id=' . escapeshellarg($job['id']) . "\n"
394 . 'export RGFS_env=' . escapeshellarg($job['env']) . "\n"
395 . 'export RGFS_worker_id=' . escapeshellarg($job['worker_id']) . "\n"
396 . 'export RGFS_worker_name=' . escapeshellarg($job['worker_name']) . "\n"
397 . 'export RGFS_log_sid=' . $job['log_sid'] . "\n";
393 $s .= ''
394 . 'export RGFS_SERVER=' . escapeshellarg($job['rgfs_server']) . "\n"
395 . 'export RGFS_PORT=' . escapeshellarg($job['rgfs_port']) . "\n"
396 . 'export RGFS_URL=' . escapeshellarg($job['rgfs_url']) . "\n"
397 . 'export RGFS_DEBUG=100' . "\n"
398 . 'export RGFS_name=' . 'wj' . $job['id'] . "\n"
399 . 'export RGFS_head=' . escapeshellarg($job['head']) . "\n"
400 . 'export RGFS_repo_id=' . escapeshellarg($job['repo_id']) . "\n"
401 . 'export RGFS_uid=' . escapeshellarg($job['uid']) . "\n"
402 . 'export RGFS_job_id=' . escapeshellarg($job['id']) . "\n"
403 . 'export RGFS_env=' . escapeshellarg($job['env']) . "\n"
404 . 'export RGFS_worker_id=' . escapeshellarg($job['worker_id']) . "\n"
405 . 'export RGFS_worker_name=' . escapeshellarg($job['worker_name']) . "\n"
406 . 'export RGFS_log_sid=' . $job['log_sid'] . "\n";
407 else
408 $s .= '# rgfs_server is not defined' . "\n";
398 409
399 410 $s .= '' $s .= ''
400 . "\n"
401 . '# pkg_repo_id to uid translation' . "\n"
402 . 'declare -gA pri2uid=()' . "\n";
411 . "\n"
412 . '# pkg_repo_id to uid translation' . "\n"
413 . 'declare -gA pri2uid=()' . "\n";
403 414
404 415 $list = ''; $list_add = ''; $list = ''; $list_add = '';
405 416 if (isset($job['pkg_repos'])) { if (isset($job['pkg_repos'])) {
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
423 434 . "\n" . "\n"
424 435 . 'function rg_notify_err()' . "\n" . 'function rg_notify_err()' . "\n"
425 436 . '{' . "\n" . '{' . "\n"
426 . ' echo "E${@}" > /dev/virtio-ports/rgw' . "\n"
437 . ' echo "E${@}" > /dev/virtio-ports/rgw &' . "\n"
438 . ' echo "E${@}" >> /mnt/status/history' . "\n"
439 . '}' . "\n"
440 . "\n"
441 . 'function rg_notify_warn()' . "\n"
442 . '{' . "\n"
443 . ' echo "W${@}" > /dev/virtio-ports/rgw &' . "\n"
444 . ' echo "W${@}" >> /mnt/status/history' . "\n"
427 445 . '}' . "\n" . '}' . "\n"
428 446 . "\n" . "\n"
429 447 . 'rg_log_prefix=""' . "\n" . 'rg_log_prefix=""' . "\n"
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
568 586 . '{' . "\n" . '{' . "\n"
569 587 . ' local dir=${1}; shift' . "\n" . ' local dir=${1}; shift' . "\n"
570 588 . "\n" . "\n"
589 . ' rg_notify "Extracting .spec info"' . "\n"
571 590 . ' xecho "rg_extract_rpm_info: dir=${dir} [`date`]"' . "\n" . ' xecho "rg_extract_rpm_info: dir=${dir} [`date`]"' . "\n"
572 591 . ' spec_file=`find "${dir}" -iname \'*.spec\' -type f -printf "%d %p\n" | sort -n | head -n1 | awk \'{print $2}\'`' . "\n" . ' spec_file=`find "${dir}" -iname \'*.spec\' -type f -printf "%d %p\n" | sort -n | head -n1 | awk \'{print $2}\'`' . "\n"
573 592 . ' if [ "${spec_file}" = "" ]; then' . "\n" . ' if [ "${spec_file}" = "" ]; then' . "\n"
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
584 603 . ' spec_ver=`grep ^Version: "${spec_file}" | cut -d: -f2 | tr -d " \t\r\n"`' . "\n" . ' spec_ver=`grep ^Version: "${spec_file}" | cut -d: -f2 | tr -d " \t\r\n"`' . "\n"
585 604 . ' spec_rel=`grep ^Release: "${spec_file}" | cut -d: -f2 | tr -d " \t\r\n"`' . "\n" . ' spec_rel=`grep ^Release: "${spec_file}" | cut -d: -f2 | tr -d " \t\r\n"`' . "\n"
586 605 . ' spec_deps=`rpmspec --parse "${spec_file}" | grep ^BuildRequires | cut -d: -f2 | tr ",\t\r\n" " "`' . "\n" . ' spec_deps=`rpmspec --parse "${spec_file}" | grep ^BuildRequires | cut -d: -f2 | tr ",\t\r\n" " "`' . "\n"
606 . ' rg_notify "spec_deps: ${spec_deps}"' . "\n"
587 607 . ' xecho " DEBUG: name=${spec_name}, ver=${spec_ver}, rel=${spec_rel}"' . "\n" . ' xecho " DEBUG: name=${spec_name}, ver=${spec_ver}, rel=${spec_rel}"' . "\n"
588 608 . ' echo' . "\n" . ' echo' . "\n"
589 609 . '}' . "\n" . '}' . "\n"
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
652 672 . ' done' . "\n" . ' done' . "\n"
653 673 . ' rg_log_pop' . "\n" . ' rg_log_pop' . "\n"
654 674 . ' return ${E}' . "\n" . ' return ${E}' . "\n"
655 . '}' . "\n\n";
675 . '}' . "\n\n"
676 . 'mkdir -p /mnt/status' . "\n"
677 . 'touch /mnt/status/history' . "\n"
678 . 'chmod a+w /mnt/status/history' . "\n\n";
656 679
657 680 $f = $job['main'] . '/root/build_tools.sh'; $f = $job['main'] . '/root/build_tools.sh';
658 681 $r = @file_put_contents($f, $s); $r = @file_put_contents($f, $s);
 
... ... function start_worker_build_repo($job, $conf, &$reason, &$reason2)
863 886 . ' echo' . "\n" . ' echo' . "\n"
864 887 . ' rg_log_push "== prepare rpms phase ====="' . "\n" . ' rg_log_push "== prepare rpms phase ====="' . "\n"
865 888 . ' case "${env_distro}" in' . "\n" . ' case "${env_distro}" in' . "\n"
866 . ' fedora|centos)' . "\n"
889 . ' fedora|centos|rocky)' . "\n"
867 890 . ' for i in debug src os; do' . "\n" . ' for i in debug src os; do' . "\n"
868 891 . ' src0="/mnt/rpmbuild"' . "\n" . ' src0="/mnt/rpmbuild"' . "\n"
869 892 . ' src1="${src0}/RPMS"' . "\n" . ' src1="${src0}/RPMS"' . "\n"
 
... ... function start_worker_build_repo($job, $conf, &$reason, &$reason2)
930 953 . ' echo' . "\n" . ' echo' . "\n"
931 954 . ' rg_log_push "== create list and sign pkg_repo_id ${pkg_repo_id} ====="' . "\n" . ' rg_log_push "== create list and sign pkg_repo_id ${pkg_repo_id} ====="' . "\n"
932 955 . ' case "${env_distro}" in' . "\n" . ' case "${env_distro}" in' . "\n"
933 . ' fedora|centos)' . "\n"
956 . ' fedora|centos|rocky)' . "\n"
934 957 . ' for i in debug src os; do' . "\n" . ' for i in debug src os; do' . "\n"
935 958 . ' rg_log_push "== ${i} ====="' . "\n" . ' rg_log_push "== ${i} ====="' . "\n"
936 959 . ' dir="/mnt/build2/rpms/${pkg_repo_id}/${i}"' . "\n" . ' dir="/mnt/build2/rpms/${pkg_repo_id}/${i}"' . "\n"
 
... ... function start_worker_build_repo($job, $conf, &$reason, &$reason2)
957 980 $si = $job['pkg_subrepos'][$pkg_subrepo_id]; $si = $job['pkg_subrepos'][$pkg_subrepo_id];
958 981 $pkg_repo_id = $si['pkg_repo_id']; $pkg_repo_id = $si['pkg_repo_id'];
959 982 $ri = $job['pkg_repos'][$pkg_repo_id]; $ri = $job['pkg_repos'][$pkg_repo_id];
983 if (!isset($job['rgfs_server'])) {
984 $s .= '# rgfs not set' . "\n";
985 continue;
986 }
960 987 $s .= "\n" $s .= "\n"
961 988 . ' export pkg_repo_id=' . $pkg_repo_id . "\n" . ' export pkg_repo_id=' . $pkg_repo_id . "\n"
962 989 . ' export pkg_repo_uid=' . $ri['uid'] . "\n" . ' export pkg_repo_uid=' . $ri['uid'] . "\n"
 
... ... function start_worker_build_repo($job, $conf, &$reason, &$reason2)
980 1007 . ' rgfs_subrepo_root="/mnt/build2/rgfs/${pkg_repo_id}/${pkg_subrepo_id}"' . "\n" . ' rgfs_subrepo_root="/mnt/build2/rgfs/${pkg_repo_id}/${pkg_subrepo_id}"' . "\n"
981 1008 . ' xecho "DEBUG: env_distro=${env_distro}"' . "\n" . ' xecho "DEBUG: env_distro=${env_distro}"' . "\n"
982 1009 . ' case "${env_distro}" in' . "\n" . ' case "${env_distro}" in' . "\n"
983 . ' fedora|centos)' . "\n"
1010 . ' fedora|centos|rocky)' . "\n"
984 1011 . ' for i in os debug src; do' . "\n" . ' for i in os debug src; do' . "\n"
985 1012 . ' rgfs="${rgfs_subrepo_root}/${env_distro}/${env_major}/${env_arch}/${i}"' . "\n" . ' rgfs="${rgfs_subrepo_root}/${env_distro}/${env_major}/${env_arch}/${i}"' . "\n"
986 1013 . ' rpms_dir="/mnt/build2/rpms/${pkg_repo_id}/${i}"' . "\n" . ' rpms_dir="/mnt/build2/rpms/${pkg_repo_id}/${i}"' . "\n"
 
... ... function start_worker($job)
1282 1309 putenv($_env); putenv($_env);
1283 1310 $_s = time(); $_s = time();
1284 1311 $cmd = 'git clone' $cmd = 'git clone'
1312 . ' --verbose'
1313 //TODO . ' --single-branch --depth 1 --branch ' . escapeshellarg($job['head']) // not working because the head does not point to a branch; we need to use the ref
1285 1314 . ' --recurse-submodules' . ' --recurse-submodules'
1286 1315 //TODO . ' --shallow-submodules' //TODO . ' --shallow-submodules'
1287 1316 . ' --no-checkout' . ' --no-checkout'
 
... ... function start_worker($job)
1381 1410 $pkgs = explode(' ', $job['packages']); $pkgs = explode(' ', $job['packages']);
1382 1411 $p_i_cmd .= '> /mnt/packages.log' . "\n"; $p_i_cmd .= '> /mnt/packages.log' . "\n";
1383 1412
1384 // Debian/Ubuntu stuff
1385 $p_i_cmd .= 'export DEBIAN_FRONTEND=noninteractive' . "\n";
1386 $p_i_cmd .= 'export APT_LISTCHANGES_FRONTEND=none' . "\n";
1387
1388 1413 foreach ($pkgs as $p) { foreach ($pkgs as $p) {
1389 1414 $p_i_cmd .= '(' . "\n" $p_i_cmd .= '(' . "\n"
1390 . 'echo "=== ' . $p . ' ==="' . "\n"
1391 . $env['pkg_cmd']
1392 . ' ' . escapeshellarg($p) . "\n"
1415 . 'p=' . escapeshellarg($p) . "\n"
1416 . 'if [[ ${p} =~ :// ]]; then' . "\n"
1417 . ' rg_notify_warn "We do not allow remote packages for security reasons"' . "\n"
1418 . 'else' . "\n"
1419 . ' rg_notify "Installing package ${p}"' . "\n"
1420 . ' echo "=== ${p} ==="' . "\n"
1421 . ' ${rg_pkg_cmd} "${p}"' . "\n"
1422 . 'fi' . "\n"
1393 1423 . 'echo; echo' . "\n" . 'echo; echo' . "\n"
1394 1424 . ') >> /mnt/packages.log 2>&1' . "\n"; . ') >> /mnt/packages.log 2>&1' . "\n";
1395 1425 } }
 
... ... function start_worker($job)
1474 1504 . "\n" . "\n"
1475 1505 . 'while [ "${ERR}" = "" ]; do' . "\n" . 'while [ "${ERR}" = "" ]; do' . "\n"
1476 1506 . ' if [ "${job_url}" != "" ]; then' . "\n" . ' if [ "${job_url}" != "" ]; then' . "\n"
1507 . ' rg_notify "Checkout..."' . "\n"
1477 1508 . ' echo; echo "`date`: Checkout"' . "\n" . ' echo; echo "`date`: Checkout"' . "\n"
1478 . ' su - build -c "cd /mnt/target && git branch -f rgw ${job_head} && git checkout rgw"' . "\n"
1509 . ' su - build -c "cd /mnt/target && git branch -f rgw ${job_head} && git checkout --force rgw" >/mnt/status/checkout 2>&1' . "\n"
1479 1510 . ' if [ "${?}" != "0" ]; then' . "\n" . ' if [ "${?}" != "0" ]; then' . "\n"
1480 . ' ERR="cannot checkout"' . "\n"
1511 . ' sleep 3' . "\n"
1512 . ' continue' . "\n"
1513 . ' ERR="cannot checkout: $(< /mnt/status/checkout)"' . "\n"
1481 1514 . ' break' . "\n" . ' break' . "\n"
1482 1515 . ' fi' . "\n" . ' fi' . "\n"
1483 1516 . ' fi' . "\n" . ' fi' . "\n"
 
... ... function start_worker($job)
1486 1519 . ' rg_extract_rpm_info /mnt/target' . "\n" . ' rg_extract_rpm_info /mnt/target' . "\n"
1487 1520 . ' if [ "${spec_deps}" != "" ]; then' . "\n" . ' if [ "${spec_deps}" != "" ]; then' . "\n"
1488 1521 . ' echo; echo "`date`: Installing dependencies [${spec_deps}]"' . "\n" . ' echo; echo "`date`: Installing dependencies [${spec_deps}]"' . "\n"
1489 . ' export DEBIAN_FRONTEND=noninteractive' . "\n"
1490 . ' export APT_LISTCHANGES_FRONTEND=none' . "\n"
1491 . ' ' . $env['pkg_cmd'] . ' ${spec_deps}' . "\n"
1492 . ' if [ "${?}" != "0" ]; then' . "\n"
1493 . ' ERR="cannot install deps"' . "\n"
1494 . ' break' . "\n"
1495 . ' fi' . "\n"
1522 . ' for p in ${spec_deps}; do' . "\n"
1523 . ' if [[ ${p} =~ :// ]]; then' . "\n"
1524 . ' rg_notify_warn "We do not allow remote packages for security reasons"' . "\n" // TODO: the net is already disabled
1525 . ' continue' . "\n"
1526 . ' fi' . "\n"
1527 . ' ${rg_pkg_cmd} "${p}" 2>/tmp/install_pkg.err' . "\n"
1528 . ' [ "${?}" = "0" ] || rg_notify_warn "Cannot install ${p}: "$(< /tmp/install_pkg.err)' . "\n"
1529 . ' done' . "\n"
1496 1530 . ' fi' . "\n" . ' fi' . "\n"
1497 1531 . "\n" . "\n"
1498 1532 . ' rg_notify "Stating build.sh script"' . "\n" . ' rg_notify "Stating build.sh script"' . "\n"
 
... ... function start_worker($job)
1555 1589 . 'date +%s > /mnt/T_DONE' . "\n\n" . 'date +%s > /mnt/T_DONE' . "\n\n"
1556 1590 . 'rg_notify "DONE"' . "\n" . 'rg_notify "DONE"' . "\n"
1557 1591 . "\n" . "\n"
1592 . 'dmesg > /mnt/status/dmesg' . "\n"
1593 . "\n"
1558 1594 . 'echo; echo "`date`: Syncing"' . "\n" . 'echo; echo "`date`: Syncing"' . "\n"
1559 1595 . 'sync' . "\n" . 'sync' . "\n"
1560 1596 . "\n" . "\n"
File techdocs/rpm.txt changed (mode: 100644) (index 1a04171..001df29)
... ... a .spec file is present in the repo and the user pushes.
8 8 - 'rg_wh_build_send_one' will - 'rg_wh_build_send_one' will
9 9 - get the pkg_maps, repo and subrepo info - get the pkg_maps, repo and subrepo info
10 10 - sets exec:prepare_rpms and exec:copy_to_rgfs flags - sets exec:prepare_rpms and exec:copy_to_rgfs flags
11 - will call 'rg_pkg_prepare_ev_for_dotrepo' to add info to create user repositories
11 - will call 'rg_pkg_prepare_for_rgfs' to add rgfs details
12 - will call 'rg_pkg_prepare_for_dotrepo' to add info to create user repositories
12 13 - will call 'rg_builder_add' - will call 'rg_builder_add'
13 14 - Builer will send the job to a worker - Builer will send the job to a worker
14 15 - Worker will start the VM - Worker will start the VM
 
... ... a .spec file is present in the repo and the user pushes.
66 67 - Event 'pkg_generate_dotrepo_rpm' [function rg_pkg_event_generate_dotrepo_rpm]: - Event 'pkg_generate_dotrepo_rpm' [function rg_pkg_event_generate_dotrepo_rpm]:
67 68 - sets 'exec:worker_must_be_global' flag - we do not trust user workers - sets 'exec:worker_must_be_global' flag - we do not trust user workers
68 69 - prepares a fake pkg_maps from the pkg_repo/subrepo passed in the event - prepares a fake pkg_maps from the pkg_repo/subrepo passed in the event
69 - calls 'rg_pkg_prepare_ev_for_dotrepo' function
70 - calls 'rg_pkg_prepare_for_rgfs' function
71 - calls 'rg_pkg_prepare_for_dotrepo' function
70 72 - calls 'rg_builder_add' - calls 'rg_builder_add'
71 73
72 74 - Event 'pkg_subrepo_regenerate' [function rg_pkg_subrepo_event_regenerate]: - Event 'pkg_subrepo_regenerate' [function rg_pkg_subrepo_event_regenerate]:
73 75 - 'uid' is set to 0 - 'uid' is set to 0
74 76 - for each subrepo passed in the event a fake pkg_maps is created - for each subrepo passed in the event a fake pkg_maps is created
75 - calls 'rg_pkg_prepare_ev_for_dotrepo' function
77 - calls 'rg_pkg_prepare_for_rgfs' function
78 - calls 'rg_pkg_prepare_for_dotrepo' function
76 79 - calls 'rg_builder_add' - calls 'rg_builder_add'
77 80
78 - Function 'rg_pkg_prepare_ev_for_dotrepo':
81 - Function 'rg_pkg_prepare_for_dotrepo':
79 82 - it avoids not enabled environments (state::distros) - it avoids not enabled environments (state::distros)
80 83 - for each pkg mapping: - for each pkg mapping:
81 84 - if (event uid != pkg_repo uid) skip (we do not allow a user to influence other repos) - if (event uid != pkg_repo uid) skip (we do not allow a user to influence other repos)
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