List of commits:
Subject Hash Author Date (UTC)
Improved admin report 9fa82cc2878886c2195cdd3f334dd532b3ea6a22 Catalin(ux) M. BOIE 2020-06-28 10:19:24
First version of artifacts ad6b6c75aab8d485ea45c1d851f23d83587d6931 Catalin(ux) M. BOIE 2020-06-27 13:11:17
Allow adding bugs for public repos + small fixes e67955ce3360c8c003a718e01844b3d8effa74a6 Catalin(ux) M. BOIE 2020-06-25 16:05:54
History updates 4c4aef444bbd1149f2c02b6da620f184aae1eed6 Catalin(ux) M. BOIE 2020-06-16 05:53:14
Allow cron to execute sub-tasks in parallel - we missed stats f65c76714cf349a53f584c8e65d9e89c24a4fa69 Catalin(ux) M. BOIE 2020-06-12 06:50:40
bug: search: fixed the override of some global variables 82e251ea883e50b8d1476530e0268fd5770fbf41 Catalin(ux) M. BOIE 2020-06-10 21:29:03
If a repo is non-existent, we should not try to use the id bcb08f74e21556aa750920335ebec2f965e72f36 Catalin(ux) M. BOIE 2020-06-10 08:05:43
If no activity, average elap is not computed correctly a7d4f0042c912d29f7943e0446820a477f42d6f7 Catalin(ux) M. BOIE 2020-06-09 07:03:21
When a user is requesting an e-mail confirmation operation, ignore if the e-mail was confirmed 62c387ed431d0c46d16e534cc1c954557ee389f7 Catalin(ux) M. BOIE 2020-06-08 06:42:22
Reverse test messed the creation of partition tables; more debugging d820816c2624549e0b0e1634523717cda0b7ba66 Catalin(ux) M. BOIE 2020-06-05 17:33:08
We need to prepare the partition tables before some inserts 07a12d1c79104b4707a9d43463fa9c11a4697293 Catalin(ux) M. BOIE 2020-06-05 15:55:43
.spec updates 5fe0aca1b4a3bfd8c1c8db95409faf512ad09b43 Catalin(ux) M. BOIE 2020-06-04 22:03:57
Switch to Podman (because of Fedora 32) and fix the worker service in the spec file 05b3866cd09b0aa8367d3b5755f45ea7274658de Catalin(ux) M. BOIE 2020-06-04 15:50:41
Added sample configuration for workers df36ccd20e40987a4ca2355062ee1312aa2ee3a2 Catalin(ux) M. BOIE 2020-06-04 15:14:52
Avoid complains from install for systemd daemon-reload 683a92542cc0608293ceefc111a05e1eb328a2d8 Catalin(ux) M. BOIE 2020-06-04 15:09:57
Small stuff e64a838d032e54587ab3110ab8bb04a0cde78231 Catalin(ux) M. BOIE 2020-06-04 14:49:56
Lots of changes b8164d9e1e263eb4db75e32430f0753b63d0028e Catalin(ux) M. BOIE 2020-06-04 07:14:35
Lots of small fixes and functional tests ad2c8f4ce214896cb5984031dbd916467878ccfd Catalin(ux) M. BOIE 2020-05-16 09:30:47
Lots of things, mostly worker fixes 8768227306ef89ecc51d392cf986e75a7044dde4 Catalin(ux) M. BOIE 2020-04-10 15:27:11
Added functional test for HTTP 304 code 93205ec14d1073c434360abf7ea525a75407b1ab Catalin(ux) M. BOIE 2020-04-02 14:05:49
Commit 9fa82cc2878886c2195cdd3f334dd532b3ea6a22 - Improved admin report
Author: Catalin(ux) M. BOIE
Author date (UTC): 2020-06-28 10:19
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2020-06-28 10:19
Parent(s): ad6b6c75aab8d485ea45c1d851f23d83587d6931
Signer:
Signing key:
Signing status: N
Tree: 574e4939d8cdb96a3a13623b081066b28959ed92
File Lines added Lines deleted
inc/admin.inc.php 35 16
File inc/admin.inc.php changed (mode: 100644) (index 1180f5b..3954531)
... ... function rg_admin_report_conns($db, $from, $to)
301 301 break; break;
302 302 } }
303 303
304 $list = array('type', 'uid', 'repo_id', 'url', 'cmd', 'referer', 'ip');
305 foreach ($list as $k)
304 $url = rg_base_url();
305 $x = explode('://', $url, 2);
306 $url = $x[1];
307
308 $list = array('type' => array('top' => 0),
309 'uid' => array('top' => 20),
310 'repo_id' => array('top' => 20),
311 'url' => array('top' => 20),
312 'cmd' => array('top' => 0),
313 'referer' => array('top' => 0),
314 'ip' => array('top' => 20),
315 'ua' => array('top' => 0)
316 );
317 foreach ($list as $k => $junk)
306 318 $ret[$k] = array(); $ret[$k] = array();
307 319 $ret['count'] = 0; $ret['count'] = 0;
308 320 $ret['sum_elap'] = 0; $ret['sum_elap'] = 0;
 
