List of commits:
Subject Hash Author Date (UTC)
Mostly cosmetic 427e7056c6593359b68317c071d175cc38b1705d Catalin(ux) M. BOIE 2023-12-17 12:01:17
readme rendering: everything not makrdown is treated as text d7c1a9e039e3b7945682ee2e13745cd0d4ad446a Catalin(ux) M. BOIE 2023-06-22 03:40:21
Really bumbed version to 0.78 223d494efb0cc012c72fe8898e2800ce15e4eaf7 Catalin(ux) M. BOIE 2023-06-15 20:36:31
Make rgfs more verbose in case of errors 197c21765870fa6b95bb08c8599de9decf3980eb Catalin(ux) M. BOIE 2023-06-15 20:33:18
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
Commit 427e7056c6593359b68317c071d175cc38b1705d - Mostly cosmetic
Author: Catalin(ux) M. BOIE
Author date (UTC): 2023-12-17 12:01
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2023-12-17 12:01
Parent(s): d7c1a9e039e3b7945682ee2e13745cd0d4ad446a
Signer:
Signing key:
Signing status: N
Tree: c6db04535062a8ab507a2659d7ad6ba204a28931
File Lines added Lines deleted
Makefile.in 8 8
TODO 9 6
debian/control 1 1
docker/dev.sh 3 2
docker/init-pg.sh 1 1
inc/cache.inc.php 1 1
inc/conn.inc.php 0 3
inc/prof.inc.php 2 2
inc/sql.inc.php 14 0
inc/struct.inc.php 16 10
inc/util.inc.php 9 0
rocketgit.spec 1 1
scripts/builder.php 2 1
scripts/cache.php 4 3
scripts/events.php 2 1
scripts/rgfs.php 4 3
scripts/worker.php 6 2
tests/_run_tests.sh 1 2
tests/wh_build.php 65 45
File Makefile.in changed (mode: 100644) (index 1c4ccf9..f216d8f)
... ... install: all
29 29 @ @
30 30 @echo "Installing configs..." @echo "Installing configs..."
31 31 @mkdir -pv $(I_ETC)/cron.d @mkdir -pv $(I_ETC)/cron.d
32 cp -vd --no-clobber samples/cron $(I_ETC)/cron.d/$(PRJ)
32 -cp -vd --no-clobber samples/cron $(I_ETC)/cron.d/$(PRJ)
33 33 @ @
34 34 @mkdir -pv $(I_ETC)/httpd/conf.d @mkdir -pv $(I_ETC)/httpd/conf.d
35 35 cp -vd samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf.sample cp -vd samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf.sample
36 cp -vd --no-clobber samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf
36 -cp -vd --no-clobber samples/rg.conf $(I_ETC)/httpd/conf.d/$(PRJ).conf
37 37 @ @
38 38 @mkdir -pv $(I_ETC)/nginx/conf.d @mkdir -pv $(I_ETC)/nginx/conf.d
39 39 cp -vd samples/nginx.conf $(I_ETC)/nginx/conf.d/$(PRJ).conf.sample cp -vd samples/nginx.conf $(I_ETC)/nginx/conf.d/$(PRJ).conf.sample
40 cp -vd --no-clobber samples/nginx.conf $(I_ETC)/nginx/conf.d/$(PRJ).conf
40 -cp -vd --no-clobber samples/nginx.conf $(I_ETC)/nginx/conf.d/$(PRJ).conf
41 41 @ @
42 42 @mkdir -pv $(I_ETC)/$(PRJ) @mkdir -pv $(I_ETC)/$(PRJ)
43 43 cp -vd samples/config.php $(I_ETC)/$(PRJ)/config.php.sample cp -vd samples/config.php $(I_ETC)/$(PRJ)/config.php.sample
44 cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/
44 -cp -vd --no-clobber samples/config.php $(I_ETC)/$(PRJ)/
45 45 @ @
46 46 cp -vd samples/php-fpm.conf $(I_ETC)/$(PRJ)/php-fpm.conf.sample cp -vd samples/php-fpm.conf $(I_ETC)/$(PRJ)/php-fpm.conf.sample
47 cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/
47 -cp -vd --no-clobber samples/php-fpm.conf $(I_ETC)/$(PRJ)/
48 48 @ @
49 49 cp -vd samples/pool.conf $(I_ETC)/$(PRJ)/pool.conf.sample cp -vd samples/pool.conf $(I_ETC)/$(PRJ)/pool.conf.sample
50 cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/
50 -cp -vd --no-clobber samples/pool.conf $(I_ETC)/$(PRJ)/
51 51 @ @
52 52 cp -vd samples/worker-main.conf $(I_ETC)/$(PRJ)/worker-main.conf.sample cp -vd samples/worker-main.conf $(I_ETC)/$(PRJ)/worker-main.conf.sample
53 cp -vd --no-clobber samples/worker-main.conf $(I_ETC)/$(PRJ)/
53 -cp -vd --no-clobber samples/worker-main.conf $(I_ETC)/$(PRJ)/
54 54 @ @
55 55 @mkdir -pv $(I_ETC)/ssh/sshd_config.d @mkdir -pv $(I_ETC)/ssh/sshd_config.d
56 cp -vd --no-clobber samples/sshd-akc.conf $(I_ETC)/ssh/sshd_config.d/90-rocketgit-akc.conf
56 -cp -vd --no-clobber samples/sshd-akc.conf $(I_ETC)/ssh/sshd_config.d/90-rocketgit-akc.conf
57 57 @mkdir -pv $(I_USR)/lib/systemd/system @mkdir -pv $(I_USR)/lib/systemd/system
58 58 cp -vd samples/*.service samples/*.socket $(I_USR)/lib/systemd/system/ cp -vd samples/*.service samples/*.socket $(I_USR)/lib/systemd/system/
59 59 systemctl daemon-reload || : systemctl daemon-reload || :
File TODO changed (mode: 100644) (index 0418946..050f419)
22 22 [ ] [ ]
23 23
24 24 == next release == == next release ==
25 [ ] Add in comparison stuff about AI and an extra license for the operator.
25 26 [ ] Add in comparison where (country) they are hosted. [ ] Add in comparison where (country) they are hosted.
26 27 [ ] Anybody with a build can dirty pkg_subrepos? It should not happen. [ ] Anybody with a build can dirty pkg_subrepos? It should not happen.
27 [ ] 'is_resource' may not be correct for latest PHP.
28 28 [ ] When a new distro is added, the dotrepo is not built automatically! [ ] When a new distro is added, the dotrepo is not built automatically!
29 29 I think this is done at push time. This is true for "Fedora 36". I think this is done at push time. This is true for "Fedora 36".
30 30 Let's see what happens on Fedora 37. Let's see what happens on Fedora 37.
 
78 78 [ ] [ ]
79 79
80 80 == Next next release == == Next next release ==
81 [ ] if a build env not found, cancel the job after a 10m?
81 82 [ ] Would be nice to see what webhooks will execute after a push. [ ] Would be nice to see what webhooks will execute after a push.
82 83 Maybe the events system can pass back some information to be shown to the user. Maybe the events system can pass back some information to be shown to the user.
83 84 [ ] Clone by git (eg ninedogs) failes to checkout files. [ ] Clone by git (eg ninedogs) failes to checkout files.
 
86 87 fatal: Could not read from remote repository. fatal: Could not read from remote repository.
87 88 Please make sure you have the correct access rights Please make sure you have the correct access rights
88 89 and the repository exists. and the repository exists.
89 [ ] If build fails, we should not parse artifcats.
90 [ ] If build fails, we should not parse artifacts.
90 91 [ ] Artifacts: set ETag! Also for other downloadable content. [ ] Artifacts: set ETag! Also for other downloadable content.
91 92 [ ] Allow artifacts to be generated only for some branch. [ ] Allow artifacts to be generated only for some branch.
92 93 [ ] Link artifacts with the build job. [ ] Link artifacts with the build job.
 
118 119 Now, in rgw, for example, we need to hardcode the version. Now, in rgw, for example, we need to hardcode the version.
119 120 If the user does not specify the version, get the latest. If the user does not specify the version, get the latest.
120 121 [ ] Admin cannot edit/delete Global pkg repo. [ ] Admin cannot edit/delete Global pkg repo.
121 [ ] Profile seems to not be sorted by time.
122 122 [ ] prof: do we need "db_conn" and "db_c_ms"? [ ] prof: do we need "db_conn" and "db_c_ms"?
123 123 [ ] test: gpg.php: does 3 selects from state table! Maybe cache is disabled? [ ] test: gpg.php: does 3 selects from state table! Maybe cache is disabled?
124 124 [ ] Full distro_info is sent when a job is sent to worker! [ ] Full distro_info is sent when a job is sent to worker!
 
136 136 [ ] Allow admins to set notifications (Matrix/Slack) for different operations. [ ] Allow admins to set notifications (Matrix/Slack) for different operations.
137 137 [ ] Store rgfs traffic in job (maybe we need to charge it)? [ ] Store rgfs traffic in job (maybe we need to charge it)?
138 138 [ ] Add cpu load/other stats per every block of output! [ ] Add cpu load/other stats per every block of output!
139 [ ] I am calling rg_env_info in several places, but I do not know if it is enabled or not.
139 [ ] I am calling rg_env_info in several places, but I do not know if it is
140 enabled or not.
140 141 [ ] On the main git repository page I should have a link to the pkg repo (if available). [ ] On the main git repository page I should have a link to the pkg repo (if available).
141 142 [ ] User Packages page: tell the user that he needs to add a webhook. [ ] User Packages page: tell the user that he needs to add a webhook.
142 143 Can we do it with a simple button press? Can we do it with a simple button press?
143 [ ] For conn type 'pkgrepo', repo_id is not set, at least for a repo keyring download!
144 [ ] For conn type 'pkgrepo', repo_id is not set, at least for a repo
145 keyring download!
144 146 [ ] We need to warn the users to be conservative with the project name [ ] We need to warn the users to be conservative with the project name
145 147 to be able to build packages for all distributions. to be able to build packages for all distributions.
146 148 [ ] rpm: howto for installing debug packages for rpm. [ ] rpm: howto for installing debug packages for rpm.
 
160 162 [ ] ubuntu: we may need other command to install debug packages (.ddeb). [ ] ubuntu: we may need other command to install debug packages (.ddeb).
161 163 What about source packages? What about source packages?
162 164 [ ] rgfs: we should not update meta on 'write' if was already stored. [ ] rgfs: we should not update meta on 'write' if was already stored.
163 Now we are rewriting the meta! Maybe having a 'create' is enough. We ignore 'write'.
165 Now we are rewriting the meta! Maybe having a 'create' is enough.
166 We ignore 'write'.
164 167 [ ] [ ]
165 168
166 169 == hook update == hook update
File debian/control changed (mode: 100644) (index 156cae0..1c89e7b)
... ... Vcs-Browser: https://rocketgit.com/user/catalinux/rocketgit
10 10
11 11 Package: rocketgit Package: rocketgit
12 12 Architecture: all Architecture: all
13 Depends: ${shlibs:Depends}, ${misc:Depends}, php-json, php-fpm, php-cli, php-pgsql, php-mbstring, php-opcache, php-ldap, git, util-linux, postgresql, qrencode, gpg, openssh-server
13 Depends: ${shlibs:Depends}, ${misc:Depends}, php-json, php-fpm, php-cli, php-pgsql, php-mbstring, php-opcache, php-ldap, git, util-linux, postgresql, qrencode, gpg, openssh-server, pandoc
14 14 Description: Light and fast Git hosting solution Description: Light and fast Git hosting solution
File docker/dev.sh changed (mode: 100755) (index 586ce56..bd1c59d)
... ... else
7 7 fi fi
8 8
9 9 echo "Cleaning..." echo "Cleaning..."
10 podman-compose -f docker-compose-dev.yml down
10 podman-compose -f docker-compose-dev.yml down -t0
11 11
12 12 if [ "${cmd}" != "down" ]; then if [ "${cmd}" != "down" ]; then
13 13 ./build.sh dev || exit 1 ./build.sh dev || exit 1
14 14 echo "Running [${cmd}]..." echo "Running [${cmd}]..."
15 15 podman-compose -f docker-compose-dev.yml ${cmd} -d podman-compose -f docker-compose-dev.yml ${cmd} -d
16
17 podman exec -it docker_web_1 /bin/bash
16 18 fi fi
17 19
18 podman exec -it docker_web_1 /bin/bash
File docker/init-pg.sh changed (mode: 100644) (index 5d3e9f1..f9897ce)
... ... set -e
4 4
5 5 psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
6 6 CREATE USER rocketgit WITH PASSWORD 'rock'; CREATE USER rocketgit WITH PASSWORD 'rock';
7 CREATE DATABASE rocketgit;
7 CREATE DATABASE rocketgit WITH OWNER rocketgit;
8 8 GRANT ALL PRIVILEGES ON DATABASE rocketgit TO rocketgit; GRANT ALL PRIVILEGES ON DATABASE rocketgit TO rocketgit;
9 9 EOSQL EOSQL
10 10
File inc/cache.inc.php changed (mode: 100644) (index 56127e5..3ecaf17)
... ... function rg_cache_send($cmd, $para, $flags)
397 397 return FALSE; return FALSE;
398 398 } }
399 399 if ($rg_cache_debug) if ($rg_cache_debug)
400 rg_log('Received [' . $ret . ']');
400 rg_log('Received [' . rtrim($ret) . ']');
401 401
402 402 if ($flags & RG_SOCKET_NO_WAIT) if ($flags & RG_SOCKET_NO_WAIT)
403 403 return TRUE; return TRUE;
File inc/conn.inc.php changed (mode: 100644) (index 53d4d9b..be89a34)
... ... function rg_conn_destroy($key)
59 59 unset($rg_events['r'][$key]); unset($rg_events['r'][$key]);
60 60 if (isset($rg_events['w'][$key])) if (isset($rg_events['w'][$key]))
61 61 unset($rg_events['w'][$key]); unset($rg_events['w'][$key]);
62 if (isset($rg_conns[$key]['socket']))
63 if (is_resource($rg_conns[$key]['socket']))
64 @socket_close($rg_conns[$key]['socket']);
65 62
66 63 if ($rg_conns[$key]['exit_on_close']) { if ($rg_conns[$key]['exit_on_close']) {
67 64 rg_log($key . ': exit_on_close is set, so exit'); rg_log($key . ': exit_on_close is set, so exit');
File inc/prof.inc.php changed (mode: 100644) (index bd3697b..ac65f08)
... ... function rg_prof_sort($a, $b)
144 144 if ($a['time'] > $b['time']) if ($a['time'] > $b['time'])
145 145 return 1; return 1;
146 146 if ($a['time'] < $b['time']) if ($a['time'] < $b['time'])
147 return 0;
147 return -1;
148 148
149 149 return 0; return 0;
150 150 } }
 
... ... function rg_prof_text()
190 190 $add2 = ''; $add2 = '';
191 191 foreach ($vars as $k => $junk) { foreach ($vars as $k => $junk) {
192 192 if (!isset($per_label[$k])) if (!isset($per_label[$k]))
193 $v = 0;
193 $v = '-';
194 194 else else
195 195 $v = $per_label[$k]; $v = $per_label[$k];
196 196 $ret .= $add2 . $v; $ret .= $add2 . $v;
File inc/sql.inc.php changed (mode: 100644) (index 5963d38..93f8015)
... ... function rg_sql_fields($h, $table)
476 476 return $ret; return $ret;
477 477 } }
478 478
479 function rg_sql_dbname($h)
480 {
481 global $rg_sql_conn;
482
483 return pg_dbname($rg_sql_conn[$h]['db']);
484 }
485
486 function rg_sql_escape_identifier($h, string $data)
487 {
488 global $rg_sql_conn;
489
490 return pg_escape_identifier($rg_sql_conn[$h]['db'], $data);
491 }
492
File inc/struct.inc.php changed (mode: 100644) (index 88f5246..54f1350)
... ... function rg_sql_struct_run($db, $flags, $old_schema_ver)
807 807 $ignore_errors = ($flags & RG_IGNORE_ERRORS) ? TRUE : FALSE; $ignore_errors = ($flags & RG_IGNORE_ERRORS) ? TRUE : FALSE;
808 808 $drop_tables = ($flags & RG_DROP_TABLES) ? TRUE : FALSE; $drop_tables = ($flags & RG_DROP_TABLES) ? TRUE : FALSE;
809 809
810 rg_log_enter("sql_struct_run: flags=$flags"
811 . " ignore_errors=" . ($ignore_errors ? "Yes" : "No")
812 . " drop_tables=" . ($drop_tables ? "Yes" : "No")
813 . " old_schema_ver=$old_schema_ver...");
810 rg_log_enter('sql_struct_run: flags=' . $flags
811 . ' ignore_errors=' . ($ignore_errors ? 'Yes' : 'No')
812 . ' drop_tables=' . ($drop_tables ? 'Yes' : 'No')
813 . ' old_schema_ver=' . $old_schema_ver);
814 814
815 815 $ret = TRUE; $ret = TRUE;
816
817 $name = rg_sql_escape_identifier($db, rg_sql_dbname($db));
818 rg_log('DEBUG: name=' . $name);
819 $sql = 'ALTER DATABASE ' . $name . ' REFRESH COLLATION VERSION';
820 $res = rg_sql_query($db, $sql);
821 if ($res === FALSE) {
822 if (!$ignore_errors)
823 $ret = FALSE;
824 } else {
825 rg_sql_free_result($res);
826 }
827
816 828 for ($i = $old_schema_ver + 1; $i <= $rg_sql_schema_ver; $i++) { for ($i = $old_schema_ver + 1; $i <= $rg_sql_schema_ver; $i++) {
817 829 foreach ($rg_sql_struct[$i] as $type => $sqls) { foreach ($rg_sql_struct[$i] as $type => $sqls) {
818 830 if (count($sqls) == 0) if (count($sqls) == 0)
 
... ... function rg_sql_struct_run($db, $flags, $old_schema_ver)
828 840 $sql2 = "DROP TABLE IF EXISTS $id CASCADE"; $sql2 = "DROP TABLE IF EXISTS $id CASCADE";
829 841 $res = rg_sql_query($db, $sql2); $res = rg_sql_query($db, $sql2);
830 842 if ($res === FALSE) { if ($res === FALSE) {
831 rg_log("WARN: Cannot run sql ($sql2) (" . rg_sql_error() . ")!");
832 843 if (!$ignore_errors) { if (!$ignore_errors) {
833 844 $ret = FALSE; $ret = FALSE;
834 845 break; break;
 
... ... function rg_sql_struct_run($db, $flags, $old_schema_ver)
840 851 rg_log("Running [$sql]..."); rg_log("Running [$sql]...");
841 852 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
842 853 if ($res === FALSE) { if ($res === FALSE) {
843 rg_log("WARN: Cannot run sql ($sql) (" . rg_sql_error() . ")!");
844 854 if (!$ignore_errors) { if (!$ignore_errors) {
845 855 $ret = FALSE; $ret = FALSE;
846 856 break; break;
847 857 } }
848 858 } }
849
850 859 rg_sql_free_result($res); rg_sql_free_result($res);
851 860 } }
852
853 861 if (!$ret) if (!$ret)
854 862 break; break;
855 863 } }
856
857 864 if (!$ret) if (!$ret)
858 865 break; break;
859 866 } }
860 867
861
862 868 rg_log_exit(); rg_log_exit();
863 869 return $ret; return $ret;
864 870 } }
File inc/util.inc.php changed (mode: 100644) (index 285f642..6750694)
... ... function rg_save($file, $a)
2975 2975 function rg_is_bot($ua) function rg_is_bot($ua)
2976 2976 { {
2977 2977 if (empty($ua)) return FALSE; if (empty($ua)) return FALSE;
2978
2979 if (stristr($ua, 'bot/')) return TRUE;
2980
2978 2981 if (strstr($ua, ' Adsbot/')) return TRUE; if (strstr($ua, ' Adsbot/')) return TRUE;
2979 2982 if (strstr($ua, ' AhrefsBot')) return TRUE; if (strstr($ua, ' AhrefsBot')) return TRUE;
2980 2983 if (strstr($ua, ' aiHitBot/')) return TRUE; if (strstr($ua, ' aiHitBot/')) return TRUE;
2984 if (strstr($ua, ' Amazonbot/')) return TRUE;
2981 2985 if (strstr($ua, 'Applebot/')) return TRUE; if (strstr($ua, 'Applebot/')) return TRUE;
2982 2986 if (strstr($ua, 'AWeb')) return TRUE; if (strstr($ua, 'AWeb')) return TRUE;
2983 2987 if (strstr($ua, ' Babya Discoverer ')) return TRUE; if (strstr($ua, ' Babya Discoverer ')) return TRUE;
 
... ... function rg_is_bot($ua)
2986 2990 if (strstr($ua, 'BananaBot/')) return TRUE; if (strstr($ua, 'BananaBot/')) return TRUE;
2987 2991 if (strstr($ua, ' bingbot')) return TRUE; if (strstr($ua, ' bingbot')) return TRUE;
2988 2992 if (strstr($ua, ' BLEXBot/')) return TRUE; if (strstr($ua, ' BLEXBot/')) return TRUE;
2993 if (strstr($ua, ' Bytespider')) return TRUE;
2989 2994 if (strstr($ua, 'CATExplorador')) return TRUE; if (strstr($ua, 'CATExplorador')) return TRUE;
2990 2995 if (strstr($ua, 'CCBot/')) return TRUE; if (strstr($ua, 'CCBot/')) return TRUE;
2991 2996 if (strstr($ua, ' CensysInspect/')) return TRUE; if (strstr($ua, ' CensysInspect/')) return TRUE;
2992 2997 if (strstr($ua, 'CISPA Webcrawler ')) return TRUE; if (strstr($ua, 'CISPA Webcrawler ')) return TRUE;
2993 2998 if (strstr($ua, 'clark-crawler2/')) return TRUE; if (strstr($ua, 'clark-crawler2/')) return TRUE;
2999 if (strstr($ua, 'Cloud mapping experiment')) return TRUE;
2994 3000 if (strstr($ua, ' Cliqzbot/')) return TRUE; if (strstr($ua, ' Cliqzbot/')) return TRUE;
2995 3001 if (strstr($ua, ' coccocbot-web')) return TRUE; if (strstr($ua, ' coccocbot-web')) return TRUE;
2996 3002 if (strstr($ua, ' DataForSeoBot/')) return TRUE; if (strstr($ua, ' DataForSeoBot/')) return TRUE;
 
... ... function rg_is_bot($ua)
3011 3017 if (strstr($ua, 'Googlebot-Video/')) return TRUE; if (strstr($ua, 'Googlebot-Video/')) return TRUE;
3012 3018 if (strstr($ua, 'GoScraper')) return TRUE; if (strstr($ua, 'GoScraper')) return TRUE;
3013 3019 if (strstr($ua, 'ichiro/')) return TRUE; if (strstr($ua, 'ichiro/')) return TRUE;
3020 if (strstr($ua, 'IonCrawl')) return TRUE;
3014 3021 if (strstr($ua, 'Internet-structure-research-project-bot')) return TRUE; if (strstr($ua, 'Internet-structure-research-project-bot')) return TRUE;
3015 3022 if (strstr($ua, 'Lawinsiderbot/')) return TRUE; if (strstr($ua, 'Lawinsiderbot/')) return TRUE;
3016 3023 if (strstr($ua, 'LightspeedSystemsCrawler')) return TRUE; if (strstr($ua, 'LightspeedSystemsCrawler')) return TRUE;
 
... ... function rg_is_bot($ua)
3031 3038 if (strstr($ua, 'OpenSearch@MPDL ')) return TRUE; if (strstr($ua, 'OpenSearch@MPDL ')) return TRUE;
3032 3039 if (strstr($ua, ' PageThing ')) return TRUE; if (strstr($ua, ' PageThing ')) return TRUE;
3033 3040 if (strstr($ua, 'PageThing.com')) return TRUE; if (strstr($ua, 'PageThing.com')) return TRUE;
3041 if (strstr($ua, 'paloaltonetworks.com')) return TRUE;
3034 3042 if (strstr($ua, 'Pandalytics')) return TRUE; if (strstr($ua, 'Pandalytics')) return TRUE;
3035 3043 if (strstr($ua, 'panscient.com')) return TRUE; if (strstr($ua, 'panscient.com')) return TRUE;
3036 3044 if (strstr($ua, ' PetalBot')) return TRUE; if (strstr($ua, ' PetalBot')) return TRUE;
 
... ... function rg_is_bot($ua)
3055 3063 if (strstr($ua, 'TprAdsTxtCrawler')) return TRUE; if (strstr($ua, 'TprAdsTxtCrawler')) return TRUE;
3056 3064 if (strstr($ua, 'TurnitinBot ')) return TRUE; if (strstr($ua, 'TurnitinBot ')) return TRUE;
3057 3065 if (strstr($ua, 'Twitterbot/')) return TRUE; if (strstr($ua, 'Twitterbot/')) return TRUE;
3066 if (strstr($ua, 'TinyTestBot')) return TRUE;
3058 3067 if (strstr($ua, ' VelenPublicWebCrawler/')) return TRUE; if (strstr($ua, ' VelenPublicWebCrawler/')) return TRUE;
3059 3068 if (strstr($ua, 'Wappalyzer')) return TRUE; if (strstr($ua, 'Wappalyzer')) return TRUE;
3060 3069 if (strstr($ua, ' webtechbot;')) return TRUE; if (strstr($ua, ' webtechbot;')) return TRUE;
File rocketgit.spec changed (mode: 100644) (index b96bf76..2c2fa82)
... ... Requires: httpd-filesystem, nginx-filesystem
24 24 Requires: php-pgsql, php-mbstring, php-json, php-ldap, php-fpm, php-cli Requires: php-pgsql, php-mbstring, php-json, php-ldap, php-fpm, php-cli
25 25 Requires: php-opcache Requires: php-opcache
26 26 Requires: git-core, cronie Requires: git-core, cronie
27 Requires: util-linux, qrencode, fuse, openssh-server, gpg
27 Requires: util-linux, qrencode, fuse, openssh-server, gpg, pandoc
28 28
29 29 # SELinux stuff # SELinux stuff
30 30 # https://fedoraproject.org/wiki/SELinux_Policy_Modules_Packaging_Draft?rd=PackagingDrafts/SELinux/PolicyModules # https://fedoraproject.org/wiki/SELinux_Policy_Modules_Packaging_Draft?rd=PackagingDrafts/SELinux/PolicyModules
File scripts/builder.php changed (mode: 100644) (index ad00709..a5fe8ad)
... ... function xdispatch_one($key, $data)
347 347 || ($job['worker_id'] != $s['worker_id'])) { || ($job['worker_id'] != $s['worker_id'])) {
348 348 $m = 'job not associated with worker'; $m = 'job not associated with worker';
349 349 rg_log($key . ': ' . $jid . ': error: ' . $m); rg_log($key . ': ' . $jid . ': error: ' . $m);
350 rg_log($key . ': ' . $jid . ': job[worker_id]=' . isset($job['worker_id']) ? $job['worker_id'] : '-');
350 rg_log($key . ': ' . $jid . ': job[worker_id]='
351 . (isset($job['worker_id']) ? $job['worker_id'] : '-'));
351 352 rg_log($key . ': ' . $jid . ': s[worker_id]=' . $s['worker_id']); rg_log($key . ': ' . $jid . ': s[worker_id]=' . $s['worker_id']);
352 353 $err = array('op' => 'abort_job', 'jid' => $jid, 'errstr' => $m); $err = array('op' => 'abort_job', 'jid' => $jid, 'errstr' => $m);
353 354 rg_conn_enq($key, json_encode($err) . "\n"); rg_conn_enq($key, json_encode($err) . "\n");
File scripts/cache.php changed (mode: 100644) (index 27c97ce..e510a5f)
... ... function rg_destroy($k, &$conn_table)
37 37 unset($conn_table['w'][$k]); unset($conn_table['w'][$k]);
38 38 // TODO: seems socket is already closed // TODO: seems socket is already closed
39 39 if (isset($conn_table['conns'][$k]['socket'])) if (isset($conn_table['conns'][$k]['socket']))
40 if (is_resource($conn_table['conns'][$k]['socket']))
40 if (is_resource($conn_table['conns'][$k]['socket'])
41 || is_object($conn_table['conns'][$k]['socket']))
41 42 socket_close($conn_table['conns'][$k]['socket']); socket_close($conn_table['conns'][$k]['socket']);
42 43 unset($conn_table['conns'][$k]); unset($conn_table['conns'][$k]);
43 44 } }
 
... ... function rg_handle_command($k, &$conn_table, $cmd)
200 201 } }
201 202
202 203 if ($no_wait === FALSE) { if ($no_wait === FALSE) {
203 rg_log_debug($k . ': enqueue: ' . $buf);
204 rg_log_debug($k . ': enqueue: ' . rtrim($buf));
204 205 $s['send'] .= $buf; $s['send'] .= $buf;
205 206 $conn_table['w'][$k] = $s['socket']; $conn_table['w'][$k] = $s['socket'];
206 207 } }
 
... ... function rg_handle_recv($k, &$conn_table)
223 224 return; return;
224 225 } }
225 226
226 rg_log_debug($k . ': received: ' . $buf);
227 rg_log_debug($k . ': received: ' . rtrim($buf));
227 228
228 229 $s['recv'] .= $buf; $s['recv'] .= $buf;
229 230 $s['close_at'] = time() + 30; $s['close_at'] = time() + 30;
File scripts/events.php changed (mode: 100644) (index 653a380..2e91724)
... ... function rg_destroy($key)
39 39 if (isset($conn_table['w'][$key])) if (isset($conn_table['w'][$key]))
40 40 unset($conn_table['w'][$key]); unset($conn_table['w'][$key]);
41 41 if (isset($conn_table['conns'][$key]['socket'])) if (isset($conn_table['conns'][$key]['socket']))
42 if (is_resource($conn_table['conns'][$key]['socket']))
42 if (is_resource($conn_table['conns'][$key]['socket'])
43 || is_object($conn_table['conns'][$key]['socket']))
43 44 socket_close($conn_table['conns'][$key]['socket']); socket_close($conn_table['conns'][$key]['socket']);
44 45 unset($conn_table['conns'][$key]); unset($conn_table['conns'][$key]);
45 46 } }
File scripts/rgfs.php changed (mode: 100644) (index 6e7da48..266a767)
... ... function xdispatch_one($key, $tlv)
814 814 break; break;
815 815 } }
816 816
817 $t = @unpack('a' . $t['target_len'] . 'target/a' . $t['link_len'] . 'link', $tlv['data'], 2 + 2);
817 $t = @unpack('a' . $t['target_len'] . 'target'
818 . '/a' . $t['link_len'] . 'link', $tlv['data'], 2 + 2);
818 819 if ($t === FALSE) { if ($t === FALSE) {
819 820 debug($key, 'unpack error link 2: ' . rg_php_err() . ': ' debug($key, 'unpack error link 2: ' . rg_php_err() . ': '
820 821 . bin2hex(substr($tlv['data'], 0, 64)) . '...'); . bin2hex(substr($tlv['data'], 0, 64)) . '...');
 
... ... function xdispatch_one($key, $tlv)
892 893 break; break;
893 894 } }
894 895
895 $t = @unpack('a' . $t['target_len'] . 'target/a'
896 . $t['attr_name_len'] . 'attr_name', $tlv['data'], 2 + 2);
896 $t = @unpack('a' . $t['target_len'] . 'target'
897 . '/a' . $t['attr_name_len'] . 'attr_name', $tlv['data'], 2 + 2);
897 898 if ($t === FALSE) { if ($t === FALSE) {
898 899 debug($key, 'unpack error getxattr 2: ' . rg_php_err() . ': ' debug($key, 'unpack error getxattr 2: ' . rg_php_err() . ': '
899 900 . bin2hex(substr($tlv['data'], 0, 64)) . '...'); . bin2hex(substr($tlv['data'], 0, 64)) . '...');
File scripts/worker.php changed (mode: 100644) (index 03b3505..beb0593)
... ... $features = array();
3069 3069 // stats // stats
3070 3070 $stats = array('jobs' => 0); $stats = array('jobs' => 0);
3071 3071
3072 rg_log('Loading job-*.ser files...');
3072 3073 $jobs = rg_load_files($conf['state'], 'job-[0-9]*.ser', 'id'); $jobs = rg_load_files($conf['state'], 'job-[0-9]*.ser', 'id');
3073 if (!empty($jobs))
3074 rg_log_debug('Jobs loaded from dir: ' . rg_array2string_short($jobs));
3074 // this crashes badly!
3075 //if (!empty($jobs))
3076 // rg_log_debug('Jobs loaded from dir: ' . rg_array2string_short($jobs));
3077 rg_log(' done.');
3075 3078
3076 3079 rg_worker_connect(); rg_worker_connect();
3077 3080
3081 rg_log("Main loop...");
3078 3082 $pid_to_jid = array(); // TODO: what happens to this after restart? $pid_to_jid = array(); // TODO: what happens to this after restart?
3079 3083 while(1) { while(1) {
3080 3084 rg_conn_wait(1); rg_conn_wait(1);
File tests/_run_tests.sh changed (mode: 100755) (index b176ef4..aac1367)
3 3 . ./env.txt . ./env.txt
4 4
5 5 # wh_build must be at the end because takes a lot of time # wh_build must be at the end because takes a lot of time
6 tests="migrate1 \
7 http_del_account \
6 tests="http_del_account \
8 7 git-sha256 pkg_subrepo pkg_rpm gpg http_api http_304 ldap_core ldap \ git-sha256 pkg_subrepo pkg_rpm gpg http_api http_304 ldap_core ldap \
9 8 admin_set_web git_big_push admin_set_git by_http wh_lambda http_keys \ admin_set_web git_big_push admin_set_git by_http wh_lambda http_keys \
10 9 http_forgot \ http_forgot \
File tests/wh_build.php changed (mode: 100644) (index ca5f1dd..997584a)
... ... ini_set('track_errors', 'On');
7 7 $rg_cache_debug = TRUE; $rg_cache_debug = TRUE;
8 8 $test_normal = TRUE; $test_normal = TRUE;
9 9
10 $distro1 = 'fedora';
11 $distro1_major = '38';
12
13 $distro2 = 'debian';
14 $distro2_major = '11';
15 $distro2_code = 'bullseye';
16
10 17 $INC = dirname(__FILE__) . '/../inc'; $INC = dirname(__FILE__) . '/../inc';
11 18 require_once(dirname(__FILE__) . '/config.php'); require_once(dirname(__FILE__) . '/config.php');
12 19 require_once($INC . '/init.inc.php'); require_once($INC . '/init.inc.php');
 
... ... $extra = array(
78 85 'wh::idata::secrets::0::name' => 'secret1', // we cannot use <xss> here - it will be rejected by bash 'wh::idata::secrets::0::name' => 'secret1', // we cannot use <xss> here - it will be rejected by bash
79 86 'wh::idata::secrets::0::value' => 'value1<xss>', 'wh::idata::secrets::0::value' => 'value1<xss>',
80 87 'wh::idata::events' => 'P', 'wh::idata::events' => 'P',
81 'wh::idata::envs[fedora-37-x86_64]' => 'on',
82 'wh::idata::envs[debian-11-amd64]' => 'on',
88 'wh::idata::envs[' . $distro1 . '-' . $distro1_major . '-x86_64]' => 'on',
89 'wh::idata::envs[' . $distro2 . '-' . $distro2_major . '-amd64]' => 'on',
83 90 'wh::idata::packages' => 'nano', 'wh::idata::packages' => 'nano',
84 91 'wh::idata::cmds::1::cmd' => 'make', 'wh::idata::cmds::1::cmd' => 'make',
85 92 'wh::idata::cmds::1::label_ok' => 'success <xss>', 'wh::idata::cmds::1::label_ok' => 'success <xss>',
 
... ... $r = rg_test_packages($rg_ui, $repo);
161 168 // We have 1 more build for createrepo and one for Debian // We have 1 more build for createrepo and one for Debian
162 169 do { do {
163 170 $r = rg_test_packages($rg_ui, $repo); $r = rg_test_packages($rg_ui, $repo);
164 file_put_contents('wh_build_pkg_r.out', json_encode($r, JSON_PRETTY_PRINT));
165 file_put_contents('wh_build_pkg_debug.out', json_encode($r['rg_debug_html'], JSON_PRETTY_PRINT));
171 file_put_contents('wh_build_pkg_r.out',
172 json_encode($r, JSON_PRETTY_PRINT));
173 file_put_contents('wh_build_pkg_debug.out',
174 json_encode($r['rg_debug_html'], JSON_PRETTY_PRINT));
166 175
167 176 $_base = '/op/pkgrepo/user/' . $rg_ui['username'] $_base = '/op/pkgrepo/user/' . $rg_ui['username']
168 . '/' . $pkg_repo_pub['pi::name'] . '/' . $pkg_subrepo_pub['sr::name'];
169 $pub_rpm_ready = strstr($r['body'], $_base . '/fedora');
170 $pub_deb_ready = strstr($r['body'], $_base . '/debian');
177 . '/' . $pkg_repo_pub['pi::name']
178 . '/' . $pkg_subrepo_pub['sr::name'];
179 $pub_rpm_ready = strstr($r['body'], $_base . '/' . $distro1);
180 $pub_deb_ready = strstr($r['body'], $_base . '/' . $distro2);
171 181
172 182 $_base = '/op/pkgrepo/user/' . $rg_ui['username'] $_base = '/op/pkgrepo/user/' . $rg_ui['username']
173 . '/' . $pkg_repo_priv['pi::name'] . '/' . $pkg_subrepo_priv['sr::name'];
174 $priv_rpm_ready = strstr($r['body'], $_base . '/fedora');
175 $priv_deb_ready = strstr($r['body'], $_base . '/debian');
183 . '/' . $pkg_repo_priv['pi::name']
184 . '/' . $pkg_subrepo_priv['sr::name'];
185 $priv_rpm_ready = strstr($r['body'], $_base . '/' . $distro1);
186 $priv_deb_ready = strstr($r['body'], $_base . '/' . $distro2);
176 187 rg_log('pub_rpm_ready=' . ($pub_rpm_ready !== FALSE ? 'true' : 'false')); rg_log('pub_rpm_ready=' . ($pub_rpm_ready !== FALSE ? 'true' : 'false'));
177 188 rg_log('pub_deb_ready=' . ($pub_deb_ready !== FALSE ? 'true' : 'false')); rg_log('pub_deb_ready=' . ($pub_deb_ready !== FALSE ? 'true' : 'false'));
178 189 rg_log('priv_rpm_ready=' . ($priv_rpm_ready !== FALSE ? 'true' : 'false')); rg_log('priv_rpm_ready=' . ($priv_rpm_ready !== FALSE ? 'true' : 'false'));
 
... ... rg_log_exit();
206 217 rg_log(''); rg_log('');
207 218 rg_log_enter('Checking public dotrepo download'); rg_log_enter('Checking public dotrepo download');
208 219 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
209 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], 'fedora', 37,
210 'x86_64/os/rocketgit-' . $rg_ui['username'] . '-'
211 . $pkg_repo_pub_name . '-' . $pkg_subrepo_pub['sr::name'] . '-1.1-1.noarch.rpm');
220 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], $distro1,
221 $distro1_major, 'x86_64/os/rocketgit-' . $rg_ui['username'] . '-'
222 . $pkg_repo_pub_name . '-' . $pkg_subrepo_pub['sr::name']
223 . '-1.1-1.noarch.rpm');
212 224 // TODO: try to unpack the rpm? // TODO: try to unpack the rpm?
213 225 $e = 'content-type: application/x-rpm'; $e = 'content-type: application/x-rpm';
214 226 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
215 227 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
216 rg_log('Content-Type is not ok [' . $e . ']!');
228 rg_log('Content-Type is not ok e=[' . $e . ']!');
217 229 exit(1); exit(1);
218 230 } }
219 231 rg_log_exit(); rg_log_exit();
 
... ... rg_log_exit();
223 235 rg_log(''); rg_log('');
224 236 rg_log_enter('Checking private dotrepo download'); rg_log_enter('Checking private dotrepo download');
225 237 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
226 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], 'fedora', 37,
227 'x86_64/os/rocketgit-' . $rg_ui['username'] . '-'
228 . $pkg_repo_priv_name . '-' . $pkg_subrepo_priv['sr::name'] . '-1.1-1.noarch.rpm');
238 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'],
239 $distro1, $distro1_major, 'x86_64/os/rocketgit-'
240 . $rg_ui['username'] . '-' . $pkg_repo_priv_name
241 . '-' . $pkg_subrepo_priv['sr::name'] . '-1.1-1.noarch.rpm');
229 242 // TODO: try to unpack the rpm? // TODO: try to unpack the rpm?
230 243 $e = 'content-type: application/x-rpm'; $e = 'content-type: application/x-rpm';
231 244 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
232 245 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
233 rg_log('Content-Type is not ok [' . $e . ']!');
246 rg_log('Content-Type is not ok e=[' . $e . ']!');
234 247 exit(1); exit(1);
235 248 } }
236 249 rg_log_exit(); rg_log_exit();
 
... ... rg_log_exit();
239 252 rg_log(''); rg_log('');
240 253 rg_log_enter('Checking private dotrepo download (by bad user)'); rg_log_enter('Checking private dotrepo download (by bad user)');
241 254 $r = rg_test_packages_file($rg_bad, $rg_ui, 'user', $r = rg_test_packages_file($rg_bad, $rg_ui, 'user',
242 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], 'fedora', 37,
243 'x86_64/os/rocketgit-' . $rg_ui['username'] . '-'
255 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], $distro1,
256 $distro1_major, 'x86_64/os/rocketgit-' . $rg_ui['username'] . '-'
244 257 . $pkg_repo_priv_name . '-' . $pkg_subrepo_priv['sr::name'] . '-1.1-1.noarch.rpm'); . $pkg_repo_priv_name . '-' . $pkg_subrepo_priv['sr::name'] . '-1.1-1.noarch.rpm');
245 258 // TODO: try to unpack the rpm? // TODO: try to unpack the rpm?
246 259 if ($r['ci']['http_code'] != 404) { if ($r['ci']['http_code'] != 404) {
 
... ... rg_log_exit();
254 267 rg_log(''); rg_log('');
255 268 rg_log_enter('Checking packages repomd download'); rg_log_enter('Checking packages repomd download');
256 269 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
257 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], 'fedora', 37,
258 'x86_64/os/repodata/repomd.xml');
270 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'],
271 $distro1, $distro1_major, 'x86_64/os/repodata/repomd.xml');
259 272 $e = '<?xml '; $e = '<?xml ';
260 273 if (!strstr($r['body'], $e)) { if (!strstr($r['body'], $e)) {
261 274 rg_log_ml('packages repomd page: ' . $r['body']); rg_log_ml('packages repomd page: ' . $r['body']);
 
... ... if (!strstr($r['body'], $e)) {
265 278 $e = 'content-type: text/xml'; $e = 'content-type: text/xml';
266 279 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
267 280 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
268 rg_log('Content-Type is not ok [' . $e . ']!');
281 rg_log('Content-Type is not ok e=[' . $e . ']!');
269 282 exit(1); exit(1);
270 283 } }
271 284 rg_log_exit(); rg_log_exit();
 
... ... rg_log_exit();
274 287 rg_log(''); rg_log('');
275 288 rg_log_enter('Checking packages rpm download'); rg_log_enter('Checking packages rpm download');
276 289 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
277 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], 'fedora', 37,
278 'x86_64/os/' . $rg_ui['username'] . '+' . $repo['name'] . '-0.1-1.x86_64.rpm');
290 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], $distro1,
291 $distro1_major, 'x86_64/os/' . $rg_ui['username']
292 . '+' . $repo['name'] . '-0.1-1.x86_64.rpm');
279 293 $e = 'content-type: application/x-rpm'; $e = 'content-type: application/x-rpm';
280 294 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
281 295 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
282 rg_log('Content-Type is not ok [' . $e . ']!');
296 rg_log('Content-Type is not ok e=[' . $e . ']!');
283 297 exit(1); exit(1);
284 298 } }
285 299 rg_log_exit(); rg_log_exit();
286 300
287 301
288 302
289 ////////////////////////// Debian area starts
303 ////////////////////////// $distro2 area starts
290 304
291 305 rg_log(''); rg_log('');
292 306 rg_log_enter('Checking keyring as owner user'); rg_log_enter('Checking keyring as owner user');
293 307 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
294 308 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'],
295 'debian', 'bullseye', 'keyring');
309 $distro2, $distro2_code, 'keyring');
296 310 $e = 'content-type: application/octet-stream'; $e = 'content-type: application/octet-stream';
297 311 if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) { if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) {
298 312 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
299 rg_log('Code/Content-Type is not ok [' . $e . ']!');
313 rg_log('Code/Content-Type is not ok e=[' . $e . ']!');
300 314 exit(1); exit(1);
301 315 } }
302 316 rg_log_exit(); rg_log_exit();
 
... ... rg_log('');
305 319 rg_log_enter('Checking auth as owner user'); rg_log_enter('Checking auth as owner user');
306 320 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
307 321 $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'], $pkg_repo_pub_name, $pkg_subrepo_pub['sr::name'],
308 'debian', 'bullseye', 'auth');
322 $distro2, $distro2_code, 'auth');
309 323 $e = 'content-type: text/plain'; $e = 'content-type: text/plain';
310 324 if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) { if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) {
311 325 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
312 rg_log('Content-Type is not ok [' . $e . ']!');
326 rg_log('Content-Type is not ok e=[' . $e . ']!');
313 327 exit(1); exit(1);
314 328 } }
315 329 if (strncmp($r['body'], 'machine ', 8) != 0) { if (strncmp($r['body'], 'machine ', 8) != 0) {
316 rg_log('Content of auth file does not start with machine keyword: [' . $r['body'] . ']!');
330 rg_log('Content of auth file does not start with'
331 . ' machine keyword: [' . $r['body'] . ']!');
317 332 exit(1); exit(1);
318 333 } }
319 334 // TODO: check if password is ok // TODO: check if password is ok
 
... ... $u = rg_pkg_transform_user('deb', $rg_ui['uid'], $rg_ui['username']);
325 340 $u1 = substr($u, 0, 1); $u2 = substr($u, 1, 1); $u1 = substr($u, 0, 1); $u2 = substr($u, 1, 1);
326 341 $r = rg_test_packages_file($rg_ui, $rg_ui, 'user', $r = rg_test_packages_file($rg_ui, $rg_ui, 'user',
327 342 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'],
328 'debian', 'bullseye',
343 $distro2, $distro2_code,
329 344 'pool/main/' . $u1 . '/' . $u2 . '/' . $u 'pool/main/' . $u1 . '/' . $u2 . '/' . $u
330 345 . '+' . rg_pkg_transform_repo('deb', $repo['name']) . '_0.1_amd64.deb'); . '+' . rg_pkg_transform_repo('deb', $repo['name']) . '_0.1_amd64.deb');
331 346 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
332 347 $e = 'content-type: application/octet-stream'; $e = 'content-type: application/octet-stream';
333 348 if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) { if (!stristr($r['header'], $e) || ($r['ci']['http_code'] != 200)) {
334 349 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
335 rg_log('Content-Type is not ok [' . $e . ']!');
350 rg_log('Content-Type is not ok e=[' . $e . ']!');
336 351 exit(1); exit(1);
337 352 } }
338 353 rg_log_exit(); rg_log_exit();
 
... ... rg_log('');
342 357 rg_log_enter('Checking auth as bad (not owner) user'); rg_log_enter('Checking auth as bad (not owner) user');
343 358 $r = rg_test_packages_file($rg_bad, $rg_ui, 'user', $r = rg_test_packages_file($rg_bad, $rg_ui, 'user',
344 359 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'],
345 'debian', 'bullseye', 'auth');
360 $distro2, $distro2_code, 'auth');
346 361 if ($r['ci']['http_code'] != 404) { if ($r['ci']['http_code'] != 404) {
347 362 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
348 363 rg_log('We must get 404!'); rg_log('We must get 404!');
 
... ... $u = rg_pkg_transform_user('deb', $rg_ui['uid'], $rg_ui['username']);
358 373 $u1 = substr($u, 0, 1); $u2 = substr($u, 1, 1); $u1 = substr($u, 0, 1); $u2 = substr($u, 1, 1);
359 374 $r = rg_test_packages_file($rg_bad, $rg_ui, 'user', $r = rg_test_packages_file($rg_bad, $rg_ui, 'user',
360 375 $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'], $pkg_repo_priv_name, $pkg_subrepo_priv['sr::name'],
361 'debian', 'bullseye',
376 $distro2, $distro2_code,
362 377 'pool/main/' . $u1 . '/' . $u2 . '/' . $u 'pool/main/' . $u1 . '/' . $u2 . '/' . $u
363 378 . '+' . rg_pkg_transform_repo('deb', $repo['name']) . '_0.1_amd64.deb'); . '+' . rg_pkg_transform_repo('deb', $repo['name']) . '_0.1_amd64.deb');
364 379 rg_log_ml('r: ' . print_r($r, TRUE)); rg_log_ml('r: ' . print_r($r, TRUE));
 
... ... if ($r['ci']['http_code'] != 404) {
369 384 } }
370 385 rg_log_exit(); rg_log_exit();
371 386
372 ////////////////////////// Debian area ends
387 ////////////////////////// $distro2 area ends
373 388
374 389
375 390
376 391 rg_log(''); rg_log('');
377 392 rg_log_enter('Checking artifacts 1'); rg_log_enter('Checking artifacts 1');
378 $r = rg_test_artifacts_page($rg_ui, $repo, '/envs/fedora-37-x86_64');
379 $e = '<a href="/user/' . $rg_ui['username'] . '/' . $repo['name'] . '/artifacts/download/envs/fedora-37-x86_64/bla%C8%99.out">Download</a>';
393 $r = rg_test_artifacts_page($rg_ui, $repo,
394 '/envs/' . $distro1 . '-' . $distro1_major . '-x86_64');
395 $e = '<a href="/user/' . $rg_ui['username'] . '/' . $repo['name']
396 . '/artifacts/download/envs/' . $distro1 . '-'
397 . $distro1_major . '-x86_64/bla%C8%99.out">Download</a>';
380 398 if (!strstr($r['body'], $e)) { if (!strstr($r['body'], $e)) {
381 399 rg_log_ml('artifacts: ' . $r['body']); rg_log_ml('artifacts: ' . $r['body']);
382 rg_log('Link to artifact not found [' . $e . ']!');
400 rg_log('Link to artifact not found e=[' . $e . ']!');
383 401 exit(1); exit(1);
384 402 } }
385 $r = rg_test_artifacts_file($rg_ui, $repo, '/envs/fedora-37-x86_64/blaș.out');
403 $r = rg_test_artifacts_file($rg_ui, $repo,
404 '/envs/' . $distro1 . '-' . $distro1_major . '-x86_64/blaș.out');
386 405 rg_log_ml('blaș.out: ' . print_r($r, TRUE)); rg_log_ml('blaș.out: ' . print_r($r, TRUE));
387 406 $e = 'blaș' . "\n"; $e = 'blaș' . "\n";
388 407 if (strcmp($r['body'], $e) != 0) { if (strcmp($r['body'], $e) != 0) {
389 rg_log('Content of artifact not ok [' . $r['body'] . '] != [' . $e . ']!');
408 rg_log('Content of artifact not ok'
409 . ' [' . $r['body'] . '] != e=[' . $e . ']!');
390 410 exit(1); exit(1);
391 411 } }
392 412 $e = 'content-length: 6' . "\r\n"; $e = 'content-length: 6' . "\r\n";
393 413 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
394 414 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
395 rg_log('Content-Length of artifact not ok [' . $e . ']!');
415 rg_log('Content-Length of artifact not ok e=[' . $e . ']!');
396 416 exit(1); exit(1);
397 417 } }
398 418 $e = 'content-type: text/plain'; $e = 'content-type: text/plain';
399 419 if (!stristr($r['header'], $e)) { if (!stristr($r['header'], $e)) {
400 420 rg_log_ml('headers: ' . $r['header']); rg_log_ml('headers: ' . $r['header']);
401 rg_log('Content-type of artifact not ok [' . $e . ']!');
421 rg_log('Content-type of artifact not ok e=[' . $e . ']!');
402 422 exit(1); exit(1);
403 423 } }
404 424 // TODO: check artifacts fs/meta? // TODO: check artifacts fs/meta?
 
... ... rg_log('');
413 433 rg_log_enter('Make a change and push again (for delta packages)'); rg_log_enter('Make a change and push again (for delta packages)');
414 434 $r = rg_exec('cd temp_repos/wh_build' $r = rg_exec('cd temp_repos/wh_build'
415 435 . ' && sed -i -e "s/^Version:.*0.1/Version: 0.2/" wh_build.spec' . ' && sed -i -e "s/^Version:.*0.1/Version: 0.2/" wh_build.spec'
416 . ' && sed -i -e "s/0.1/0.2/" debian/changelog'
436 . ' && sed -i -e "s/0.1/0.2/" ' . $distro2 . '/changelog'
417 437 . ' && git commit -a -m "new version"' . ' && git commit -a -m "new version"'
418 438 . ' && git push', . ' && git push',
419 439 '', FALSE, FALSE, FALSE); '', FALSE, FALSE, FALSE);
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