Commit Graph

5587 Commits

Author SHA1 Message Date
Chlins Zhang
77df4d92fd
feat: support customize registry http client timeout (#17768)
Support override the registry http client timeout from env `REGISTRY_HTTP_CLIENT_TIMEOUT` (in minutes), the timeout is 30 minutes by default.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-11-09 17:20:47 +08:00
Shijun Sun
87005f32d9
Improve css for tags column (#17734)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-11-07 16:49:41 +08:00
erismaster
ec7717e23b
Add JFrog Artifactory As Supported Proxy-Cache Registry Source (#17738)
Add JFrog Artifactory As Supported Proxy-Cache

Enables the support of JFrog Artifactory as a source for proxy-cache. I
have tested this with a local build and was able to proxy images just
fine.

Signed-off-by: Derrik Campau <dcampau@vmware.com>

Signed-off-by: Derrik Campau <dcampau@vmware.com>
2022-11-04 12:50:34 +08:00
Wang Yan
4fb0a19efb
add cli randomly for empty update (#17740)
give an random cli secret when client gives empty update.

Signed-off-by: Wang Yan <wangyan@vmware.com>

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-11-03 21:04:29 +08:00
Shijun Sun
10cb2fd2c7
Update the way for generating new cli secret (#17744)
Update the way for refreshing cli-secret

Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-11-03 21:04:04 +08:00
Shijun Sun
93ac2e8111
Remove email config page (#17711)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-11-03 14:48:06 +08:00
stonezdj(Daojun Zhang)
39ca918ffe
Add jobservice monitoring api list pool, worker and stop running task (#17658)
Add REST API to list job pool, worker, stop running task

  Add jobservice handler to retrieve configuration
  Add RBAC for jobservice monitoring dashboard
  Add REST API to list pool, worker and stop running task

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

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-11-03 10:47:40 +08:00
Shijun Sun
4206ec8ab1
Add triggers and filters check for target changing under push mode (#17731)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-11-02 15:34:34 +08:00
MinerYang
1f05dcdcda
bump up golang.org/x/crypto to v0.1.0 (#17691)
Signed-off-by: yminer <yminer@vmware.com>

Signed-off-by: yminer <yminer@vmware.com>
2022-11-02 14:55:38 +08:00
Chlins Zhang
bf4cfe9e1e
fix: add human friendly message when export cve job failure (#17726)
Add human friendly when export CVE in the condition of empty CSV file,
because this file will be stored as system artifact and pushed to
distribution, but it will leads to error when push empty blob to S3
storage driver.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-11-01 15:04:07 +08:00
Shijun Sun
0edc01a395
Add copy_by-chunk checkbox for replication rule (#17617)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-11-01 12:33:40 +08:00
Chlins Zhang
c330b8c63a
feat: introduce the copy by chunk for replication (#17602)
1. Add sql migration to alter replication policy table
2. Implement the PullBlobChunk and PushBlobChunk for the underlying v2 registry client
3. Update image transfer logic to support copy by chunk
4. Update the replication policy API handler

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-11-01 11:19:17 +08:00
MinerYang
b193f3f717
bump up github.com/prometheus/client_golang to v1.13.0 (#17688)
Signed-off-by: yminer <yminer@vmware.com>

update
2022-10-31 16:46:50 +08:00
Chlins Zhang
1a1a6d2fd2
feat: log completion message when database migrated (#17684)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-10-31 10:45:05 +08:00
stonezdj(Daojun Zhang)
3050e856d9
Add check when adding project member (#17701)
Signed-off-by: stonezdj <stonezdj@gmail.com>

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-10-28 15:06:27 +08:00
MinerYang
6f4d84ecdb
bump up golang.org/x/text to v0.4.0 (#17689)
bump up golang.org/x/text tp v0.4.0

Signed-off-by: yminer <yminer@vmware.com>

Signed-off-by: yminer <yminer@vmware.com>
2022-10-27 13:19:57 +08:00
MinerYang
c5417a2d00
bump up helm.sh/helm/v3 (#17698)
bump helm.sh/helm/v3 to achieve the purpose of bump up github.com/docker/cli indirectly

Signed-off-by: yminer <yminer@vmware.com>

Signed-off-by: yminer <yminer@vmware.com>
2022-10-27 13:19:09 +08:00
Eng Zer Jun
cd0fa06a32
test: use T.Setenv to set env vars in tests (#17670)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-10-25 10:56:26 +08:00
Gaius
81f618fb9a
feat: optimize return value in pkg modifier (#17655)
Signed-off-by: Gaius <gaius.qi@gmail.com>
2022-10-21 15:38:39 +08:00
Maksym Trofimenko
486bdb6b99
Fix redirect url redirect_url when OIDC auth mode is enabled (#17628)
* fix redirect url for OIDC auth mode

Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>

* portal lint_fix

Signed-off-by: mtrofimenko <gtpoxa@gmail.com>

* make linter happy

Signed-off-by: mtrofimenko <gtpoxa@gmail.com>

Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>
Signed-off-by: mtrofimenko <gtpoxa@gmail.com>
Co-authored-by: Maksym Trofimenko <maksym@container-registry.com>
2022-10-21 14:38:13 +08:00
Shijun Sun
c4146667f1
Remove validator for username claim input (#17663)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-10-20 15:46:03 +08:00
Vincent Ni
9c0275deb6
Fix ecr authorization token issue (#17645)
Signed-off-by: Vincent Ni <kangqini@amazon.com>
2022-10-18 11:09:58 +08:00
stonezdj(Daojun Zhang)
b6bdb4b57f
Add default project when pulling from dockerhub without project name (#17537)
Check project is default project format in dockerhub
 Redirect blob/manifest request to default url
 Fixes #12719

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

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-10-17 17:37:44 +08:00
Gaius
25a42af277
test: add GetRedisURL to tests redis pkg and fix hardcoded redis url (#17581)
Signed-off-by: Gaius <gaius.qi@gmail.com>
2022-10-17 17:21:37 +08:00
Vincent Ni
805a36e7f0
Fix Replication to Cross-account AWS ECR (#17583)
Replication to Cross-account AWS ECR
2022-09-30 09:07:47 +02:00
Shijun Sun
cf5197246a
Fix message processing issue (#17609)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-29 11:12:11 +08:00
Shijun Sun
303133f695
Improve auth check guard service (#17605)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-28 17:05:25 +08:00
Shijun Sun
90fe39684b
Refresh config every time entering the configuration page (#17600)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-27 16:04:02 +08:00
MinerYang
83bc24f6c1
Bump up golang version to v1.19 (#17588)
Signed-off-by: yminer <yminer@vmware.com>

update
2022-09-22 17:38:26 +08:00
Shijun Sun
1f908088b7
Simplify proxy config (#17548)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-22 11:40:04 +08:00
stonezdj(Daojun Zhang)
b08b5fe617
Add check on the audit log forward and skip audit log database (#17575)
fixes #17524
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-09-21 15:24:57 +08:00
Shijun Sun
3d8959be49
Refactor artifact-list component (#17577)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-20 17:16:16 +08:00
stonezdj(Daojun Zhang)
b6c978c7f7
Change ldap.Search to ldap.SearchWithPaging (#17534)
fixes #16390

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

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-09-19 11:04:54 +08:00
Wang Yan
848167c4e0
bump dependencies (#17549)
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
- dependency-name: golang.org/x/net
- dependency-name: helm.sh/helm/v3

Signed-off-by: Wang Yan <wangyan@vmware.com>

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-09-15 16:50:16 +08:00
Vincent Ni
a3d96000f5
Fix cross account issue (#17533)
Signed-off-by: Vincent Ni <kangqini@amazon.com>
2022-09-15 14:25:41 +08:00
Shijun Sun
13b3233faf
Refactor artifact-list-tab component (#17542)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-15 11:37:36 +08:00
Shijun Sun
acf68d3533
Fix css issue for resource type filter (#17529)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-09-13 16:57:25 +08:00
Chlins Zhang
9573cd7753
fix: handle the break change for parse external sentinel redis url (#17501)
Handle the ParseSentinelURL to resolve an incompatible modification that does not recognize the default redis database.

Closes: #17483

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-09-07 11:29:43 +08:00
Shijun Sun
7bd6c9480d
Correct i18n key for zh-cn-lang.json (#17457)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-29 11:33:00 +08:00
Shijun Sun
1ce5d98efe
Remove preload for theme css files (#17468)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-29 11:32:41 +08:00
Shijun Sun
c3e98c8848
Change title for Swagger UI (#17451)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-24 16:00:26 +08:00
Shijun Sun
006f495c82
Add WASM filter for artifacts list (#17447)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-23 17:00:34 +08:00
Shijun Sun
83bce02e61
Refactor swagger ui (#17428)
Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-23 12:03:45 +08:00
Chenyu Zhang
31a3c6d18c
fix: validate the existence of project for export cve api (#17437)
Validate the existence of the project for export CVE API handler, return
not found error if the project is not exist.

Closes: #17430

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-22 15:44:57 +08:00
Chenyu Zhang
5d7a549620
upgrade: bump up mockery to v2.14.0 (#17415)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-22 14:21:13 +08:00
Matt Busche
548b27a0c6
Update to latest version of angular (#17303)
* Update to the latest version of angular

Signed-off-by: Matt Busche <mrbusche@gmail.com>
2022-08-17 11:30:48 +08:00
Chenyu Zhang
24d60eb119
enhancement: add error log for create task (#17397)
Signed-off-by: chlins <chenyuzh@vmware.com>

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-16 11:35:05 +08:00
Shijun Sun
4521189e5e
Improve unit test for sub-accessories component (#17372)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-10 16:20:55 +08:00
Shijun Sun
423647ea33
Improve input validator for copy-component (#17310)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-09 12:15:17 +08:00
Shijun Sun
893cb0a655
Fix ui issues found in testing-day-round-2 (#17357)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-09 12:14:53 +08:00
MinerYang
daf0874ed5
project userid not found log level into debug (#17343)
Signed-off-by: yminer <yminer@vmware.com>
2022-08-08 14:20:13 +08:00
Chenyu Zhang
1e13999fff
fix: validate export cve request params (#17341)
1. Validate export cve request params in the API handler
2. Trim space for request in the scan export job

Closes: #17326

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-08 11:07:05 +08:00
Chenyu Zhang
49d73fa57d
fix: export cve for image manifest list (#17333)
1. Fix export cve for image manifest list
2. Remove row_id column in csv file
3. Update cve execution swagger API description

Closes: #17331,#17330,#17335,#17334

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-05 20:07:02 +08:00
prahaladdarkin
c776ea8bfe
Export CVE data Score column empty values (#17321)
Closes: https://github.com/goharbor/harbor/issues/17189

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-08-05 10:03:42 +08:00
Chenyu Zhang
49999ab1c0
fix: replication webhook lost when src namespace different with dest (#17312)
Fix the replication webhook notification lost when the rule is
pull-based and src namespace different with dest.

Closes: #17298

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-04 15:10:19 +08:00
Chenyu Zhang
70a95a9696
fix: reduce the high db cpu usage for tag retention (#17296)
1. Add two indexes to database migrations.
2. Skip refresh quota in middleware for requests from jobservice.
3. Refresh quota by self in the end of tag retention job.

Closes: #14708

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-08-04 10:08:02 +08:00
Wang Yan
914d9a5526
fix copy artifact accessory quota issue (#17293)
It needs to request quota for accessory on copying artifact.

Signed-off-by: wang yan <wangyan@vmware.com>
2022-08-03 20:02:20 +08:00
lengrongfu
dac3c7b31d
fix: distribution v2.8.0 tag does not match checksum (#17306)
Signed-off-by: lengrongfu <1275177125@qq.com>
2022-08-03 17:43:37 +08:00
Wang Yan
ebab99613f
update session log level (#17300)
To avoid too much noise in the core log, udpate the level to debug.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-08-03 13:51:26 +08:00
MinerYang
722d1a19ea
update image extra attributes author in labels (#17291)
update image extra attributes author

Signed-off-by: yminer <yminer@vmware.com>

adding spec comment

Signed-off-by: yminer <yminer@vmware.com>
2022-08-03 11:50:54 +08:00
stonezdj(Daojun Zhang)
66d34c8e0c
Return time.Time{} when cron string is empty (#17289)
change log level to debug to avoid noise

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-08-02 15:18:25 +08:00
Shijun Sun
b4f2f170b4
Upgrade Angular dev-tool package (#17287)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-08-01 18:10:34 +08:00
MinerYang
1296e7ebf0
Enable staticcheck (#17286)
enable golangci-lint staticcheck

enable staticcheck in golangci-lint

Signed-off-by: yminer <yminer@vmware.com>
2022-08-01 16:58:51 +08:00
Adam
bf741ad381
feature: Use RegisteredClaims instead of deprecated staruct StandardClaims (#16206)
Signed-off-by: wujw39640 <wujw39640@hundsun.com>
2022-08-01 10:23:47 +08:00
Chenyu Zhang
bbc7282c46
upgrade: bump up beego to 1.12.11 (#17277)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-31 16:23:28 +08:00
Thomas Maroschik
0559ce7e28
fix: oidc token is not respected in /service/token endpoint (#16442)
Signed-off-by: Thomas Maroschik <tmaroschik@dfau.de>
2022-07-30 13:01:51 +02:00
Shijun Sun
455ebf51fc
Fix null pointer issue for creating reolication rule (#17274)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-30 17:17:10 +08:00
Eike David Lenz
0fe5eed55d
fix cve allowlist projectmeta validation (#15800)
Signed-off-by: Eike David Lenz <e.lenz@mittwald.de>
2022-07-30 16:59:18 +08:00
Shijun Sun
7e7ae7ea1b
Add permission check to CVE export (#17267)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-29 19:48:39 +08:00
Shijun Sun
04fa3853c9
Fix router issues for UI (#17235)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-29 19:04:01 +08:00
Chenyu Zhang
bff4e13087
fix: export cve adds resource check and project validation (#17265)
1. Add resource permission check for API handler
2. Validate export cve params project
3. Optimize friendly human message when execution status is error

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-29 19:01:46 +08:00
Chenyu Zhang
19e73174e2
refactor: refact codebase of cve export process and filter (#17254)
1. Refact the scan export FilterProcessor interface
2. Optmize the sql template for export cve report
3. Update the process of cve export job

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-28 16:05:12 +08:00
Wang Yan
02c41573d6
fix update robot regression (#17248)
Only check the project id for the project level robot

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-07-27 20:13:46 +08:00
MinerYang
f7ebf20d2e
Disable Nydus middleware for v2.6 (#17233)
disable nydus middleware for v2.6

Signed-off-by: yminer <yminer@vmware.com>

remove nyduus module import in main.go

Signed-off-by: yminer <yminer@vmware.com>
2022-07-27 08:41:33 +08:00
prahaladdarkin
d53af792ad
Fixes for various bugs/issues logged as a part of the test day. (#17232)
Closes:
* CVE Data Export API IDOR issue
* https://github.com/goharbor/harbor/issues/17199
* https://github.com/goharbor/harbor/issues/17193
* https://github.com/goharbor/harbor/issues/17188
* https://github.com/goharbor/harbor/issues/17184

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-07-26 16:50:54 +08:00
Wang Yan
02eae9dede
Filter out accessory from list artifact results (#17231)
Fixed #17145
1, Filter out the accessory from the artifact list.
2, Disable the display func of the accessory interface, currently this will not impact any kind of accessory, like signature and nydus. If we'd like to introduce it, it needs to resolve the pagiation issue of artifact list.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-07-26 00:38:05 +08:00
Abirdcfly
2fece8c9ea
delete duplicate import and use ST1019 in golangci-lint (#17211)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-25 14:12:00 +08:00
Shijun Sun
e9855a88dd
Fix cve export UI issues (#17227)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-25 10:41:44 +08:00
stonezdj(Daojun Zhang)
712419778a
Return bad request if audit log retention hour > 240000 hour (#17217)
Cap the retention hour to 240000 hour
  Fixes #17198

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-07-22 15:14:10 +08:00
stonezdj(Daojun Zhang)
8e876d847c
Add resource type in forward audit log (#17216)
Add resource type when forward audit log

  fixes #17201

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-07-22 09:54:07 +08:00
Shijun Sun
56e669ebbc
Fix log rotation UI issues (#17220)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-21 16:49:26 +08:00
Shengwen YU
acc2872fa8
fix: remove redundant check due to always false (#17206)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-07-20 16:53:56 +08:00
Loong Dai
09371b48e8
lint: sort imports (#17131)
* lint: add goimports

Signed-off-by: Loong Dai <loong.dai@intel.com>
2022-07-20 11:33:08 +08:00
prahaladdarkin
f3edb03b49
Fix to CVE Data Export functionality for images pushed by docker push (#17182)
Closes:
* https://github.com/goharbor/harbor/issues/17167

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-07-18 09:22:15 +08:00
stonezdj(Daojun Zhang)
9a41272986
Change the log to logger in purge job (#17162)
Fixes #17151

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-07-14 17:46:52 +08:00
prahaladdarkin
3f383e3ffd
Improvements to Vulnerability Data Export functionality. (#17161)
Closes:
* https://github.com/goharbor/harbor/issues/17152
* https://github.com/goharbor/harbor/issues/17153
Better error handling in case of task executions not found in the system

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-07-14 15:08:25 +08:00
Shijun Sun
aa3cdcbc6c
Add CVE data exporting UI (#16236)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-11 17:43:25 +08:00
prahaladdarkin
130452111b
Vulnerability scan data export functionality (#15998)
Vulnerability Scan Data (CVE) Export Functionality
Proposal - goharbor/community#174
Closes - https://github.com/goharbor/harbor/issues/17150
Changes:
* CVE Data export to CSV with filtering support.
* Implement CSV data export job for creating CSVs
* APIs to trigger CSV export job executions

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-07-11 16:35:04 +08:00
Roooocky
7e4b26b220
Add new feature for supporting WebAssembly artifact (#16931)
support wasm

Signed-off-by: ln23415 <ln23415@hotmail.com>
2022-07-08 23:08:28 +08:00
Shijun Sun
af802a4416
Hide pull command for Nydus (#17143)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-08 17:03:02 +08:00
Shijun Sun
6c1fbde2a8
Developer role should be able to view tag-retention rules (#17138)
Developer role should be able to view tag-rerention rules

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-07-08 11:38:54 +08:00
MinerYang
efd9632e96
add nydus middleware (#17126)
Signed-off-by: yminer <yminer@vmware.com>

remove comments

Signed-off-by: yminer <yminer@vmware.com>

update ut manifest

Signed-off-by: yminer <yminer@vmware.com>

modify comment manifest

Signed-off-by: yminer <yminer@vmware.com>

updtae ut testcase

Signed-off-by: yminer <yminer@vmware.com>

fixwhitespace lint

Signed-off-by: yminer <yminer@vmware.com>

update isNydus judgement && define annotation var

Signed-off-by: yminer <yminer@vmware.com>

whitespace lint

Signed-off-by: yminer <yminer@vmware.com>
2022-07-08 09:56:10 +08:00
Wang Yan
bd8d66c68d
resolve robot authgen password format issue (#17134)
In some cases, the robot automatically generates passwords that do not meet confidentiality requirements.
The fix adds retry for auto generating passwords, and the timeout is 1 minute.

The requirement: the secret must longer than 8 chars with at least 1 uppercase letter, 1 lowercase letter and 1 number

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-07-08 02:05:32 +08:00
DarthBlair
360689b1b9
Added Tag Retention Permission to Developer (#16514)
* added rbac.ResourceTagRetention to developer

Added Permissions to Developer to according to the "User Pemission by Role" Table

Signed-off-by: DarthBlair <Marcel.Bassuener@googlemail.com>

Co-authored-by: Shengwen Yu <yshengwen@vmware.com>
2022-07-07 12:28:19 +08:00
MinerYang
8485da240d
bump up github.com/containerd/containerd to v1.5.13 (#17129)
Signed-off-by: yminer <yminer@vmware.com>
2022-07-07 08:53:43 +08:00
Chenyu Zhang
1a1ce634cc
Fix the process of cache layer (#17010)
fix: fix cache layer issues (#16995,#16997,#16996,#17038)

1. Load config and initialize cache layer in jobservice(for GC)
2. Cache artifact by digest the key should contains repository name
3. Repository cache cleanup error when update
4. Skip save cache when request ctx in transaction

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-06 16:11:53 +08:00
stonezdj(Daojun Zhang)
dcccb44db8
Add options to the user.Count method (#16285)
Fixes #16269, exclude the admin account by default
  Add excludeDefaultAdmin method -- exclude default admin by option
  Update authModeCanBeModified method -- the user count should be 0 without admin

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-07-06 13:57:31 +08:00
Wang Yan
6917021b41
resolve copy failure for artifact with multiple accessories (#17123)
If the artifact has more than one signaure, it will currently copy the last one. After the fix, all accessories can be copied to the target project.

Signed-off-by: wang yan <wangyan@vmware.com>
2022-07-05 20:10:22 +08:00
Chenyu Zhang
927f9f5af3
fix: attach labels for replication event (#17108)
Attach labels for replication event, list labels by artifact ID so for
event-based replication rule filter by label can work as expect.

Closes: #17014

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-07-05 19:57:13 +08:00
stonezdj(Daojun Zhang)
c9d6ba1469
Revert "Skip to refresh execution status when unchanged (#17023)" (#17111)
This reverts commit 88b8a7ac2c.

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-07-04 18:10:59 +08:00
Shengwen YU
315d8a8993
fix: update code in compliance with golangci-lint revive (#17087)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-07-01 14:52:47 +08:00
Wang Yan
94bf1c0ebd
Resovle the system artifact schedule issue (#17098)
Scheduling of system artifact depends on the jobservice, where gorountine is used to avoid the circular dependencies between core and jobservice.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-07-01 14:25:45 +08:00
Wang Yan
b4ef1dbfd5
Unify retention schedule/task retrieve and update (#17083)
Add not-found handling for non exist items in retention operation.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-07-01 01:58:14 +08:00
Wenkai Yin(尹文开)
ab74e853ee
Enhance the read-only API to avoid deleting operations during the job running (#17055)
Enhance the read-only API to avoid deleting operations during the job running

Fixes #16901

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-06-29 08:00:17 +08:00
Chenyu Zhang
1c3eb6974c
fix: update preheat api handler and DAO (#17079)
1. fix preheat dao Get method
2. update preheat tasks and getLog api

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-28 19:01:08 +08:00
stonezdj(Daojun Zhang)
aa63569de2
Fix scan log mismatch issue (#17085)
Add checks in label

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-28 18:12:38 +08:00
Shijun Sun
889407ab38
Add stop button for audit log rotation (#17054)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-28 15:48:17 +08:00
Shijun Sun
25d3583d36
Improve cron validator for replication rule (#17069)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-28 14:41:55 +08:00
Shijun Sun
acb0c09bd6
Improve copy command component (#17068)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-28 14:41:13 +08:00
stonezdj(Daojun Zhang)
c639257ba7
Support stop purge audit log job (#17033)
fixes #17006

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-28 11:15:11 +08:00
Wang Yan
ea2ed27a7d
add url raw query check middleware (#17070)
The middleware can give a uniform url validation and raised error early.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-06-24 17:57:46 +08:00
Chenyu Zhang
8e99c83b19
fix: fix the update of retention policy (#17064)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-23 19:12:48 +08:00
Chenyu Zhang
c343232081
fix: revise the process of policy update (#17021)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-22 18:30:06 +08:00
stonezdj(Daojun Zhang)
e6eb7821d0
Unify the process of job schedule/task retrieve and update (#17012)
Unify the process of jobservice execution/task retrieve and update

   Change regular expression in robot account

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-22 18:22:33 +08:00
Shengwen YU
8b9f6069db
fix: enable structcheck/typecheck/unused for golangci-lint (#17047)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-22 11:25:07 +08:00
Shengwen YU
44bfb992f4
fix: update code for golangci-lint varcheck (#17045)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-21 16:56:36 +08:00
prahaladdarkin
7024442f25
Project name validation to prevent system artifact reserved project names (#17029)
Include system artifact size in system storage space calculation.

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-06-21 12:51:29 +08:00
MinerYang
aab320591f
golangci-lint fix ineffassign (#17027)
Signed-off-by: yminer <yminer@vmware.com>

delete src/lib/redis/helper.go

Signed-off-by: yminer <yminer@vmware.com>
2022-06-21 12:01:59 +08:00
Shijun Sun
c1b879a594
Add stop button for GC (#17037)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-21 10:12:27 +08:00
stonezdj(Daojun Zhang)
88b8a7ac2c
Skip to refresh execution status when unchanged (#17023)
fixes #16640

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-20 13:56:19 +08:00
Shijun Sun
6c02854921
Remove style-lint package and upgrade @angular-devkit/build-angular (#17009)
Remove style-lint package  and upgrade @angular-devkit/build-angular package

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-20 10:36:57 +08:00
Chenyu Zhang
c7e153654a
fix: update the jobservice hook retry concurrency (#17024)
Change the jobservice hook max retry concurrency from 512 to same with
the js worker numbers.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-18 13:52:33 +08:00
Wenkai Yin(尹文开)
6c515b04d4
Support stop GC execution (#17004)
Support stop GC execution

Fixes 16902

Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
2022-06-17 20:03:24 +08:00
MinerYang
e9378ea00e
clean up unused mock file&& regenerate mocks (#17025)
clean up unused mock file&& re gen_mocks

Signed-off-by: yminer <yminer@vmware.com>
2022-06-17 18:19:23 +08:00
Maksym Trofimenko
9a3cb4a041
GDPR compliant deletion of Users (#16859)
fixes #16697

Signed-off-by: Maksym Trofimenko <maksym@container-registry.com>
2022-06-16 14:28:15 +02:00
Shengwen YU
e9fca3de45
fix: refactor code for golangci-lint whitespace (#17005)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-16 17:42:46 +08:00
Shengwen YU
c2a9f5de64
fix: update code for golangci-lint gosimple (#16974)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-14 13:44:09 +08:00
Wang Yan
f946bd21f5
fixes 16940 (#16987)
Response the sign status to UI for the public project.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-06-13 10:55:38 +08:00
Shijun Sun
c927a3cd52
Fix some UI issues (#16979)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-13 10:44:05 +08:00
Chenyu Zhang
6cfbf76781
fix(replication): azurecr replication with token (#16888) (#16947)
Fix azurecr use ACR token failed to list tags, the root cause is the
scope action of acr token is 'metadata_read' not 'pull' when list v2
tags API.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-13 10:05:05 +08:00
Chenyu Zhang
e08ad05659
fix(swagger): append scan report version 1.1 to swagger docs (#16965)
fix(swagger): append scan report version 1.1 to swagger docs default value

The default value of swagger header X-Accept-Vulnerabilities should contains
scan report version 1.0 and 1.1.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-06-10 16:38:43 +08:00
stonezdj(Daojun Zhang)
e778ec2edf
Add audit_log forward endpoint (#16914)
add config item to set log forward endpoint
  fallback the audit log to default log when endpoint in error

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-10 10:59:40 +08:00
prahaladdarkin
4d062c33d1
Introduce system artifact manager cleanup job (#16879)
Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-06-09 14:16:50 +08:00
MinerYang
b8a71ac348
bump up golang version to v1.18.3 (#16957)
Signed-off-by: yminer <yminer@vmware.com>

update ci/ut_install.sh

Signed-off-by: yminer <yminer@vmware.com>
2022-06-08 17:56:14 +08:00
Shijun Sun
eee72e2354
Add style lint and add code lint to the pipeline (#16954)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-08 16:35:19 +08:00
stonezdj(Daojun Zhang)
a5d79a859c
The purge job update time is wrong (#16943)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-08 16:18:44 +08:00
Shengwen YU
b43ba15f40
fix: golangci-lint errcheck (#16920)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-06-07 17:00:36 +08:00
MinerYang
9b22e2943f
bumpup mockery to v1.12.3 (#16955)
Signed-off-by: yminer <yminer@vmmware.com>

Co-authored-by: yminer <yminer@vmmware.com>
2022-06-07 16:04:33 +08:00
Shijun Sun
bf317d0b26
Add clearances ui (#16941)
Add audit log purge and forwarding ui

Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-06-07 15:18:36 +08:00
stonezdj(Daojun Zhang)
0dc7a6806c
Add NextScheduledTime in schedule object (#16925)
Add NextSchedule in utils
  Add NextScheduledTime in ScheduleObj to display it in UI

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-06-06 22:17:41 +08:00
Wilmar den Ouden
79600f3fee
feat: enabled Github GHCR as proxy cache (#16834)
Signed-off-by: wilmardo <info@wilmardenouden.nl>
2022-06-06 15:36:16 +08:00
Chenyu Zhang
b356d58253
Merge pull request #16861 from chlins/feat/cache-layer-for-manifest
feat(manifest): introduce cache layer for manifest (#16459)
2022-05-27 14:03:42 +08:00
Chenyu Zhang
136767df15
Merge pull request #16892 from chlins/feat/cache-layer-for-project-metadata
feat(project): introduce cache layer for project_metadata (#16891)
2022-05-27 09:30:55 +08:00
Wang Yan
3eb668c0a4
fix replcation issue on accessory (#16912)
The tag/lable filter only works on the subject manifest, and if the subject manifest is mathed, all the accessories are marked as matched.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-27 01:36:38 +08:00
MinerYang
9d8e9158de
fix deadcode lint & update golangci-lint.yaml (#16896)
* fix deadcode lint & update golangci-lint.yaml

Signed-off-by: yminer <yminer@vmmware.com>

mock.go

Signed-off-by: yminer <yminer@vmmware.com>

commentfmt

Signed-off-by: yminer <yminer@vmmware.com>

mock.go update

Signed-off-by: yminer <yminer@vmmware.com>

update makefile

Signed-off-by: yminer <yminer@vmmware.com>

* update /pkg/allowlist/validator.go

Signed-off-by: yminer <yminer@vmmware.com>

Co-authored-by: yminer <yminer@vmmware.com>
2022-05-26 10:32:07 +08:00
Wang Yan
d26b5792c0
fix 16883 (#16911)
Fixes #16883, set the labels belonging to the subject manifest to the accessories on replication.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-26 01:30:53 +08:00
Shijun Sun
a9063d240d
Modify HarborDatetimePipe to pure pipe to improve performance (#16906)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-25 10:43:29 +08:00
Shijun Sun
e33197a487
Remove message prompt clearing (#16894)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-25 10:43:13 +08:00
stonezdj(Daojun Zhang)
4637af8866
Merge pull request #16865 from stonezdj/22may17_purge_audit_log_rest_api
Add REST API for purge audit log
2022-05-25 10:08:47 +08:00
Simon Alling
c4b782bc95
Add date/time format setting in portal (#16796)
* Add date/time format setting in portal

Currently, the format used for rendering dates and times is derived from the language/locale selected by the user. The formats used in the en-US locale ("English" in Harbor's GUI) are ambiguous and hard to understand for many users.

For example, is 10/11/21 the 10th of November, 2021, the 11th of October, 2021, or even something else like the 21nd of November, 2010? Even if one does know how to interpret it in theory, such dates are essentially enciphered and must be mentally deciphered by the user every time, incurring unnecessary cognitive load.

Similarly, many users are used to the 24-hour clock rather than the 12-hour clock (AM/PM), and so on.

This PR adds a dropdown next to the existing language selector that lets the user choose between the default format for the current locale and the internationally standardized, unambiguous ISO 8601 format. For example, when viewing a list of resources, the ISO 8601 option makes points in time display as

> 2021-10-11, 13:37

instead of

> 10/11/21, 1:37 PM

thereby improving the user experience considerably for users not familiar with the US date/time format (or, in general, the default format for the locale they have selected).

The localized versions of the "Default" label are copied from `SCANNER.DEFAULT` in each locale.

Signed-off-by: Simon Alling <alling.simon@gmail.com>

* Fix indentation

Signed-off-by: Simon Alling <alling.simon@gmail.com>

* Remove redundant localStorage existence check

Signed-off-by: Simon Alling <alling.simon@gmail.com>

* Run 'npm run lint -- --fix'
2022-05-24 17:45:34 +08:00