List of commits:
Subject Hash Author Date (UTC)
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
Fixed partion create logic c8897c0e6f31a0ab917d2320018c5920e0abd36b Catalin(ux) M. BOIE 2021-11-02 06:01:58
Typos corrected c1a5002a1763327f4df8d5d0b419fcc2604f4698 Catalin(ux) M. BOIE 2021-10-30 11:08:34
Commit d9bc215557cd9a6f30dbc90434dc3aba46e39979 - worker: Fixed a stupid bug leading to wrong distro upgrade command
Author: Catalin(ux) M. BOIE
Author date (UTC): 2021-11-14 16:16
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2021-11-14 16:16
Parent(s): add562b15d94501a0585001db526b241c251b6e6
Signing key:
Tree: dc3bc89666129e7add39a744e36ecb992650f733
File Lines added Lines deleted
History.txt 1 0
TODO 7 0
inc/builder.inc.php 1 1
rocketgit.spec 1 1
root/index.php 2 2
samples/nginx.conf 4 4
scripts/worker.php 18 5
File History.txt changed (mode: 100644) (index 3f88d5f..554f955)
25 25 2020-06-10 - RocketGit 0.72 released and installed on production (07:22 UTC). 2020-06-10 - RocketGit 0.72 released and installed on production (07:22 UTC).
26 26 2020-06-10 - RocketGit project was accepted by ReadTheDocs.io ad program. Thanks! 2020-06-10 - RocketGit project was accepted by ReadTheDocs.io ad program. Thanks!
27 27 2020-08-24 - RocketGit 0.73 released and installed on production (07:12 UTC, also switch to Fedora 32). 2020-08-24 - RocketGit 0.73 released and installed on production (07:12 UTC, also switch to Fedora 32).
28 2021-11-14 - RocketGit 0.74 released and installed on production (between 15:00 and 15:40).
File TODO changed (mode: 100644) (index 3a70d08..26efbee)
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 [ ] We may want to not log at all the first line when a bot connects and the load is big.
64 [ ] dnf install:
65 Error in POSTIN scriptlet in rpm package catab+rocketgit
66 Running scriptlet: rocketgit-0.73-1.noarch 2/2
67 Glob pattern passed to enable, but globs are not supported for this.
68 Invalid unit name "rocketgit-worker@*.service" escaped as "rocketgit-worker@\x2a.service".
69 [ ] Maybe I should not restore whole repo dir! Takes too much!
63 70 [ ] Use SELinux booleans to restrict more the VM env. [ ] Use SELinux booleans to restrict more the VM env.
64 71 [ ] Convert builder and worker to systemd serices (sockets). [ ] Convert builder and worker to systemd serices (sockets).
65 72 [ ] webhook: allow user to select pkg repos which should be enabled. [ ] webhook: allow user to select pkg repos which should be enabled.
File inc/builder.inc.php changed (mode: 100644) (index 6c170da..a4b69e3)
... ... function rg_builder_done($db, $job, $s)
124 124 $env = $req['env']; $env = $req['env'];
125 125 // TODO: sometimes, done is not present // TODO: sometimes, done is not present
126 126 if (isset($s['done'])) if (isset($s['done']))
127 $labels[] = 'worker_elap/' . ($s['done'] - $s['start']) . 's';
127 $labels[] = 'worker_elap/' . ($s['done'] - intval($s['start'])) . 's';
128 128 $labels[] = 'wait_time/' . ($job['worker_sent'] - $job['itime']) . 's'; $labels[] = 'wait_time/' . ($job['worker_sent'] - $job['itime']) . 's';
129 129 $labels[] = 'date/' . gmdate('Y-m-d', $job['itime']); $labels[] = 'date/' . gmdate('Y-m-d', $job['itime']);
130 130 $labels[] = 'time/' . gmdate('H:i', $job['itime']); $labels[] = 'time/' . gmdate('H:i', $job['itime']);
File rocketgit.spec changed (mode: 100644) (index 4bee32f..e9e0ac8)
... ... rm -rf ${RPM_BUILD_ROOT}
130 130 %{_unitdir}/* %{_unitdir}/*
131 131
132 132 %changelog %changelog
133 * Wed Oct 21 2021 Catalin(ux) M. BOIE <catab at embedromix dot ro> 0.74
133 * Thu Oct 21 2021 Catalin(ux) M. BOIE <catab at embedromix dot ro> 0.74
134 134 Lots of changes. rpm packages. Lots of changes. rpm packages.
135 135
136 136 * Fri Jun 05 2020 Catalin(ux) M. BOIE <catab at embedromix dot ro> 0.72 * Fri Jun 05 2020 Catalin(ux) M. BOIE <catab at embedromix dot ro> 0.72
File root/index.php changed (mode: 100644) (index 0095cfd..3ecfb2e)
... ... $user = ""; $repo = ""; $organization = 0; // TODO: those are really used?
88 88 $rg['proto'] = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : ''; $rg['proto'] = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : '';
89 89 $rg['ua'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ""; $rg['ua'] = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
90 90 if ((rg_load() > 50) && rg_is_bot($rg['ua'])) { if ((rg_load() > 50) && rg_is_bot($rg['ua'])) {
91 header($rg['proto'] . ' 429 Too many requests');
91 header($rg['proto'] . ' 429 Too many requests (bot)');
92 92 echo 'Too many requests. Please slow down.' . "\n"; echo 'Too many requests. Please slow down.' . "\n";
93 93 exit(0); exit(0);
94 94 } }
 
... ... rg_debug_set(rg_state_get($db, 'debug'));
131 131 $lim = rg_rate_limit($db); $lim = rg_rate_limit($db);
132 132 if (($lim == 0) && (rg_debug() == 0)) { if (($lim == 0) && (rg_debug() == 0)) {
133 133 rg_log('Too many requests'); rg_log('Too many requests');
134 header($rg['proto'] . ' 429 Too many requests');
134 header($rg['proto'] . ' 429 Too many requests (lim)');
135 135 echo 'Too many requests. Please slow down.' . "\n"; echo 'Too many requests. Please slow down.' . "\n";
136 136 exit(0); exit(0);
137 137 } else if ($lim > 0) } else if ($lim > 0)
File samples/nginx.conf changed (mode: 100644) (index e7c9bb2..139484a)
... ... upstream rgfs {
3 3 } }
4 4
5 5 server { server {
6 listen 443 ssl http2 backlog=128 rcvbuf=64k;
7 listen [::]:443 ssl http2 backlog=128 rcvbuf=64k;
8 listen 80 backlog=128 rcvbuf=64k;
9 listen [::]:80 backlog=128 rcvbuf=64k;
6 listen 443 ssl http2 backlog=128 rcvbuf=64k sndbuf=64k;
7 listen [::]:443 ssl http2 backlog=128 rcvbuf=64k k sndbuf=64k;
8 listen 80 backlog=128 rcvbuf=16k sndbuf=16k;
9 listen [::]:80 backlog=128 rcvbuf=16k sndbuf=16k;
10 10
11 11 server_name rg.domain.tld; # add here, space separated, more names server_name rg.domain.tld; # add here, space separated, more names
12 12 server_tokens off; server_tokens off;
File scripts/worker.php changed (mode: 100644) (index 6889003..073a328)
... ... function load_config($file)
233 233 } }
234 234
235 235 if (!isset($i['pkg_cmd'])) { if (!isset($i['pkg_cmd'])) {
236 $x = explode('-', $name, 3); $x = $x[0]; $y = isset($x[1]) ? $x[1] : '';
236 $q = explode('-', $name, 3); $x = $q[0]; $y = isset($q[1]) ? $q[1] : '';
237 237 if ((strcasecmp($x, 'debian') == 0) || (strcasecmp($x, 'ubuntu') == 0)) { if ((strcasecmp($x, 'debian') == 0) || (strcasecmp($x, 'ubuntu') == 0)) {
238 238 $i['pkg_cmd'] = 'apt --assume-yes --ignore-hold' $i['pkg_cmd'] = 'apt --assume-yes --ignore-hold'
239 239 . ' --allow-downgrades --allow-remove-essential' . ' --allow-downgrades --allow-remove-essential'
 
... ... function load_config($file)
258 258 unset($conf['env'][$name]); unset($conf['env'][$name]);
259 259 continue; continue;
260 260 } }
261
262 rg_log('Set pkg_cmd to [' . $i['pkg_cmd'] . ']'
263 . ' for name [' . $name . ']; x=[' . $x . '] y=[' . $y . ']');
261 264 } }
262 265 } }
263 266 unset($i); unset($i);
 
... ... function start_worker_build_tools($job, &$reason, &$reason2)
414 417 . "\n" . "\n"
415 418 . 'function rg_notify()' . "\n" . 'function rg_notify()' . "\n"
416 419 . '{' . "\n" . '{' . "\n"
417 . ' echo "M${@}" > /dev/virtio-ports/rgw' . "\n"
420 . ' echo "M${@}" > /dev/virtio-ports/rgw &' . "\n" // TODO: CentOS 7, for example, returns "Resource busy"
421 . ' echo "M${@}" >> /mnt/status/history' . "\n"
418 422 . '}' . "\n" . '}' . "\n"
419 423 . "\n" . "\n"
420 424 . 'function rg_notify_err()' . "\n" . 'function rg_notify_err()' . "\n"
 
... ... function rg_job_extract_info(&$job)
2348 2352 $pkg_subrepo_dirty[] = $id; $pkg_subrepo_dirty[] = $id;
2349 2353 } }
2350 2354
2355 $_x = @file_get_contents($job['main'] . '/root/T_DONE');
2356 if ($_x === FALSE)
2357 $_done = time();
2358 else
2359 $_done = intval($_x);
2360
2351 2361 $job['status'] = array( $job['status'] = array(
2352 2362 'vm_start' => $vm_start, 'vm_start' => $vm_start,
2353 2363 'build_sh_start' => $build_sh_start, 'build_sh_start' => $build_sh_start,
 
... ... function rg_job_extract_info(&$job)
2356 2366 'start' => @trim(file_get_contents($job['main'] . '/root/T_START')), 'start' => @trim(file_get_contents($job['main'] . '/root/T_START')),
2357 2367 'net_ok' => @trim(file_get_contents($job['main'] . '/root/T_NET_OK')), 'net_ok' => @trim(file_get_contents($job['main'] . '/root/T_NET_OK')),
2358 2368 'pkgs_ok' => @trim(file_get_contents($job['main'] . '/root/T_PKGS_OK')), 'pkgs_ok' => @trim(file_get_contents($job['main'] . '/root/T_PKGS_OK')),
2359 'done' => @trim(file_get_contents($job['main'] . '/root/T_DONE')) || time(),
2369 'done' => $_done,
2360 2370 'labels' => $labels, 'labels' => $labels,
2361 2371 'pkg_subrepo_dirty' => $pkg_subrepo_dirty 'pkg_subrepo_dirty' => $pkg_subrepo_dirty
2362 2372 ); );
 
... ... while(1) {
2645 2655
2646 2656 $name = 'rg-worker-' . $conf['id'] . '-' . $jid; $name = 'rg-worker-' . $conf['id'] . '-' . $jid;
2647 2657
2658 if (!isset($job['state']))
2659 $job['state'] = RG_JOB_INIT;
2660
2648 2661 while ($job['state'] == RG_JOB_INIT) { while ($job['state'] == RG_JOB_INIT) {
2649 2662 // TODO: how this could happen?! // TODO: how this could happen?!
2650 2663 $k = array_search($name, $vms); $k = array_search($name, $vms);
 
... ... while(1) {
2691 2704 xchan_open($job); xchan_open($job);
2692 2705 $stats['jobs']++; $stats['jobs']++;
2693 2706 } else if (!isset($job['helper_start']) } else if (!isset($job['helper_start'])
2694 || ($job['helper_start'] + 30 < time())) {
2707 || ($job['helper_start'] + 300 < time())) {
2695 2708 // TODO: we should check if pid is still valid? // TODO: we should check if pid is still valid?
2696 rg_log($jid . ': Waited 30s without the VM to show up!'
2709 rg_log($jid . ': Waited 300s without the VM to show up!'
2697 2710 . ' Set state to INIT.'); . ' Set state to INIT.');
2698 2711 $job['state'] = RG_JOB_INIT; $job['state'] = RG_JOB_INIT;
2699 2712 continue; continue;
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