Commit graph

91 commits

Author SHA1 Message Date
Tomas Kopecek
9d289bc336 convert data to string in escapeHTML first
Related: https://pagure.io/koji/issue/3449
2022-08-17 11:16:13 +02:00
Jana Cupova
c83d4598de Escape html values
Fixes: https://pagure.io/koji/issue/3155
2022-02-07 09:36:59 +01:00
Jana Cupova
d370e42c64 www: rpminfo/fileinfo/imageinfo/archiveinfo page shows human-readable filesize
Fixes: https://pagure.io/koji/issue/2943
2021-12-13 17:05:17 +01:00
Tomas Kopecek
aa2011c72b web: don't use count(*) on first tasks page
Fixes: https://pagure.io/koji/issue/2482
2021-05-10 09:13:13 +02:00
Alex Iribarren
94df7a1f74 Make flake8 happy 2021-04-19 15:09:36 +02:00
Alex Iribarren
41d5414245 Don't encode already encoded entities 2021-04-19 15:09:36 +02:00
Alex Iribarren
1c7f83acf6 Escape single and double quotes as well, plus add test 2021-04-19 15:09:36 +02:00
Alex Iribarren
a233a0ca72 Show VCS and DistURL tags as links when appropriate 2021-04-19 15:09:36 +02:00
Tomas Kopecek
ebdbb80e02 drop PyOpenSSL usage
We've replaced it with requests library some time ago, this code has no
better sensitivity than requests error checking, so we can drop it
completely.

Fixes: https://pagure.io/koji/issue/2752
2021-03-24 14:43:40 +01:00
Tomas Kopecek
6d4831a6dc web: input validation
Fix for CVE-2020-15856

Fixes: https://pagure.io/koji/issue/2645
2021-01-18 11:06:35 +01:00
Michal Privoznik
66ba134859 Install into /usr/lib rather than /usr/lib64/
In koji-1.22.0-129-g0ef3c751 I've changed the way how
site-packages directory is obtained. What I did not realize back
then is there can be multilib systems which will not search for
packages in /usr/lib64. But 64bit systems do look into /usr/lib.
Therefore, let's pick the location where both systems work.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1894261
Fixes: #2578
https://pagure.io/koji/issue/2578
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2020-11-27 10:00:52 +01:00
Michal Privoznik
0ef3c75185 Simplify obtaining of PKGDIR
So far, in all Makefiles we have a complicated way to construct
PKGDIR path which is used to install python modules into.
Firstly, python version is obtained, and then system prefix and
these are then used to construct the PKGDIR path. Well, we can do
better. We can use 'site.getsitepackages()[0]' to obtain exactly
the path we are after.

This also fixes the problem on distributions which have split
/usr/lib and /usr/lib64 directories, because with the way we are
constructing the PKGDIR path we assume that the directories are
the same (or one is a symlink to another). Well, that is not
always the case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2020-09-22 13:45:48 +02:00
Tomas Kopecek
50bcb6f3bc replace md5 with sha256 2020-06-24 14:42:01 +02:00
Yu Ming Zhu
0a61104280 web: use sha1 for token generation instead of md5(disabled by FIPS)
fixes: #2291
2020-06-24 14:42:00 +02:00
Tomas Kopecek
af311184fc dropping six from hub/web 2020-06-18 15:41:35 +02:00
Tomas Kopecek
b84be525c0 www: repoinfo page
Fixes: https://pagure.io/koji/issue/2181
2020-05-25 10:39:34 +02:00
Tomas Kopecek
758f0a0311 don't break on invalid task
Fixes: https://pagure.io/koji/issue/2112
2020-03-30 15:03:34 +02:00
Yuming Zhu
cf34706f04 use Exception instead of BaseException for bare expection 2020-03-03 21:38:22 +08:00
Yuming Zhu
c5db34a8e1 flake8: apply E501 with max-line-length=99 2020-03-03 21:38:22 +08:00
Yuming Zhu
f1ba6cefd7 flake8: apply all rest E7 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
6ed30954b2 flake8: apply E71x rule 2020-03-03 21:38:22 +08:00
Yuming Zhu
fa69c4904e flake8: apply E70x rule 2020-03-03 21:38:22 +08:00
Yuming Zhu
0f727a2ab4 flake8: apply E3 rules 2020-03-03 21:38:22 +08:00
Yuming Zhu
05340b146b flake8: apply E2 rules except E266 2020-03-03 21:38:21 +08:00
Yuming Zhu
ce1f9928af flake8: apply E1 rules 2020-03-03 21:38:21 +08:00
Yuming Zhu
97cfaa4fcf flake8: follow E265 rule 2020-03-03 21:35:08 +08:00
Tomas Kopecek
96d3cff5f2 remove usage of deprecated cgi.escape function
Fixes: https://pagure.io/koji/issue/1887
2020-02-13 14:44:50 +01:00
Yu Ming Zhu
5b83c682e4 remove unused imports 2019-12-12 11:00:58 +00:00
Yu Ming Zhu
b8653736dd sort imports in www 2019-12-12 11:00:56 +00:00
Tomas Kopecek
a803f0a0f3 [web] human-friendly file sizes in taskinfo page
Fixes: https://pagure.io/koji/issue/1819
2019-12-12 13:23:26 +01:00
Yuming Zhu
7a6ebc851f improve test and clean targets in Makefiles 2019-11-27 15:42:30 +01:00
Tomas Kopecek
dfbe322222 deprecate sha1/md5_constructor from koji.util
These functions are now fully provided by hashlib. Commit removes their
usage from koji's codebase and leaves deprecation message in lib.

