156 Commits

Author SHA1 Message Date
Ramkumar Chinchani 4e4d00a0a6 feat: add trivy-based sbom artifact generation support (#4088)
fixes issue #4067

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-05-23 23:24:12 -07:00
Andrei Aaron fa2960b705 fix(auth): refine OIDC identity handling and claim-mapping logs (#4028)
Rename getOpenIDUsername to getOpenIDIdentity and thread "identity"
through bearer OIDC, Basic-auth parsing, OAuth2Callback, and log fields.

Only fall back (and warn) to the default email claim when the configured
username claim is non-default but missing or empty.

Stop emitting Info logs when groups are absent on only UserInfo or only ID
token claims; log once at Debug when no groups remain after merging both.

Update ClaimMapping docs to mention username and groups claims; fix mTLS
extractIdentity comment typo; clarify GetAuthUserFromRequestSession doc.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-05-01 09:34:48 -07:00
Ramkumar Chinchani 0b2eaa0f9a feat(cosign): add support for cosign bundle (#4023)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-05-01 10:21:06 +03:00
Ramkumar Chinchani 934b22d124 fix(security): enhance timeout configurations and body size limits fo… (#3984)
* fix(security): enhance timeout configurations and body size limits for HTTP requests

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(tests): refactor backend result handling in proxyHTTPRequest test

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): preserve ContentLength in proxied requests to prevent server hang

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): preserve explicit zero-length request bodies in proxyHTTPRequest
fix(tests): add test for normalizedTimeout function to ensure default fallback

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): prevent default HTTP timeout values from being set unless explicitly configured

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): refactor timeout handling to use explicit checks for nil and non-positive values

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(tests): add wait_for_event_count function to ensure expected event generation

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): improve timeout handling and update error responses for large requests

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): enhance HTTP timeout handling with explicit accessors and default values

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): increase default API key body size and timeout values for improved performance

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): unify timeout handling by replacing specific read/write timeouts with a single default timeout

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): consolidate HTTP timeout accessors and enhance timeout handling

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix(security): simplify HTTP timeout accessors and set default values for read/write timeouts

Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 22:23:48 +03:00
Bachir Khiati ba8575d960 feat(api): add repository quota enforcement middleware (#3923)
Adds a configurable maximum repository count per registry instance.
When maxRepos is set on StorageConfig, manifest pushes that would create
a new repository beyond the limit are rejected with HTTP 429
TOOMANYREQUESTS. Pushes to existing repositories are always allowed.

Implemented as an always-available feature in pkg/api (not a build-tag
extension). MaxRepos is a field on StorageConfig, enabled when > 0.

- repoQuotaMiddleware on the dist-spec router intercepts manifest PUTs.
  New-repo pushes are serialized with a sync.Mutex to prevent concurrent
  requests from exceeding the limit.
- Adds CountRepos(ctx) to the MetaDB interface with efficient
  implementations: BoltDB (Stats().KeyN), Redis (HLen), DynamoDB
  (Scan with Select=COUNT).
- Config.IsQuotaEnabled() added, wired into controller.go metaDB init.
- Four integration tests (enforcement, concurrency, disabled,
  unconfigured) and backend-specific CountRepos tests for BoltDB, Redis,
  and DynamoDB.

Signed-off-by: Bachir Khiati <bachir.khiati@gmail.com>
2026-04-13 23:18:34 +03:00
Andrei Aaron 451e7b8e47 feat: Add TrivyConfig.VulnSeveritySources (Trivy's --vuln-severity-source) (#3943)
And default it to ["auto"] when unset, with an info log from applyDefaultValues.

Refactor CVE NewScanner to take *CVEConfig instead of separate DB repository
strings so the full Trivy block is available to the scanner.

Extend CLI and search tests for the new field and logged config; document
CVE/Trivy in examples/README and add examples/config-cve-trivy.json.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-04-08 09:39:26 +03:00
Andrei Aaron 2ca0392825 test(blackbox): harden zot restart + reachability checks (#3907)
Wait for zot PIDs (and the port) to fully shut down before restarting, and retry transient curl failures (e.g. exit 52) in wait_zot_reachable.
Send checksum verification errors to stderr for clearer failure output.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-03-30 22:41:01 +03:00
Andrei Aaron 0d327c9812 chore: bump zui version (#3809)
* chore: bump zui version

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

* test(blackbox): docker build to use docker mediatypes in blackbox tests

Add more debugging when starting zot servers
See thread https://github.com/actions/runner-images/issues/13474#issuecomment-3928452506
for changes in behavior caused by docker 28 to docker 29 upgrade.

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

---------

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-02-22 18:30:46 -08:00
Ramkumar Chinchani 47659c11b2 feat(tls): implement dynamic TLS certificate reloading with file watching (#3792)
Fixes issue #3747

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-02-15 13:01:50 -08:00
Andrei Aaron 063014a942 ci: improvements for the Ecosystem tools job (#3762)
ci: blackbox test impromentts

A mutated zli config could be the cause of https://github.com/project-zot/zot/actions/runs/21560982825/job/62141227950

1. show zli configuration after cve.basts finishes running
2. ensure the zli config is removed in between test files
3. ensure teh zli configs use different names, not "main"

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-02-01 23:58:18 +02:00
Andrei Aaron e82aac8409 fix(fips): flaky fips blackbox test and add missing curves (#3732)
2 unrelated issues:
See https://github.com/project-zot/zot/actions/runs/21336958408/job/61410298444?pr=3731 for details.
Also add missing fips curves https://cs.opensource.google/go/go/+/refs/tags/go1.25.6:src/crypto/tls/defaults_fips140.go;l=33

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2026-01-26 13:45:03 +02:00
Ramkumar Chinchani ba3436c57e ci: add a upgrade bats test (#3621)
* ci: add a upgrade bats test

Fixes https://github.com/project-zot/zot/issues/3601

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: first check existing images

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: refactor into common test code

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* refactor: Refactor upgrade tests to improve readability and maintainability

- Added section headers for release tests, upgrade process, and new tests in upgrade.bats and upgrade_minimal.bats.
- Replaced inline port retrieval with a function call to get_zot_port for consistency.
- Consolidated repeated test logic into dedicated functions (e.g., test_new_existing_pull_image, test_new_push_image).
- Removed unnecessary variable assignments and streamlined test cases for clarity.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2026-01-24 13:42:45 -08:00
Andrei Aaron ed40bfd689 fix: more logging for sync extension (#3656)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-12-16 00:03:24 +02:00
Ramkumar Chinchani 64829f9502 feat: allow claim mapping for user name with oidc (#3540)
* feat: allow claim mapping for user name with oidc

* feat: bats test for claim mapping

* test: fix dex config in openid mapping test

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* test: add panva idp

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: address copilot comments

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
Co-authored-by: Sky Moore <i@msky.me>
2025-11-20 08:54:56 -08:00
Andrei Aaron a8a6d3be9e fix: separate cipher suites and curve preferences into FIPS and non FIPS, and use them accordingly (#3523)
See: https://github.com/project-zot/zot/actions/runs/19209741002/job/54910194536

`failed to ping registry localhost:11448: Get "https://localhost:11448/v2/": crypto/ecdh: use of X25519 is not allowed in FIPS 140-only mode`

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-11-10 23:24:59 +02:00
Ramkumar Chinchani 04ae0a9409 fix: add support for sha256 and sha512 in htpasswd (#3497)
feat: add support for sha256 and sha512 htpasswd formats

Fixes issue #3495

We currently support only bcrypt htpasswd hashes, however bcrypt is not
FIPS-140 approved since it uses Blowfish.

This PR adds support for sha256 and sha512 formats and enforces that
bcrypt be disabled when fips140 mode is enabled.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-11-09 15:28:29 +02:00
Andrei Aaron 1fb2b67419 fix: minor fixes based on intermittent test failures (#3465)
1. preload busybox image to fix: https://github.com/project-zot/zot/actions/runs/18614431126/job/53077015870?pr=3465
2. stabilize test coverage in by using different error type: https://app.codecov.io/gh/project-zot/zot/pull/3444/indirect-changes
3. attempt to fx an intermitent sync test failure:
Failures:

  * /home/andaaron/zot/pkg/extensions/sync/sync_test.go
  Line 4857:
  Expected: digest.Digest("sha256:dc1377539a9db8bf077100bfa3118052feb6b5c67509ca09bdd841e4ac14c4cc")
  Actual:   digest.Digest("sha256:3a3fb31a422846a680f0a07b8b666bdcb1122d912d1adca79523c7bf2715996e")
  (Should equal)!

4. fix a race condition in sync by, I don't have a link, but this is the failure:

  * zotregistry.dev/zot/pkg/extensions/sync/sync_test.go
  Line 5963:
  Expected: 1
  Actual:   2
  (Should equal)!

1426 total assertions

--- FAIL: TestOnDemandPullsOnce (0.42s)
    sync_test.go:5921: Goroutine 0: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
    sync_test.go:5921: Goroutine 1: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
    sync_test.go:5921: Goroutine 4: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
    sync_test.go:5921: Goroutine 3: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
    sync_test.go:5921: Goroutine 2: Sending request to http://127.0.0.1:36421/v2/zot-test/manifests/0.0.1
FAIL
coverage: 21.4% of statements in ./...
FAIL	zotregistry.dev/zot/pkg/extensions/sync	255.189s

5. Fix flaky coverage in https://app.codecov.io/gh/project-zot/zot/pull/3465/indirect-changes

6. Stability fix for https://github.com/project-zot/zot/actions/runs/18632536285/job/53119244557?pr=3465

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-10-19 17:59:32 -07:00
Ramkumar Chinchani 73eef25681 ci: enable fips140 blackbox test (#3460)
Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-10-13 22:49:06 -07:00
Andrei Aaron bd20426a1a ci: debugging blackbox failures (#3453)
Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-10-13 10:38:58 -07:00
Andrei Aaron b0f917a444 ci: pre download docker images used in bats tests (#3452)
Should help with issues such as https://github.com/project-zot/zot/actions/runs/18457240003/job/52580780359

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-10-13 10:41:30 +03:00
Ramkumar Chinchani 411a3d00b5 fix: update go-redsync for fips-140 compatibility (#3451)
* fix: update go-redsync for fips-140 compatibility

Fixes issue #3445

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: address comments and add a basic push-pull test

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: address comments

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-10-13 09:34:12 +03:00
Andrei Aaron 3dcd7d1683 ci: fix nightly (#3431)
ci: fix nightly and show logs for nightly sync tests

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-10-05 12:58:04 -07:00
Vishwas Rajashekar 86af38abfc feat(sessions): add support for remote redis session store (#3345)
Description
====================
zot currently stores session cookies in memory or in a local directory.
For cases where the session cookies should be independent of the
instance where they were created such as multiple instances of zot, or a
fully stateless zot instance, there is a need to support a remote
session storage.
This change adds support for using Redis and Redis-compatible services as a
remote session driver as well as introduces a new configuration option
for it.

What has changed
=======================
- New config added under Auth config to specify configuration for
  the session driver.
- Examples README updated with details of the new Auth config.
- The config supports only 2 drivers in this change - local and redis
- Using the local driver is backwards compatible and behaves the same
  way that zot currently works for local session storage.
- Omitting this config does not result in an error. In this case, zot
  behaves as it normally does for local session storage.
- When configured, zot can use redis for persisting cookie
  information for zot UI.
- The cookie in the store is deleted on logout or after the max
  expiry time for the cookie.
- Configuration for the redis session driver accepts the same configuration
  values as that of the remote meta cache.
- A separate connection is established for the session driver. An
  existing connection for meta cache will not be re-used for the
  session driver.
- A key prefix is configurable for the redis session driver. The value will be
  converted into a string for use. If no value is provided, a default
  prefix of "zotsession" will be used.
- Redis sessions does not support hash key or encryption in this change.
- New BATS test added to verify zot behavior with Redis session store.
- Github workflow updated to install valkey-tools dependency for BATS.

Signed-off-by: Vishwas Rajashekar <dev@vrajashkr.com>
2025-10-05 10:13:38 +03:00
Vishwas Rajashekar 636a6b1820 fix(ci): use fixed ranges for BATS server ports (#3428)
Changes in this PR
==================
- Replaces the get_free_port bash function in BATS tests
with get_free_port_for_service that returns a random free port
in a given range for a test file and service defined in a
ports.json file.
- Updates all get_free_port calls to use the new function.
- A new README file for details on the ports.json file.
- Updates some tests using fixed ports to use dynamic ports.
- Adds a ports.json file with all the allocations.
- Adds a new common helper for port fetching.

Signed-off-by: Vishwas Rajashekar <30438425+vrajashkr@users.noreply.github.com>
2025-10-04 19:16:03 +03:00
Ramkumar Chinchani d5779cfec8 ci: move workflow to oci runner (#3426)
* ci: move workflow to oci runner

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* fix: some changes on top

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2025-10-03 11:51:12 -07:00
Uwe Jäger 06c1be119c Read OpenID credentials from file (#3244)
* feat: read OpenID credentials from file

Signed-off-by: Uwe Jäger <uwe.jaeger@valiton.com>

* feat: allow credentials file and secret in config to keep BC

Signed-off-by: Uwe Jäger <uwe.jaeger@valiton.com>

---------

Signed-off-by: Uwe Jäger <uwe.jaeger@valiton.com>
2025-07-09 09:16:49 -07:00
Andrei Aaron 8867814d95 chore: bump github.com/olekukonko/tablewriter from 0.0.5 to 1.0.7 (#3198)
* chore: bump github.com/olekukonko/tablewriter from 0.0.5 to 1.0.7

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* fix: zli failed to connect to https server using test certificates

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

---------

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-06-16 00:07:15 +03:00
mottetm 483c869920 Fix metrics authorization middleware bleed (#3183)
fix: metrics authorization middleware bleed (#3182)

Fixes `extension_metrics_disabled.go` to correctly isolate the authz
middleware when the metrics extension is disabled.

Signed-off-by: Matthieu Mottet <m.mottet@outlook.com>
2025-06-05 15:41:32 -07:00
Evan 0c51cb72c3 fix: parse public key as fallback for certificate for bearer authentication (#3180)
* fix: parse public key as fallback for bearer auth

Signed-off-by: evanebb <git@evanus.nl>

* fix: use correct error message

Signed-off-by: evanebb <git@evanus.nl>

---------

Signed-off-by: evanebb <git@evanus.nl>
2025-06-04 08:53:44 +03:00
Piaras Hoban bc5fd1a357 feat(events): add events extension (#3045)
* feat: add events config

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* feat: implement event support with log sink

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* feat: integrate events and update tests

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* refactor: update event config

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* feat: implement http and nats sinks. remove log sink

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* refactor: events extension setup

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: cleanup tests to use nil event recorder

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: update events config example and add more logging

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* refactor: better use of build tags for minimal binary

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* fix: missing store param in evelated privileges tests

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* fix: regression in config decoding

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: update check logs script to enable cross-platform usage via GREP_BIN_PATH envvar

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: fix log lint issue for events

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: fix failing events disabled test

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: add blackbox tests for events

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: specify architecture when downloading binaries in Makefile

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: improve failure handling when no valid sinks are provided

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: fix data race in events test

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: cleanup event decoding

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: fix logging tests

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: make nats server test more reliable

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: go mod cleanup

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: add sleep when setting up nats client

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* fix: ensure event sink errors do not propogate

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: increase coverage for events

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* feat(events): Refactor events to be non-blocking from caller.

Signed-off-by: Asgeir Nilsen <asgeir.nilsen@bouvet.no>
Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: remove harded-coded linux

Co-authored-by: Andrei Aaron <andreifdaaron@gmail.com>
Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* feat(events): fail to start if incorrect event sink is configured

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* test: allow cli tests to return errors instead of panic

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

* chore: bump nats server to v2.11.3

Signed-off-by: Piaras Hoban <phoban01@gmail.com>

---------

Signed-off-by: Piaras Hoban <phoban01@gmail.com>
Signed-off-by: Asgeir Nilsen <asgeir.nilsen@bouvet.no>
Co-authored-by: Asgeir Nilsen <asgeir.nilsen@bouvet.no>
Co-authored-by: Andrei Aaron <andreifdaaron@gmail.com>
2025-05-02 12:30:06 -07:00
peusebiu 0e2aa81439 feat(sync): use regclient for sync extension (#2903)
* feat(sync): use regclient for sync extension

replaced containers/image package with regclient/regclient package

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): fixed converting innner docker list mediatype

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* feat(sync): added option to preserve digest

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): added coverage and various fixes

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(metadb): fixed converting manifest list not setting platform and annotations

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): remove read lock on storage, not used concurrently

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* feat(sync): added cache for repo tags

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): fixed Makefile
removed opengpg tag

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

* fix(sync): add test for on demand referrer

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>

---------

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
2025-04-15 16:58:15 -07:00
Andrei Aaron f9b647beaf ci: fix failures in nightly (#3042)
- fix log folder names used by nightly jobs
- fix attempt to install containerd.io in the redis pipeline (which conflicts with containerd)

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-03-18 10:39:51 -07:00
Andrei Aaron 88ad384506 test: do not use the clustering feature in case of redis + s3 storage
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-03-17 09:12:10 +02:00
Andrei Aaron 8438c83a23 test: add scale-out clustering tests using multiple zot servers with with redis and S3 integration
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-03-17 09:12:10 +02:00
Andrei Aaron 2a4edde637 chore: update image and dist specs to v1.1.1 (#3023)
chore: update image-spec and dist-spec to v1.1.1

As side effect the warnings mentioned in https://github.com/project-zot/zui/issues/475#issuecomment-2715802363 should no longer show up.

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-03-13 10:06:02 +02:00
Evan d465690630 [feat]: add support for EC/ED25519 public keys for token authentication (#2998)
* feat: rework token auth to allow ED25519/EC public keys

Signed-off-by: evanebb <git@evanus.nl>

* fix: shadow err variable to hopefully avoid data race

Signed-off-by: evanebb <git@evanus.nl>

* fix: apply golangci-lint feedback

Signed-off-by: evanebb <git@evanus.nl>

* fix: simplify public key loading by only supporting certificates, fixes ED25519 certificate handling

Signed-off-by: evanebb <git@evanus.nl>

* test: add golang-jwt based test auth server and test RSA/EC/ED25519 keys

Signed-off-by: evanebb <git@evanus.nl>

* fix: restrict allowed signing algorithms as recommended by library

Signed-off-by: evanebb <git@evanus.nl>

* test: add more bearer authorizer tests

Signed-off-by: evanebb <git@evanus.nl>

* fix: apply more golangci-lint feedback

Signed-off-by: evanebb <git@evanus.nl>

* test: ensure chmod calls run on test failure for authn errors test

Signed-off-by: evanebb <git@evanus.nl>

* fix: verify issued-at in given token if present
Pulls the validation in-line with the old library

Signed-off-by: evanebb <git@evanus.nl>

---------

Signed-off-by: evanebb <git@evanus.nl>
2025-03-06 14:32:13 -08:00
Andrei Aaron 88efa50de9 fix: Update AWS DynamoDB permission list and correct issues in DynamoDB examples (#2963)
fix: Update AWS DynamoDB permission list, and correct issues in DynamoDB examples

Note DeleteTable is only used for the zot tests, should not be needed in production

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-02-13 19:11:06 +02:00
Andrei Aaron 05823cd74f redis driver for blob cache information and metadb (#2865)
* feat: add redis cache support

https://github.com/project-zot/zot/pull/2005
Fixes https://github.com/project-zot/zot/issues/2004

* feat: add redis cache support

Currently, we have dynamoDB as the remote shared cache but ideal only
for the cloud use case.
For on-prem use case, add support for redis.

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* feat(redis): added blackbox tests for redis

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>

* feat(redis): dummy implementation of MetaDB interface for redis cache

Signed-off-by: Alexei Dodon <adodon@cisco.com>

* feat: check validity of driver configuration on metadb instantiation

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat: multiple fixes for redis cache driver implementation

- add missing method GetAllBlobs
- add redis cache tests, with and without mocking

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): redis implementation for MetaDB

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): use redsync to block concurrent write access to the redis DB

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): update .github/workflows/cluster.yaml to also test redis

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(metadb): add keyPrefix parameter for redis and remove unneeded method meta.Crate()

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): support RedisCluster configuration and add unit tests

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): more tests for redis metadb implementation

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): add more examples and update examples/README.md

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): move option parsing and redis client initialization under pkg/api/config/redis

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* chore(cachedb): move Cache interface to pkg/storage/types

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): reorganize code in pkg/storage/cache.go

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): call redis.SetLogger() with the zot logger as parameter

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* feat(redis): rename pkg/meta/redisdb to pkg/meta/redis

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
Signed-off-by: Alexei Dodon <adodon@cisco.com>
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
Co-authored-by: a <a@tuxpa.in>
Co-authored-by: Ramkumar Chinchani <rchincha@cisco.com>
Co-authored-by: Petu Eusebiu <peusebiu@cisco.com>
Co-authored-by: Alexei Dodon <adodon@cisco.com>
2025-01-30 11:00:52 -08:00
Andrei Aaron b8437991cb ci: reenable test calling stacker (#2890)
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-01-17 13:09:45 -08:00
Andrei Aaron cdcafa925f fix(headers): set Cross-Origin-Resource-Policy header for UI requests (#2883)
* fix(headers): set Cross-Origin-Resource-Policy header for UI requests

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* ci: disable stacker tests in ecosystem tools as they do not work on Ubuntu 24

Workaround this:

The Ubuntu 22 github free runner is not powerful enough to run all these tests.
We need a real fix on stacker side

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

---------

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2025-01-17 10:50:58 +02:00
peusebiu 772e90a6c5 Catalog content discovery (#2782)
fix(sync): use pagination when querying remote catalog

feat(api): added /v2/_catalog pagination, fixes #2715

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
2024-12-19 09:38:35 -08:00
Ramkumar Chinchani 037d6bf3d7 ci: fix nightly runs (#2838)
oras verion upgrade has incompatible cmdline args

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2024-12-19 01:11:27 -08:00
Ramkumar Chinchani 8789fb0008 chore: fix dependabot alerts (#2837)
* chore: fix dependabot alerts

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* chore: update oras version

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
2024-12-18 08:57:13 -08:00
Andrei Aaron 28ffa38170 chore: fix search for 'no digests left, finished' in nightly job (#2784)
Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2024-11-15 08:51:00 -08:00
Andrei Aaron dc38113df0 chore: use go1.23 in the build environment of zot container images (#2773)
* chore: use go1.23 in the build environment of zot container images

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

* chore: increase timeout in test/blackbox/restore_s3_blobs.bats

Looks like the message is actually there even if the test fails, maybe there is a timing issue.
https://github.com/project-zot/zot/actions/runs/11747889146/job/32730772641

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>

---------

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2024-11-10 10:36:09 -08:00
Ramkumar Chinchani cb2af94b0b feat: add support for docker images (#2714)
* feat: add support for docker images

Issue #724

A new config section under "HTTP" called "Compat" is added which
currently takes a list of possible compatible legacy media-types.

https://github.com/opencontainers/image-spec/blob/main/media-types.md#compatibility-matrix

Only "docker2s2" (Docker Manifest V2 Schema V2) is currently supported.

Garbage collection also needs to be made aware of non-OCI compatible
layer types.
feat: add cve support for non-OCI compatible layer types

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* 

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* test: add more docker compat tests

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* feat: add additional validation checks for non-OCI images

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* ci: make "full" images docker-compatible

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
2024-10-31 09:44:04 +02:00
Andrei Aaron 8553712613 chore: upgrade trivy to v0.55.2 and update the logic of waiting for zot to start in some jobs (#2685)
chore: upgrade trivy to v0.55.2, also update the logic of waiting for zot to start in some jobs

Seems like there's an increate in the time zot requires to start before servicing requests.
From my GitHub observations it is better check using curl instead of relying on hardcoded 5s or 10s values.

The logic in .github/workflows/cluster.yaml seems to be old and out of date.
Even on main right now there is only 1 our of 3 zots actualy running.
The other 2 are actually erroring: Error: operation timeout: boltdb file is already in use, path '/tmp/zot/cache.db'
This is unrelated to this PR, I am seeing the same issue in the olders workflow runs still showing the logs

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
2024-09-30 10:37:53 -07:00
Vishwas R 5ae7a028d9 feat(cluster): Add support for request proxying for scale out (#2385)
* feat(cluster): initial commit for scale-out cluster

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>

* feat(cluster): support shared storage scale out

This change introduces support for shared storage backed
zot cluster scale out.

New feature
Multiple stateless zot instances can run using the same shared
storage backend where each instance looks at a specific set
of repositories based on a siphash of the repository name to improve
scale as the load is distributed across multiple instances.
For a given config, there will only be one instance that can perform
dist-spec read/write on a given repository.

What's changed?
- introduced a transparent request proxy for dist-spec endpoints based on
siphash of repository name.
- new config for scale out cluster that specifies list of
cluster members.

Signed-off-by: Vishwas Rajashekar <vrajashe@cisco.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
Signed-off-by: Vishwas Rajashekar <vrajashe@cisco.com>
Co-authored-by: Ramkumar Chinchani <rchincha@cisco.com>
2024-05-20 09:05:21 -07:00
Ramkumar Chinchani 4105f120ef ci: add a ML model artifact test case (#2332)
Both as a test and an example.

Inspired by:
    https://github.com/kubeflow/model-registry/blob/main/docs/logical_model.md

Signed-off-by: Ramkumar Chinchani <rchincha@cisco.com>
2024-03-21 22:30:43 +02:00
Ramkumar Chinchani fdb401273c fix: ignore metadb errors if tag not found (#2301) 2024-03-13 07:28:08 +02:00