1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Commit Graph

165 Commits

Author SHA1 Message Date
Brandon Caton
b8cf8932cf ui: Repository settings feature flag (PROJQUAY-4565) (#1677)
Adds feature flag to restrict the repository settings feature.
2022-12-15 16:26:44 -05:00
Brandon Caton
017c4f0ba1 cors: Adding missing method type (PROJQUAY-4800) (#1651)
The PUT method has not been added to the list of cors methods, causing PUT requests to fail.
2022-12-01 15:10:47 -05:00
Kenny Lee Sin Cheong
b128936b50 users: fix behavior when using ldap and restricted user whitelist is set (PROJQUAY-4767) (#1640) 2022-11-23 15:22:15 -05:00
Kenny Lee Sin Cheong
0caa4203ec users: prevent CREATE_NAMESPACE_ON_PUSH is restricted (PROJQUAY-4702) (#1621)
Prevent creating namespaces/orgs on pushes (CREATE_NAMESPACE_ON_PUSH)
if user is restricted.

Also updates RESTRICTED_USERS_WHITELIST to defaults to all if not set,
given that FEATURE_RESTRICTED_USERS is set.
2022-11-09 18:23:01 -05:00
Kenny Lee Sin Cheong
c84067a4d6 users: add restricted users' filter (PROJQUAY-1245) (#1551)
- Similar to LDAP_SUPERUSER_FILTER, add a specific filter to define
restricted users, based on the LDAP_USER_FILTER
- restrict writes on restricted users' own namespace. Normal
permissions applies on organization membership
- add global readonly superuser GLOBAL_READONLY_SUPER_USERS (PROJQUAY-2604)
- Removes RESTRICTED_USER_INCLUDE_ROBOTS, FEATURE_RESTRICTED_READ_ONLY_USERS
2022-10-28 13:38:37 -04:00
Jonathan King
304087f9c9 cleanup: Remove old validation code (PROJQUAY-4606) (#1562)
- The old validation code is no longer used and can be removed from Quay
2022-10-24 11:02:14 -07:00
Oleg Bulatov
15ea8350db repomirror: Use skopeo list-tags to get repo tags (PROJQUAY-2179) (#1427)
* repomirror: Use skopeo list-tags to get repo tags

`skopeo inspect foo` returns infromation about the image `foo:latest`,
and repository tags. Quay needs only list of tags, so it should use
`skopeo list-tags` that doesn't fail if `foo:latest` doesn't exist.

* Update type hints

* On local-dev Quay does not provide valid TLS certificate
2022-10-12 09:45:04 -04:00
Kenny Lee Sin Cheong
2b3c3cc584 api: feature to limit org creation to superusers (PROJQUAY-1245) (#1516)
* api: feature to limit org creation to superusers

Introduces the following configuration flags:

FEATURE_SUPERUSERS_ORG_CREATION_ONLY:
    Limit org creation to superusers only

FEATURE_SUPERUSERS_FULL_ACCESS:
    Grant superusers read/write access to registry content in all namespaces

FEATURE_RESTRICTED_USERS:
    Users considered as restricted are not anle to create organization

RESTRICTED_USERS_WHITELIST:
    Whitelist for FEATURE_RESTRICTED_USERS

RESTRICTED_USER_INCLUDE_ROBOTS:
    Whether or not to include the user namespace's robots

RESTRICTED_USER_READ_ONLY:
    Only allow read-only operations for restricted users

* Revert superuser repositorylist endpoint
2022-09-23 09:41:23 -04:00
Syed Mushtaq Ahmed
a101553cb1 storage: return S3 url only for ip ranges in the same region (PROJQUAY-4498) (#1539)
This optimization ensures that we return the direct S3 URL for
CloudFront storage only for requests from the same region. This
ensures we don't get charged for cross-region traffic to S3
2022-09-22 10:13:02 -04:00
Dave O'Connor
69ad27724b Add feature flags for IPv6 (#1525)
Signed-off-by: Dave O'Connor <doconnor@redhat.com>
2022-09-12 09:09:39 -04:00
Sunandadadi
5f1fdbc59f ui: Support on Old UI to switch to New UI (PROJQUAY-4124) (#1504)
* Support on Old UI to switch to New UI
2022-08-31 10:33:53 -04:00
Oleg Bulatov
31e5b00b3c Disable active repository tags caching for OCI tests (#1483) 2022-08-26 15:38:13 +02:00
Brandon Caton
30298699fc mirror: Default mirror rollback to false (PROJQUAY-4296) (#1490)
Adds the `REPO_MIRROR_ROLLBACK` option to specify whether the mirror will rollback the state of the repo on failure of any one of the tags. Defaults to false. Adds additional `PARTIAL_SYNC` error status which logs the tags that failed to sync to the console.
2022-08-23 14:27:22 -04:00
Dave O'Connor
4909b0eff9 Remove unused decode (#1473) 2022-08-09 09:33:11 -04:00
Dave O'Connor
db225c3293 Bump PyJWT (#1465) 2022-08-08 11:02:09 -04:00
Harish Govindarajulu
1c8f5df6e2 Add Feature flag to whitelist users from recaptcha check(PROJQUAY-3697) (#1454)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2022-07-22 16:18:45 -04:00
Brandon Caton
9eb4fb6aa4 Revert workqueue refactor (#1456)
Currently the prometheus and GC workers are not running correctly.
Reverting the following commits:
- 4e1a985e70
- dac183a1ef
- 68a0d9eaf0
- af1aacea08
- f334b80098
2022-07-22 13:11:39 -04:00
Syed Mushtaq Ahmed
d37dd766ac api: fix CORS headers, use concat instead of extend (PROJQUAY-4163) (#1445)
Fixes issue where we send large header on CORS
2022-07-19 17:52:09 -04:00
Kenny Lee Sin Cheong
6ed0bcdedc auth: allow rs384 in jwt (PROJQUAY-4148) (#1449)
Allow the use of RS384 for jwt and oidc.
2022-07-18 14:03:27 -04:00
Syed Mushtaq Ahmed
bf99e71851 api: Update werkzeug to 1.0.0 and add valid CORS methods (PROJQUAY-4163) (#1443)
werkzeug 1.0.0 allows us to set samesite policy to "None" for CORS
requests from quay-ui
2022-07-14 14:30:52 -04:00
Kenny Lee Sin Cheong
14c8d13984 mirror: Pass command output to a tempfile instead of pipe (PROJQUAY-3145) (#1417)
The default pipe often has a size limit on most systems, which will be
truncated if going over that limit. That can happen when skopeo is
run with --debug set. To workaround this, use temporary files for
stdout and stderr.
2022-06-29 13:29:32 -04:00
Syed Mushtaq Ahmed
1a016efc80 ui: Add CSRF and token endpoint and public config endpoint (PROJQUAY-3865) (#1323)
Adds /csrf_token and /config API endpoints to enable integration with
the new UI
2022-06-29 12:14:28 -04:00
Oleg Bulatov
dac183a1ef Replace app with singletons.config and workqueues (#1399)
Where it is possible, instead of importing app, import only required
packages.
2022-06-20 12:07:13 +02:00
Oleg Bulatov
f334b80098 Reduce memory usage by notificationworker (#1370) 2022-06-16 18:44:13 +02:00
Oleg Bulatov
ed8f12ba34 Enable some flake8 checks in CI (#1389) 2022-06-16 18:22:16 +02:00
Oleg Bulatov
5eaf0584db chore: Run mypy as CI job (#1363)
* Run mypy as CI job

* Fix peewee.pyi and configure pyright
2022-06-13 11:01:17 +02:00
Flavian Missi
d20542aa45 fix several warnings (#1374)
mostly invalid escape sequences
2022-06-10 11:46:56 +02:00
Kenny Lee Sin Cheong
5471d3cbcb secscan: deprecate support for Clair V2 (PROJQUAY-2837) (#951)
Removes read support for Clair V2, along with the need to package
jwtproxy with Quay.

TODO: Drop deprecate image api + image table, remove image data model.
2022-05-31 10:15:54 -04:00
Kenny Lee Sin Cheong
776dbd90d5 secscan: update https proxy scheme (#1340)
Update the https proxy scheme from "https" to "http". The scheme was
ignored prior to urllib3 1.26, which is why it was working.

https://github.com/psf/requests/issues/5943#issuecomment-926615360
https://github.com/quay/quay/pull/1250/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552R131
2022-05-24 18:45:05 -04:00
Jonathan King
3140a62e01 Revert "Revert "quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)" (#1273)" (#1289)
This reverts commit 8324586e4c.
2022-04-27 13:16:53 -07:00
Kenny Lee Sin Cheong
8324586e4c Revert "quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)" (#1273)
This reverts commit 247fec3b05.
2022-04-20 15:30:54 -04:00
Kenny Lee Sin Cheong
d719dfadc5 secscan: optimize deduplicating manifests for indexing in securityworker (PROJQUAY-3501) (#1247)
Acquire lock on recent manifests batch to prevent multiple workers
from working on the same set.
2022-04-19 11:34:53 -04:00
Karthikeyan Singaravelan
7384fabf5a Import ABC from collections.abc for Python 3.10 compatibility (#1193) 2022-04-19 11:24:48 -04:00
Jonathan King
247fec3b05 quayio: Add export compliance service to Red Hat SSO (PROJQUAY-2056) (#1239)
- Add FEATURE_EXPORT_COMPLIANCE to config schema
- Add call to export compliance service during OAuth workflow when feature is enabled
2022-04-18 12:45:29 -04:00
Brandon Caton
d2e758dad5 mirror: Get all tags during rollback (PROJQUAY-3146) (#1244)
During a rollback the mirror worker checks for new tags that were created in the repository in the time that the mirror operation has been running. If it encounters older tags that have been updated it will attempt to create a new tag that will point to the previous manifest. Currently for large lists of tags this will fail since we only retrieve the 100 latest tags. The mirror worker will never reach the tags that have been updated and will never recreate them, leading to the behavior of deleting tags during a rollback.
2022-04-14 09:11:48 -04:00
Kenny Lee Sin Cheong
53aaa5493b secscan: add indexer service request duration metric (PROJQUAY-3501) (#1243)
Add histogram for request duration on indexer service. Add random
batch to manifest iterator to reduce duplicate work while manifests
are being backfilled.
2022-04-13 10:04:43 -04:00
Kenny Lee Sin Cheong
dd1eab5238 Revert "secscan: add a global lock on security worker runs (PROJQUAY-3501) (#1226)" (#1232)
This reverts commit 9d89b6fa47.
2022-04-06 11:27:06 -04:00
Kenny Lee Sin Cheong
9d89b6fa47 secscan: add a global lock on security worker runs (PROJQUAY-3501) (#1226)
Add a global lock on security worker iterations, based on the value of
the current pagination token. This is to avoid multilple worker
processes possibly doing work on the same set of manifests.
2022-04-05 13:26:06 -04:00
Brandon Caton
ef91c57c23 format: Updating black to resolve click dependency issue (PROJQUAY-3487) (#1209)
Currently the CI breaks due to a dependency of black, `click`, breaking with it's latest release with `ImportError: cannot import name '_unicodefun' from 'click'`. Since black does not pin it's version of click it pulls in the latest version containing the breaking change and fails the CI check. This updates black with the patch. [See the original issue here.](https://github.com/psf/black/issues/2964) The rest of the changes are format updates introduced with the latest version of black.
2022-03-29 15:34:57 -04:00
Flavian Missi
fe4d66b030 feat: pull-thru proxy cache (#1053)
introduces the possibility to pull images from external registries
through Quay, storing them locally for faster subsequent pulls.

Closes PROJQUAY-3030 and PROJQUAY-3033
2022-03-23 17:20:00 +01:00
Oleg Bulatov
a13f4cf624 Use final image for development (#1060) 2022-03-16 14:15:42 +01:00
Syed Mushtaq Ahmed
5a1fa17a79 invoice: update invoice template to fix layout (PROJQUAY-3267) (#1182)
Update the invoice template to render correct size
2022-03-11 14:15:33 -05:00
Syed Mushtaq Ahmed
8da53e9720 billing: use BytesIO when rendering invoice (PROJQUAY-3267) (#1174)
Migrating to py3 broke invoices. xhtml2pdf returns `bytes` instead of `str`
2022-03-09 14:35:51 -05:00
kwestpharedhat
15fa20a115 QuotaManagement: Reporting (PROJQUAY-2936) (#1048)
* initial commit

* fixing some bugs

* create quota management

Fix json request json type

Creation of quota is working

All quota crud operations

crud for quota limits

repository size reporting

adding registry model

error levels

namespacequota

remove holdover from user file

finalizing refactor to namespace over organization

finalization of functionality

fixing formatting to match with black style

missed some files in formatting

fixing access to attribute

add single test to verify its working

fix some bugs and add defensive catching

bug fixes and code resiliency

Bug fixes and making quota limits detect properly where necessary

remove transitive delete and other bug fixes

fix formatting and trasnitive deletion issues

fix repositorysize does not exist error

fix not nul constraint and add security tests

fix security tests and bug

more security test fixes

reorder security tests

put docker file back and adjust security testing

security tests reduced

Missed changes for status 200

missed additional 201 responses getting 200

security bypass for now

Another tweak to security testing

forgot 1 endpoint

bug fix for parsing dictionary

remove unnecessary check at blob head

add initdb for quota

Incorrect syntax repair

mysql only supports decimal

adding quota specific notifications

optimization

add permission checks

adjust security and add configuration parameter

fix security test for new security levels

Fix logic errors and improve caching

fix logic issue and error reporting

adjust things according to PR comments

fix refactor left overs

miscapitilazation

missed refactor location

refactor code to remove quota limit groupings

fix refactor errors

remove transitive deletion

fix transitive deletes

Transitive deletion work

Transitive deletion work

refactor registry model and remove it

place api behind feature flag

patch feature enabledment for tests

patch feature enabledment for tests

testing to see if the config is the problem

remove patch

fix new org bug

fixing notifications

mismatched parameters

fix org not exists

fixed paramter mismatch

fix nonetype access

fix nonetype access

new tables created user deletion issues

new tables created user deletion issues

parameter mismatch

fix transitive delete

fix model access error

record does not exist missing catch

fix quota deletion to always delete limits

quotalimits deletion on quota deletion

mistake

fix quota limits deletion

patch tests and disable feature

typo

switch to toggle feature

add feature patch to top of file

change testconfigpy

* change permissions

* adjust permissions

* change config access

* fix formatting

* gether feature information differently

* duplicate function name

* fix config name

* type conversion

* config adjustments

* incorrect keyword

* Update security api tests

* duplicate naming

* fix config schema

* revert files and fix error

* QuotaManagement: UI (PROJQUAY-2936) (#1)

* [WIP]: Quota Reporting on Quay UI

* Integrating quota reporting UI with backend

* Humanizing bytes on UI

* Quota Reporting UI on repo table view

* Taking pull and updating code

* Adding quota management view

* Added support for CRUD operations for org quota

* create quota management

Fix json request json type

Creation of quota is working

All quota crud operations

crud for quota limits

repository size reporting

adding registry model

error levels

namespacequota

remove holdover from user file

finalizing refactor to namespace over organization

finalization of functionality

fixing formatting to match with black style

missed some files in formatting

fixing access to attribute

add single test to verify its working

fix some bugs and add defensive catching

bug fixes and code resiliency

Bug fixes and making quota limits detect properly where necessary

remove transitive delete and other bug fixes

fix formatting and trasnitive deletion issues

fix repositorysize does not exist error

fix not nul constraint and add security tests

fix security tests and bug

more security test fixes

reorder security tests

put docker file back and adjust security testing

security tests reduced

Missed changes for status 200

missed additional 201 responses getting 200

security bypass for now

Another tweak to security testing

forgot 1 endpoint

bug fix for parsing dictionary

remove unnecessary check at blob head

add initdb for quota

Incorrect syntax repair

mysql only supports decimal

adding quota specific notifications

optimization

add permission checks

adjust security and add configuration parameter

fix security test for new security levels

Fix logic errors and improve caching

fix logic issue and error reporting

adjust things according to PR comments

fix refactor left overs

miscapitilazation

missed refactor location

refactor code to remove quota limit groupings

fix refactor errors

remove transitive deletion

fix transitive deletes

Transitive deletion work

Transitive deletion work

refactor registry model and remove it

place api behind feature flag

patch feature enabledment for tests

patch feature enabledment for tests

testing to see if the config is the problem

remove patch

fix new org bug

fixing notifications

mismatched parameters

fix org not exists

fixed paramter mismatch

fix nonetype access

fix nonetype access

new tables created user deletion issues

new tables created user deletion issues

parameter mismatch

fix transitive delete

fix model access error

record does not exist missing catch

fix quota deletion to always delete limits

quotalimits deletion on quota deletion

mistake

fix quota limits deletion

patch tests and disable feature

typo

switch to toggle feature

add feature patch to top of file

change testconfigpy

* Removing quota and state conf from repo-list and user-view

* Removing quota and state conf form app list page

* Removing quota conf from repo-list.html

* minor fixes

* Added Quota Repoting and configuring quota from UI

* Making quota configuration component reusable + added support to read bytes via KB, MB, etc + Added reporting for total org consumption + Added org consumption for super user panel + Added quota configurable support on super user panel

* Adding older quota management component

* Removing not reusable quota management component

* Adding % consumption for repo quotas

* Adding % consumption for organization level quota

* Adding check to verify request.args

* Removing todo

* Adding default 0 to quota

* Formatting with black

* Fixing params for tests

* Formatting test file

Co-authored-by: Keith Westphal <kwestpha@redhat.com>

* remove migration

* add migration back

* repair formatting

* QuotaManagement: Moving the logic for bytes conversion to human friendly units to the frontend  (PROJQUAY-2936) (#3)

* Moving the logic for bytes conversion to human friendly units to the frontend

* Reading updates from quota_limit_id

* Formatting using black

* remote unused function

* Adding quota configuring on super user panel (#4)

* Converting quota bytes to human friendly format (#5)

* PR refactors

* invalid reference

* bad return value

* fix bad reference

* bad reference

* fix tests

* Quota Config: UI improvements (#6)

* Quota UI Improvements

* Rendering table for quota limit config

* Removing proxy cache files

* Disabling quota config for org view

* Removing redundant get

* Fixing PR requests

* repair formatting

Co-authored-by: Sunandadadi <Sunandadadi@users.noreply.github.com>
2022-03-08 12:02:03 -06:00
Syed Mushtaq Ahmed
2b2e795b9c secscan: Log start and end index of block in clair (PROJQUAY-3287) (#1165)
This is useful for debugging which block is being processed
2022-03-03 12:52:12 -05:00
Ivan Bazulic
a3ad25c48a chore: Remove unneeded flags fromt he config schema (#1152)
The flag `CREATE_REPOSITORY_ON_PUSH_PUBLIC` is not referenced anywhere in the code. This PR removes it along with its entry in the schema.
2022-02-28 11:05:10 -05:00
Brandon Caton
58b0657255 Revert "schema1: Permit signed schema1 manifests during conversion (PROJQUAY-PROJQUAY-3285) (#1146)" (#1150)
This reverts commit b5bd74bf05.
2022-02-25 16:31:23 -05:00
Brandon Caton
b5bd74bf05 schema1: Permit signed schema1 manifests during conversion (PROJQUAY-PROJQUAY-3285) (#1146)
Currently if an image with an OCI manifest is requested and the client does not support Docker Schema 2 or OCI manifests it will default to returning an unsigned Docker V2 Schema 1 manifest. Older clients who send a application/vnd.docker.distribution.manifest.v1+prettyjws media type header expect a signed Docker V2 Schema 1 manifest and break when an unsigned manifest is recieved. This change defaults to returning a signed manifest for OCI images if the application/vnd.docker.distribution.manifest.v1+prettyjws is present before falling back to an unsigned manifest.
2022-02-25 13:15:31 -05:00
Flavian Missi
42d1cdb4a1 util: update aws-ip-ranges.json (#1143) 2022-02-24 15:49:21 +01:00
Flavian Missi
9ee1c58059 util/ipresolver: manually add aws-ip-ranges.json (#1065)
the Github workflow responsible for keeping this file up-to-date is
currently failing to push to our master branch due to branch protection.
see
https://github.com/githubocto/flat/discussions/66#discussioncomment-1991251
for details.
2022-02-07 14:31:17 +01:00