Final removal from lib is scheduled to 1.21.

Fixes: https://pagure.io/koji/issue/1487
2019-08-12 16:07:55 -04:00
Tomas Kopecek
15e4d07763 encode to bytes only under py3
Related: https://pagure.io/koji/pull-request/1498
2019-06-24 18:09:10 -04:00
Mengjing Shi
2d88836a4b Pass bytes to md5_constructor
Fixes login TypeError on koji-web
2019-06-24 18:07:23 -04:00
Tomas Kopecek
7a5c9130bc retain form values in search page 2019-06-14 15:23:49 -04:00
Tomas Kopecek
e5b0a3ac6e display task durations in webui
Fixes: https://pagure.io/koji/issue/1382
2019-05-06 10:33:06 -04:00
Tomas Kopecek
eeeeb3ab78 skip fixEncoding for py3 2019-03-04 10:13:51 -05:00
Tomas Kopecek
ee673d4b66 Web UI python3 changes
Fixes: https://pagure.io/koji/issue/890
2019-02-12 15:01:37 -05:00
Tomas Kopecek
ccdb8ac34c Use python2/3 instead of python in Makefile/spec
Fixes: https://pagure.io/koji/issue/1018
2019-01-28 06:06:50 -05:00
Tomas Kopecek
8e61dc7c56 python-modernize -f libmodernize.fixes.fix_classic_division 2018-07-11 17:37:40 -04:00
Tomas Kopecek
be535c2854 python-modernize -f libmodernize.fixes.fix_imports_six 2018-07-11 17:37:39 -04:00
Tomas Kopecek
b96092334d python-modernize -f libmodernize.fixes.fix_xrange_six 2018-07-11 17:37:39 -04:00
Tomas Kopecek
5ac2a6b8f0 display suid bit in web ui
Related: https://pagure.io/koji/issue/616
2017-10-05 10:38:48 -04:00
Mike McLean
9f3568dcb7 handle buildroots with state=None
If content generators are in use, they will create buildroots that have no
state. This change prevents this function from erroring in that case.
2017-04-06 14:07:11 -04:00
Tomas Kopecek
70224c42c1 remove obsoleted StandardError 2017-03-17 11:35:53 -04:00
Tomas Kopecek
cc9fff9840 remove has_key (not working in python3) 2017-03-07 08:15:20 -05:00
Tomas Kopecek
1494301465 use new exception syntax 2017-03-02 10:52:30 -05:00
Tomas Kopecek
c143d0b88f print statement -> print function 2017-02-28 10:55:56 -05:00
Xibo Ning
fe8c5964ca fix method names to listPackagesSimple and countAndFilterResults.
1. replace listPackages call by listPackagesSimple.
    2. replace filterResults by countAndFilterResults.
2017-01-17 15:08:26 -05:00
Xibo Ning
fbc8314d13 fix the link to full results 2016-12-13 21:45:41 -05:00