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

396 Commits

Author SHA1 Message Date
OpenShift Cherrypick Robot
5142dd4398 [redhat-3.12] sqlite: Add retry with exponential backoff for sqlite (PROJQUAY-8758) (#4244)
Add retry with exponential backoff for sqlite (PROJQUAY-8758)

Sqlite runs into db lock contention, when run with a
single worker count is set to 1. This adds retry logic
to resolve lock contention

Signed-off-by: harishsurf <hgovinda@redhat.com>
Co-authored-by: harishsurf <hgovinda@redhat.com>
2025-09-08 10:21:20 -04:00
OpenShift Cherrypick Robot
e79efdc845 [redhat-3.12] db: enable WAL mode and other PRAGMA stmts for SQLite to avoid db locking during concurrent writes (PROJQUAY-8758) (#4231)
* ADD PRAGMA statements for SQLITE to avoid database locking

* Fix formating

---------

Co-authored-by: harishsurf <hgovinda@redhat.com>
2025-08-28 09:48:31 -04:00
Antonio Carlos Royo
56cc7fa16a [redhat-3.12] deps: update pbkdf2 to version 3.1.3 (PROJQUAY-9091) (#4114)
* update pbkdf2 to version 3.1.3

* updating registry proxy tests

---------

Co-authored-by: Antonio Carlos Royo <aroyo@aroyo-thinkpadp1gen7.rmtco.csb>
2025-07-07 15:05:53 -03:00
OpenShift Cherrypick Robot
1463ec2e35 [redhat-3.12] ci: fixing app type import (PROJQUAY-8991) (#4036)
ci: fixing app type import

Co-authored-by: bcaton <bcaton@redhat.com>
2025-06-11 09:09:16 -04:00
OpenShift Cherrypick Robot
3aac42c820 [redhat-3.12] proxycache(permissions): CVE-2025-4374 (PROJQUAY-8892) (#3961)
fixing CVE-2025-4374 by extending the create_repository method to understand if we are requesting a proxy_cache repository added unittests for create_repository when proxy_cache.

Co-authored-by: Michaela Lang <milang@redhat.com>
2025-05-27 15:06:29 -04:00
Marcus Kok
a2d287a663 chore: Revert "[redhat-3.12] cve: upgrade elasticsearch and elasticsearch-dsl to 8.13.0 (PROJQUAY-6962)" (PROJQUAY-6962) (#3450)
Revert "[redhat-3.12] cve: upgrade elasticsearch and elasticsearch-dsl to 8.1…"

This reverts commit f0dd86f2f1.
2024-12-04 17:20:54 +00:00
OpenShift Cherrypick Robot
f0dd86f2f1 [redhat-3.12] cve: upgrade elasticsearch and elasticsearch-dsl to 8.13.0 (PROJQUAY-6962) (#3436)
* * upgrade elasticsearch and elasticsearch-dsl to 8.13.0 * update tests and elasticsearch logs to handle new major version

* pinning elasticsearch-transport according to check requirements.txt test

---------

Co-authored-by: Marcus Kok <mkok@redhat.com>
2024-12-03 09:07:50 -05:00
OpenShift Cherrypick Robot
4c7b5f13d1 [redhat-3.12] api: allowing superuser to read catalog endpoint (PROJQUAY-8023) (#3333)
Allows for the full access and global readonly superuser to read all repositories from the /v2/_catalog endpoint.

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2024-10-16 14:22:57 +00:00
OpenShift Cherrypick Robot
edba8f7a5a [redhat-3.12] gc: fix fk constraint violation tag delete (PROJQUAY-8006) (#3328)
gc: fix fk constraint violation tag delete (PROJQUAY-8006)

---------

Co-authored-by: Sunandadadi <sunanda.3094@gmail.com>
2024-10-15 13:16:00 -04:00
OpenShift Cherrypick Robot
5b22b19a9b [redhat-3.12] events: fix notification methods for image expiry events (PROJQUAY-7487) (#3055) 2024-07-19 19:46:11 +00:00
OpenShift Cherrypick Robot
7785b4defb [redhat-3.12] registry: index manifest artifact type for filtering (PROJQUAY-7471) (#3040)
registry: index manifest artifact type for filtering (PROJQUAY-7471)

Previous assumption made use of the config media type only, which is not the case
if a manifest's artifact type is explicitly set. i.e the config's media type and
artifact type are different, and the artifact type take precedence for filtering.

Co-authored-by: Kenny Lee Sin Cheong <kenny.lee28@gmail.com>
2024-07-17 14:41:55 +00:00
Brandon Caton
a6918da548 oauth: logging assign oauth action to audit logs (PROJQUAY-7431) (#3033) (#3034)
logging assign oauth action to audit logs
2024-07-16 15:58:45 -04:00
Sunandadadi
261f62a598 autoprune: autoprune model changes for image expiry events (PROJQUAY-7076) (#2985)
* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* Rebasing with main

* updating cypress data

* Rebasing with latest

* Forcing an empty commit.

* minor fixes

* Autoprune model changes

* fixing failing tests

* format fix

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-27 17:34:33 -04:00
Sunandadadi
6688bcca09 backend: implement basic functionality (PROJQUAY-7076) (#2984)
* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* Rebasing with main

* updating cypress data

* fixing conflicts and rebasing with latest code

* adding tests

* Forcing an empty commit.

* Forcing an empty commit.

* skip_locked test fix

* adding tests

* minor fixes

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-27 16:48:39 -04:00
Brandon Caton
70b03cadc3 db: add postgresql_concurrently to subject backfill (PROJQUAY-7393) (#2979)
Adding postgresql_concurrently to subject backfill
2024-06-27 09:10:46 -04:00
Brandon Caton
7ef664a646 autoprune: Registry level autopruning (PROJQUAY-7392) (#2950)
Allows for adding a default autopruning policy that will be applied to all namespaces.
2024-06-26 16:43:31 -04:00
Sunandadadi
6c371c5406 db: updates for image expiry notification (PROJQUAY-7075) (#2894)
* resolving conflicts

* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* adding index to last_ran_ms and updating alembic head

* minor fixes

* updating cypress data

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-25 15:59:40 -04:00
Brandon Caton
e4f05583c1 oauth: allowing to assign token to user (PROJQUAY-7074) (#2869)
Allow organization administrators to assign Oauth token to another user.
2024-06-25 09:23:51 -04:00
Brandon Caton
bc06a3ef36 database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)
adding subject_backfilled index to manifest table
2024-06-24 14:04:27 -04:00
Daniel Messer
a5ab170773 cache: handle cache value size limit in memcached (PROJQUAY-7239) (#2914)
* handle cache value size limit in memcached
* only print cache value for redis in debug logs on redis errors

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-24 10:26:53 +02:00
Syed Ahmed
c7352f4413 storage: add debug log for time taken to upload blob (PROJQUAY-7328) (#2962)
Adds logging on uploads to object storage
during the initial upload and the final copy
2024-06-21 15:47:35 -04:00
Daniel Messer
99d571a4a6 logs: allow without strict logging (PROJQUAY-7116) (#2846)
* allow to disable strict logging in general

Signed-off-by: dmesser <dmesser@redhat.com>

* add strict logging exceptions for log kinds during reads

Signed-off-by: dmesser <dmesser@redhat.com>

* add strict logging exceptions for log kinds during reads

Signed-off-by: dmesser <dmesser@redhat.com>

* formatting

Signed-off-by: dmesser <dmesser@redhat.com>

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-17 21:17:39 +02:00
Daniel Messer
e73d096b28 api: OCI compliant tag listing and pagination (PROJQUAY-6931) (#2884)
implement OCI compliant pagination and tag listing

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-13 11:28:02 +02:00
Harish Govindarajulu
074f35ee99 chore: Update alembic migration script to support sqlite db (PROJQUAY-7097) (#2839)
* Add sqlite db support on quay start up

* Add batchmode to migration scripts to support sqlite db

* Add sqlite db to config-tool validator +  alembic migration

* Fix migration script to prevent db row locking

Added commit statement to ensure previous transaction is
completed before the next one within the same table

* Clean up unused sqlite volume

* Apply black formatting to migration scripts

* Address review comments

* Ensure py39-unit test runs the alembic migration on Sqlite

* Add static type checking for alembic config file name

* alembic remove commit and invalidate during migration

When disconnecting from db, alembic tries to rollback
causing PendingRollbackError

* Bump go version in config-tool Dockerfile

* Explicitly commit transaction to prevent db table locking

* Clean up + remove debug statements

* Undo database secret key change

* Add TEST_DATABASE_URI to py39-unit to run unit test with sqlite db

* Drop index before dropping column to prevent sqlite error

* Add test coverage + address last set of reviews

---------

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-06-12 13:57:32 -04:00
Ivan Bazulic
6392ca972a secscan: Fix Slack notification creation on initial index (PROJQUAY-7037) (#2923)
* secscan: Fix Slack notification creation on initial index (PROJQUAY-7037)
This fixes the Slack and e-mail notifications when images are indexed on initial push, where `tags` information was missing. If an image is a manifest child, instead of the tag, we provide a full SHA digest to the client.
Also adds the ability to filter security vulnerabilites depending on their severity. If the `NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX` is not set in the `config.yaml` file, we will automatically create notifications only for vulnerabilities marked "high" or "critical". This variable can take values defined here:

3248a72da6/util/secscan/__init__.py (L1)

Example:

```
NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX: Medium
```

* Removed superfulous debug statements

* Add default to config.yaml, remove extra comment

* Fix isort sorting

* Update vulnerability_found.html

* Update vulnerability_found.html

* Isort formatting fix

* Update vulnerability_found.html
2024-06-12 09:51:11 -04:00
Kenny Lee Sin Cheong
4546163e83 registry: implements the OCI 1.1 referrers API (PROJQUAY-7280) (#2597)
* registry: implements the OCI 1.1 referrers API

Migrations:
- Adds a subject column for lookup
- Adds a subject_backfilled column to track status of the backfilling
of existing manifests
- Adds a manifest_json column making use of postgres' JSONB support,
for future use.

Manifestsubjectbackfillworker: Indexes existing manifests for possible
existing subject field.

* Deprecate IGNORE_UNKNOWN_MEDIATYPES

* Cleanup
2024-06-07 13:28:13 -04:00
Brandon Caton
65e727086a ldap: allow global readonly superuser to be filtered (PROJQUAY-7044) (#2917)
Allow global readonly superuser to be specified via LDAP.
2024-06-04 15:19:37 -04:00
Daniel Messer
3248a72da6 logs: adding support for Splunk HTTP Event collectors as producers (PROJQUAY-7124) (#2855)
adding support for Splunk HTTP Event collectors as producers

Signed-off-by: dmesser <dmesser@redhat.com>
2024-05-31 11:58:15 +02:00
Marcus Kok
dbfb47d6fb marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129) (#2868)
* marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129)

* Use list comprehension in model and expect to return None if no rows are
returned

* fix behavior for reconciler and fix unit test for reconciler
2024-05-09 11:51:06 -04:00
Sunandadadi
6bf6c2b181 teamsync: run team sync worker for teams synced via ldap or keystone (PROJQUAY-6762) (#2788)
* teamsync: run team sync worker for teams synced via ldap or keystone (PROJQUAY-6762)

* fix comment

* adding test

* isort fix
2024-04-29 13:18:04 -04:00
Sunandadadi
81682c96d0 oidc: ask for group object id for azure oauth login (PROJQUAY-6917) (#2805)
* oidc: ask for group object id for azure oauth login (PROJQUAY-6917)

* fixing tests

* adding tests
2024-04-24 10:18:31 -04:00
Brandon Caton
f241767005 api: reducing db calls in repo list endpoints with quota enabled (PROJQUAY-6895) (#2770)
Reducing the number of DB calls in the repo list endpoint with quota enabled by:
- Adding the id to RepositoryBaseElement when the repositories are initially fetched, removing the need to fetch the repository ID's again
- Fetching the repository sizes with a single DB call using the IN operator
2024-03-26 10:33:24 -04:00
Marcus Kok
131d66d13f marketplace: add a check for masterEndSystemName when fetching subscriptions (PROJQUAY-6905) (#2775)
* add a check for masterEndSystemName when fetching subscriptions
* allow old SKUs to be used in org attachments
2024-03-25 13:47:22 -04:00
Syed Ahmed
5878631934 db: add config variable for DB pooling (PROJQUAY-6397) (#2783)
* db: add config variable for DB pooling (PROJQUAY-6397)

adding `DB_CONNECTION_POOLING` param to enable/disable
connection pooling for primary and replica DBs
2024-03-21 21:26:37 +00:00
Ross Bryan
66fbe49ee2 secscan: implement basescore/cveid (PROJQUAY-6697) (#2684)
* secscan: implement basescore/cveid (PROJQUAY-6697)

Signed-off-by: Ross Bryan <robryan@redhat.com>

* docs: add docstrings to helper functions

Signed-off-by: Ross Bryan <robryan@redhat.com>

* secscan: refactor base_score builder loop

Signed-off-by: Ross Bryan <robryan@redhat.com>

* make cveIDs a unique, alpha sorted list

Signed-off-by: Ross Bryan <robryan@redhat.com>

---------

Signed-off-by: Ross Bryan <robryan@redhat.com>
2024-03-20 13:20:17 +01:00
Syed Ahmed
943d95b98a chore: fix type check in read replica (PROJQUAY-6397) (#2777)
* fix type check in read replica (PROJQUAY-6397)
2024-03-19 17:57:01 +00:00
Syed Ahmed
97b3e025de db: use read replica for selected queries (PROJQUAY-6397) (#2758)
* db: use read replica for selected queries (PROJQUAY-6397)

We add a new param `can_use_read_replica` to the `select`
query. This allows us to choose which queries we want to
send to the read replica. This is useful in cases where
the read replica lags behind the primary and some queries
need the latest data
2024-03-18 14:23:16 -04:00
Marcus Kok
6f2905b10e logs: add action log for team sync enable/disable (PROJQUAY-6763) (#2750)
* add action log for team sync enable/disable
* adds alembic migration for team sync logs added to log kind table
2024-03-18 14:22:23 -04:00
Sunandadadi
298373a3db oidc: allows users to login via cli (PROJQUAY-6873) (#2748)
* oidc: allows users to login via cli (PROJQUAY-6873)

* fixing tests

* update reading username + adding tests
2024-03-18 14:06:16 -04:00
Harish Govindarajulu
3e55c5940b autoprune: add alembic script to remove unique constraint on index (PROJQUAY-6782) (#2725)
Make "repositoryautoprunepolicy_namespace_id" index not unique to avoid
duplicate key violation error

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-03-07 23:53:57 +05:30
Brandon Caton
d2a1fedab4 quota: refactor, tests, and optimizations (PROJQUAY-6735) (#2712)
Adds the following changes:
- Additional logging
- Moving checks before expensive DB calls
- Additional tests
2024-03-06 09:06:38 -05:00
Sunandadadi
3983b73097 oidc: use federated login service to sync quay teams (PROJQUAY-6741) (#2724)
* oidc: use federated login service to sync quay teams (PROJQUAY-6741)

* adding more logs to oidc team sync

* Adding tests
2024-03-05 16:47:06 -05:00
Kenny Lee Sin Cheong
be4edd02a3 cache: add caching for manifest requests (PROJQUAY-6482) (#2522) 2024-03-04 16:56:56 -05:00
Sunandadadi
3446d5630b oidc: display error msg when signing in via username password (PROJQUAY-6740) (#2714)
* oidc: display error msg when signing in via username password (PROJQUAY-6740)

* added test + typo fix
2024-03-01 13:14:27 -05:00
Sunandadadi
74fd23d7d3 backend: Syncing teams with OIDC group (PROJQUAY-6290) (#2693) 2024-02-27 16:53:51 -05:00
Harish Govindarajulu
98811f5397 feat: Add auto-prune policy at repository level (PROJQUAY-6354) (#2691)
* feat: Add support for auto pruning at repository level (PROJQUAY-6354)

* Add repositoryautoprunepolicy table to alembic migration script

* Add repository auto-prune policy endpoints

* Add UI for repository auto-pruning policies

* case: apply repo auto-prune policy when no namespace policy given

* case: both namespace and repo pruning policy are given

* Add tests for repository autoprune endpoint

* Add cypress test for repository auto-prune

* Add repo auto-prune policy clean-up for repository deletion

* Add repository auto pruning tables to quay db snapshot for cypress tests

* Address review comments

* Add more tests + fix CI + reformat files

* Address review comments #2

---------

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-02-27 15:02:57 +05:30
Brandon Caton
29258ae0c7 quota: removing repo size from quota verification (PROJQUAY-6637) (#2704)
removing repo size from upload image size during quota verification
2024-02-26 14:42:36 -05:00
Sunandadadi
4cb0a57488 ui: ui and initial scaffolding for OIDC auth (PROJQUAY-6298) (#2646)
* added base class for OIDC auth + UI

* adding read-only teams page + display sync config + option to remove team sync

* setting page in read only mode fix

* ui tests

* adding validation for group name input

* fixes based on review + fixing test suite

* add backend tests for externalOIDC

* minor fixes
2024-02-20 11:58:10 -05:00
Marcus Kok
2ab7dc29f4 marketplace: add support for quantity from subscriptions api (PROJQUAY-6551) (#2633)
* Adds handling for when a subscription returned from the subscription watch api has a quantity greater than 1. Number of private repos should be correctly calculated using the quantity.

* Updates ui so that subscriptions can only be added to an org as a group, i.e. a subscription with quantity = 2 cannot be split across organizations.
2024-01-29 15:21:30 -05:00
Oleg Bulatov
6d5e6293e3 chore: use oci_model directly without proxy object (#2618) 2024-01-26 15:27:27 +01:00