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 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 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); |