... ... function rg_admin_report_conns($db, $from, $to)
310 322 $ret['count']++; $ret['count']++;
311 323 $ret['sum_elap'] += $row['elap']; $ret['sum_elap'] += $row['elap'];
312 324
313 foreach ($list as $k) {
325 foreach ($list as $k => $i) {
314 326 $v = $row[$k]; $v = $row[$k];
315 327 if (strcmp($k, 'uid') == 0) { if (strcmp($k, 'uid') == 0) {
316 328 if ($v == 0) if ($v == 0)
 
... ... function rg_admin_report_conns($db, $from, $to)
319 331 if ($v == 0) if ($v == 0)
320 332 continue; continue;
321 333 $v = $row['uid'] . '/' . $row[$k]; $v = $row['uid'] . '/' . $row[$k];
334 } else if (strcmp($k, 'referer') == 0) {
335 if (stristr($v, $url))
336 continue;
322 337 } }
323 338
324 339 if (!isset($ret[$k][$v])) if (!isset($ret[$k][$v]))
 
... ... function rg_admin_report_conns($db, $from, $to)
330 345 rg_sql_free_result($res); rg_sql_free_result($res);
331 346
332 347 if ($ret['count'] == 0) { if ($ret['count'] == 0) {
348 $ret['avg_elap'] = 0;
349 unset($ret['sum_elap']);
333 350 $ret['ok'] = 1; $ret['ok'] = 1;
334 351 break; break;
335 352 } }
336 353
337 if ($ret['count'] == 0)
338 $ret['avg_elap'] = 0;
339 else
340 $ret['avg_elap'] = intval($ret['sum_elap'] / $ret['count']);
354 $ret['avg_elap'] = intval($ret['sum_elap'] / $ret['count']);
341 355 unset($ret['sum_elap']); unset($ret['sum_elap']);
342 356
343 foreach ($list as $k) {
357 foreach ($list as $k => $i) {
344 358 uasort($ret[$k], 'rg_admin_report_order_desc'); uasort($ret[$k], 'rg_admin_report_order_desc');
345
346 // We want statistics for all types
347 if (strcmp($k, 'type') == 0)
348 continue;
349
350 $ret[$k] = rg_array_top($ret[$k], 10);
359 $ret[$k] = rg_array_top($ret[$k], $i['top']);
351 360 } }
352 361
353 362 $ret['ok'] = 1; $ret['ok'] = 1;
 
... ... function rg_admin_report1_suggestions($db, $from, $to)
412 421 function rg_admin_report1($db, $rg) function rg_admin_report1($db, $rg)
413 422 { {
414 423 global $rg_admin_email; global $rg_admin_email;
424 global $rg_state_dir;
415 425
416 426 $body = ''; $body = '';
417 427
 
... ... function rg_admin_report1($db, $rg)
422 432 $body .= "Report between " . gmdate('Y-m-d H:i:s', $y_start) $body .= "Report between " . gmdate('Y-m-d H:i:s', $y_start)
423 433 . " and " . gmdate('Y-m-d H:i:s', $y_end) . " UTC\n"; . " and " . gmdate('Y-m-d H:i:s', $y_end) . " UTC\n";
424 434 $body .= 'For site ' . $site . "\n"; $body .= 'For site ' . $site . "\n";
435 $body .= "\n";
436
437 foreach (array($rg_state_dir, '/') as $dir) {
438 $free = disk_free_space($dir);
439 $total = disk_total_space($dir);
440 $body .= $dir . ': total=' . rg_1024($total)
441 . ' free=' . rg_1024($free);
442 }
443 $body .= "\n";
425 444
426 445 $g = array(); $g = array();
427 446 $list = array( $list = array(
 
... ... function rg_admin_report1($db, $rg)
478 497 } }
479 498
480 499 $body .= "\nYesterday users:"; $body .= "\nYesterday users:";
481 $sql = 'SELECT username, realname, email FROM users'
500 $sql = 'SELECT username, realname, email, last_ip FROM users'
482 501 . ' WHERE itime >= ' . $y_start . ' WHERE itime >= ' . $y_start
483 502 . ' AND itime <= ' . $y_end; . ' AND itime <= ' . $y_end;
484 503 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
 
... ... function rg_admin_report1($db, $rg)
490 509 $body .= ' ' . $row['username'] $body .= ' ' . $row['username']
491 510 . ' - ' . $row['realname'] . ' - ' . $row['realname']
492 511 . ' - ' . $row['email'] . ' - ' . $row['email']
512 . ' [' . $row['last_ip'] . ']'
493 513 . "\n"; . "\n";
494 514 } }
495 515 rg_sql_free_result($res); rg_sql_free_result($res);
 
... ... function rg_admin_settings($db, &$rg, $paras)
908 928 return $ret; return $ret;
909 929 } }
910 930
911 ?>
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