1
0
mirror of https://github.com/goharbor/harbor.git synced 2026-10-26 09:59:33 +03:00
Commit Graph

12674 Commits

Author SHA1 Message Date
Mandepudi Rani Chowdary
eb944bb199 fix: build valkey from source to support arm64 (#23282)
fix: support arm64 valkey build while preserving amd64 package path

- Keep amd64 behavior unchanged with tdnf install of valkey
- Isolate source-build fallback to arm64 only
- Verify source tarball with SHA256
- Move valkey version/checksum definition to root Makefile and pass as build args

Signed-off-by: ranimandepudi <ranichowdary.mandepudi@arm.com>
2026-06-02 08:17:10 +00:00
Chlins Zhang
10cc96b9b3 build(registry): update source tag to rc.4 (#23300)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-06-02 15:22:56 +08:00
Chlins Zhang
68e2bfba0d perf(replication): filter event policies in query (#23283)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-06-02 05:21:55 +00:00
Vadim Bauer
8b8223313b fix(security): validate blob-mount source project and reject tokens missing iat (#23270)
Follow-up to #22900.

tokenIssuedAfterProjectCreation only validated info.ProjectName. A
cross-repository blob mount (POST /v2/<repo>/blobs/uploads/?from=<src>)
also requires pull access to the source project, so a token issued
before the source project was deleted and recreated with the same name
would still be accepted. Validate the issued-at time against the
blob-mount source project as well.

Also fail closed when the token has no iat claim: claims.IssuedAt is a
*NumericDate pointer and was dereferenced unconditionally, panicking the
request handler for a token without iat instead of rejecting it.

Signed-off-by: Vadim Bauer <vb@container-registry.com>
2026-05-28 11:07:12 +00:00
Ikram ALOUI
382dd69fd2 fix: Bump repository update_time on tag and artifact changes (#23225)
fix: bump repository update_time on tag and artifact changes

Fixes #23149.

The "Last Modified Time" column on the repository list only moved
when an image was pushed. Adding or deleting a tag from the UI,
or deleting an artifact, left the timestamp stale.

This wires update_time bumps into:

- Tag create, delete, and retag (both UI and registry push)
- Artifact create and delete

A new repository.Manager.Touch method does the actual update and
invalidates the redis cache. It's skipped on tag-create conflicts
so a duplicate push doesn't falsely advance the timestamp.

The change is repo-only on purpose: artifacts are addressed by
their immutable digest, so an artifact update_time has no use.

Signed-off-by: aloui ikram <ikram@container-registry.com>
Co-authored-by: aloui ikram <ikram@container-registry.com>
Co-authored-by: Chlins Zhang <chlins.zhang@gmail.com>
2026-05-28 10:28:03 +08:00
Chlins Zhang
13532877a1 fix(cosign): ignore tlog during verification (#23284)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-05-26 07:57:11 +00:00
Chlins Zhang
3a7e8228a3 test(cosign): disable tlog for signing checks (#23279)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-05-25 18:54:25 +08:00
stonezdj(Daojun Zhang)
a7c6e4df30 Update Makefile PIP_INDEX_URL to use default value if not defined (#23273)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-22 08:40:32 +00:00
Ryan Hartje
96baa41ade update ECR adapter to allow for ecr-public to be mirored (#22351)
update ecrPattern for ECR registry to allow for ecr-public to be mirrored similar to how ecr-fips is

Signed-off-by: Ryan Hartje <ryan@ryanhartje.com>
2026-05-22 03:20:50 +00:00
Chlins Zhang
2ef6b9f557 build(registry): bump source tag to rc.2 (#23269)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-05-22 10:42:03 +08:00
jUDASmILE
2f79ecceb5 remove install net-tools from db dockerfile as photon removed it (#23266)
remove install net-tools from db dockerfile as photon removed it from repo already

Signed-off-by: jUDASmILE <judasmile@gmail.com>
2026-05-21 03:23:50 +00:00
Wang Yan
bbe79cae65 bump pg to v18 (#23184)
currently harbor is using the pg 15, I will use this pull request to bump it to pg 18.

Signed-off-by: wang yan <yan-yw.wang@broadcom.com>
Co-authored-by: wang yan <yan-yw.wang@broadcom.com>
2026-05-21 10:32:06 +08:00
vip892766gma
d452328b7f fix: duplicated "by" in beego ORM TableName comments (#23234)
Signed-off-by: Aiden Park <275402320+vip892766gma@users.noreply.github.com>
2026-05-20 08:08:37 +00:00
Prasanth Baskar
9f5914bfa3 fix(ui): use selected tag for pull command copy (#23240)
* fix(ui): use selected tag for pull command copy

Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>

* test(ui): cover selected tag pull command cases

Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>

---------

Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
2026-05-18 15:14:21 +00:00
jUDASmILE
33b363c81b Rebuild goharbor/photon image before create new harbor base images (#23248)
* refresh goharbor photon:5.0 when create new base image

Signed-off-by: jUDASmILE <judasmile@gmail.com>

* correct date and format in buildbaselog

Signed-off-by: jUDASmILE <judasmile@gmail.com>

---------

Signed-off-by: jUDASmILE <judasmile@gmail.com>
2026-05-18 10:01:58 +00:00
Prasanth Baskar
889364fd5f fix: Add i18n keys and missing translations (#23002)
* updated ru-ru-lang.json
* fix(i18n): add missing PROXY_CACHE_LOCAL_ON_NOT_FOUND keys to all language files
Add translated version of PROXY_CACHE_LOCAL_ON_NOT_FOUND and
PROXY_CACHE_LOCAL_ON_NOT_FOUND_TOOLTIP
* ci: add i18n key check to UI unit test pipeline
* fix(i18n): sync Russian proxy cache keys

---------
Signed-off-by: sias32 <sias320@gmail.com>
Signed-off-by: bupd <bupdprasanth@gmail.com>
Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
Co-authored-by: sias32 <sias320@gmail.com>
2026-05-18 09:05:07 +00:00
stonezdj(Daojun Zhang)
24b7300618 bump Go version from 1.25.7 to 1.26.3 (#23235)
fix UT failures for Go 1.26.3 compatibility
  Add //nolint:revive to packages whose names shadow Go stdlib
  Fix mock file import ordering (goimports compliance)
  Bump golangci-lint from v2.8.0 to v2.9.0 for Go 1.26 support
  Update CI step label to reflect Go 1.26

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-18 16:22:30 +08:00
stonezdj(Daojun Zhang)
11b9c51e9d support configurable PIP_INDEX_URL for swagger client build (#23241)
* support configurable PIP_INDEX_URL for swagger client build

Pass PIP_INDEX_URL through Makefile (conditional env injection),
APITest-Util.robot (robot variable with public PyPI default), and
Group3-Upgrade/run.sh (-v forwarding to robot).

Signed-off-by: stonezdj <stone.zhang@broadcom.com>

* wait more time for proxy cache ready
refine proxy cache test in migration prepare

Signed-off-by: stonezdj <stonezdj@gmail.com>

---------

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
Signed-off-by: stonezdj <stonezdj@gmail.com>
2026-05-18 10:32:25 +08:00
Prasanth Baskar
c80058d52f feat: Add gosec linter (#22668)
feat: add gosec linter

chore: update gosec excludes with comments

fix: gosec lint issue

Signed-off-by: bupd <bupdprasanth@gmail.com>
2026-05-15 00:48:57 +00:00
Tushar Jamdade
1a83ce4ece fix: correct max_upstream_conn validation and disabled bindings (#22681)
fix: max_upstream_conn validation bugs

Signed-off-by: Tushar Jamdade <tushar@DESKTOP-0D1FVJR.localdomain>
Co-authored-by: Tushar Jamdade <tushar@DESKTOP-0D1FVJR.localdomain>
Co-authored-by: Chlins Zhang <chlins.zhang@gmail.com>
2026-05-14 06:28:56 +00:00
Vadim Bauer
10196108d5 fix(build): default PIP_INDEX_URL to https://pypi.org/simple (#23227)
PR #23205 added PIP_INDEX_URL plumbing but did not set a default, so when
the variable is unset the top-level Makefile forwarded an empty value to
the photon sub-make. The sub-make in turn passed `--build-arg pip_index_url=`
to `docker build`, which overrides the Dockerfile.base ARG default with an
empty string and breaks `pip3 install pipenv ... --index-url ` (the option
requires an argument). This caused the BUILD_PACKAGE jobs on main to fail.

Mirror the existing NPM_REGISTRY pattern by providing a default value for
PIP_INDEX_URL in the top-level Makefile.

Signed-off-by: Vadim Bauer <vb@container-registry.com>
Co-authored-by: Orlix <7236111+OrlinVasilev@users.noreply.github.com>
2026-05-13 13:26:39 +00:00
stonezdj(Daojun Zhang)
90ea09f544 Add ListReferrers API to registry client and update parseScopes (#23170)
Add ListReferrers API to registry client and update parseScopes for bearer token auth

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-13 10:12:59 +00:00
Rakshit
30cc7795d6 Fix spelling error in comments (#23217)
fixing spelling mistakes in comments

Signed-off-by: Rakshit Yadav <yadavrakshit60@gmail.com>
2026-05-13 08:53:30 +00:00
Chlins Zhang
9373ef9f40 refactor(task): use Redis SET with SPOP for outdate execution status … (#23183)
refactor(task): use Redis SET with SPOP for outdate execution status refresh

Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-05-13 08:12:52 +00:00
stonezdj(Daojun Zhang)
3cd5bcdd57 test: use harbor-redis-base instead of harbor-valkey-base in SecurityHub CI (#23213)
test: use harbor-redis-base instead of harbor-valkey-base in Security Hub CI

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-13 06:59:58 +00:00
Mandepudi Rani Chowdary
18f7abd8ed Full Multi-Architecture Enablement for Harbor (amd64 + arm64) (#22311)
Co-authored-by: Orlix <7236111+OrlinVasilev@users.noreply.github.com>
Co-authored-by: Vadim Bauer <vb@container-registry.com>
Co-authored-by: Vadim Bauer <Bauer.vadim@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: bupd <bupdprasanth@gmail.com>
2026-05-12 09:03:22 +02:00
stonezdj(Daojun Zhang)
2cc8623dd9 Fix the GC robot testcase fail issue (#23214)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-11 15:20:37 +08:00
stonezdj(Daojun Zhang)
729e277d69 Support custom PyPI index URL for prepare image builds (#23205)
build: support custom PyPI index URL for prepare image builds

Pass PIP_INDEX_URL through the make build chain as a Docker --build-arg,
mirroring the existing NPM_REGISTRY pattern for the portal build.

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-05-08 02:23:40 +00:00
Sangyun_LEE
68fffc61b1 fix: Disallow Empty robot_name_prefix to prevent OIDC CLI login from being blocked (#22556)
* fix: Cannot Pass User empty robot prefix
* add no whitespace pattern in robotnamePrefix
* add validate in config manager.go
* add test suite  in config manager

Signed-off-by: falconlee236 <falconlee236@gmail.com>
Co-authored-by: Vadim Bauer <vb@container-registry.com>
Co-authored-by: Prasanth Baskar <bupdprasanth@gmail.com>
2026-05-07 09:17:05 +00:00
Huang Dongfeng
9c21d4427a 【fix issue 22865】TCR provider adaptor can't parse intertional secret ID (#22869)
fix issues/22865

Signed-off-by: pikehuang <pikehuang@users.noreply.github.com>
Co-authored-by: pikehuang <pikehuang@users.noreply.github.com>
2026-05-06 08:36:01 +00:00
Prasanth Baskar
fa562b81f4 fix(i18n): localize max upstream connection placeholder (#23197)
Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
2026-05-06 13:39:02 +08:00
stonezdj(Daojun Zhang)
62c278dfb1 Make openapi-generator-cli download URL configurable (#23186) 2026-05-01 16:11:17 +08:00
Chlins Zhang
88ab66244e feat: replace redis with valkey as cache backend (#23157)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-28 14:59:43 +08:00
Chlins Zhang
406089a69c refactor(config): centralize registry HTTP client timeout (#23154)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-28 05:12:57 +00:00
Chlins Zhang
ae723f5eda ci: disable exporter cache in API tests (#23177)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-28 10:19:04 +08:00
infracore
c246fe50c9 ci: add API schema drift check for v2.0 swagger spec (#23089)
Advisory-only workflow that runs on PRs touching api/v2.0/**.
Diffs the base branch spec against the PR and posts a comment
identifying breaking vs non-breaking changes with semver
classification. Never blocks merges.

Ref: https://github.com/goharbor/harbor/issues/23067

Signed-off-by: infracore <infracore@users.noreply.github.com>
Co-authored-by: infracore <infracore@users.noreply.github.com>
2026-04-26 08:40:31 +00:00
stonezdj(Daojun Zhang)
914738c3f1 Update artifact_accessory to add source column to identify accessory (#23144)
Add project_metadata config item proxy_referrer_api
   Rename getRemoteRepo to GetRemoteRepo

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-24 08:11:28 +00:00
stonezdj(Daojun Zhang)
63618e8a9f Add UI option to enable proxy cache referrer API (#23151)
Add UI option to enable proxy cache referrer API (#22767)

Expose the proxy_referrer_api setting in the portal for proxy-cache
projects (create project and policy configuration), with i18n strings.

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-24 14:54:26 +08:00
stonezdj(Daojun Zhang)
75d0c0de3d Fix the issue distribution instance edit without credential can not save (#23165)
Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-23 08:35:36 +00:00
Anurag Ojha
4cedb8c0e2 fix(exporter): add Docker HEALTHCHECK (#22778)
* Add Docker HEALTHCHECK for harbor-exporter

Signed-off-by: intojhanurag <aojharaj2004@gmail.com>

* configurable port use

Signed-off-by: intojhanurag <aojharaj2004@gmail.com>

* add comment

Signed-off-by: intojhanurag <aojharaj2004@gmail.com>

---------

Signed-off-by: intojhanurag <aojharaj2004@gmail.com>
Co-authored-by: Chlins Zhang <chlins.zhang@gmail.com>
2026-04-22 04:06:19 +00:00
paragdudeja
79945fdf16 perf(blob): fix full table scan in blob unassociation check during GC (#22994)
* perf(blob): use batched UNION with LIMIT 1 in FindBlobsShouldUnassociatedWithProject

Replace the single IN (...) query with batches of UNION'd per-blob
SELECT ... LIMIT 1 subqueries. Two improvements:

1. LIMIT 1 per subquery short-circuits as soon as one matching artifact
   is found, avoiding full scans for associated blobs — especially
   impactful during GC when checking large numbers of blobs.

2. Blobs are processed in batches of 100 to cap the size of each
   generated SQL statement and avoid query length / memory issues when
   dealing with very large blob sets.

Signed-off-by: paragdudeja <parag1907@gmail.com>

* test(blob): add batching boundary test for FindBlobsShouldUnassociatedWithProject

Verify correctness when blob count exceeds the batch size (100), ensuring
blobs are correctly identified across multiple query batches.

Signed-off-by: paragdudeja <parag1907@gmail.com>

* perf(blob): use VALUES+EXISTS instead of UNION+LIMIT1 in FindBlobsShouldUnassociatedWithProject

Replace the batched UNION+LIMIT1 approach with a single VALUES+EXISTS query.
EXISTS short-circuits on the first match per blob giving the planner high
selectivity to use the index, while VALUES lets all digests be checked in
one round trip with minimal planning overhead.

Benchmarked on production DB (~1.78M artifacts, 1000 blobs):
- UNION+LIMIT1 (10x100 batches): ~1845ms
- UNION+LIMIT1 (1x1000 batch):   ~594ms  (447ms planning, 147ms execution)
- VALUES+EXISTS (1x1000):        ~1293ms  (3ms planning, 1290ms execution)

VALUES+EXISTS is simpler, has near-zero planning overhead, and avoids
the repeated planning cost of multiple batched queries.

Signed-off-by: paragdudeja <parag1907@gmail.com>

---------

Signed-off-by: paragdudeja <parag1907@gmail.com>
2026-04-22 03:17:46 +00:00
ipsitapp8
566d2be06a fix: add nil guard in auditext manager Create function (#23107)
* fix: add nil guard in auditext manager Create function

Signed-off-by: ipsitapp8 <ipsitapp8@gmail.com>

* chore: trigger CI for label check

Signed-off-by: ipsitapp8 <ipsitapp8@gmail.com>

---------

Signed-off-by: ipsitapp8 <ipsitapp8@gmail.com>
2026-04-21 09:05:51 +00:00
stonezdj(Daojun Zhang)
ee96bb779b Add proxy cache from dockerhub, harbor, jfrog (#23121)
default to run proxy cache from harbor
    add SKIP_PROXY_CACHE setting to skip run proxy cache testcase in github action incase
    registry.goharbor.io unstable

Signed-off-by: stonezdj <stone.zhang@broadcom.com>
2026-04-20 21:03:23 +08:00
Chlins Zhang
781bafa509 fix(scan): use created time from annotations in accessory art (#23113)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-20 11:07:01 +08:00
Chlins Zhang
62564ccacc fix(gc): redact redis_url_reg from GC extra attrs (#23134)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-17 15:04:50 +08:00
Chlins Zhang
b8ddde34e3 feat(gc): use human-readable sizes in GC log messages (#23123)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-16 15:45:34 +08:00
Max Fröhlich
1524e931c6 fix(dao): use context-aware methods for database operations in MetaDAO (#23074)
Signed-off-by: Max Froehlich <max.froehlich@serviceware.de>
2026-04-15 11:24:10 +08:00
stonezdj(Daojun Zhang)
8a610a3470 Fix issue related to scanner API (#23061)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2026-04-14 06:48:34 +00:00
Chlins Zhang
1a236ce8cb feat(session): prevent background polling from renewing session TTL (#22980)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2026-04-13 08:47:56 +00:00
Prasanth Baskar
19f8983ef8 fix(deps): Bump go-jose/go-jose/v4 to v4.1.4 to fix DoS vulnerability (#23090)
Upgrades github.com/go-jose/go-jose/v4 from v4.1.3 to v4.1.4 to
address CVE-2026-34986 (GHSA-78h2-9frx-2jm8), which allows a crafted
JWE to trigger a panic during decryption.

Signed-off-by: Prasanth Baskar <bupdprasanth@gmail.com>
2026-04-13 07:31:22 +00:00