Commit Graph

5535 Commits

Author SHA1 Message Date
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
MinerYang
db45155365
bump up beego from v1.12.7 to v1.12.9 (#16904)
Signed-off-by: yminer <yminer@vmmware.com>

Co-authored-by: yminer <yminer@vmmware.com>
2022-05-24 12:18:48 +08:00
stonezdj
1839965c7a Add REST API for purge audit log
Add rest API for purge audit log
  Extract scheduler, execution, task from GC controller for common use

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-05-23 16:58:31 +08:00
chlins
f16cc4bda4 feat(project): introduce cache layer for project_metadata (#16891)
Implement cache layer for project_metadata and migrate metadata.Mgr to
pkg.ProjectMetaMgr.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-05-23 09:08:39 +08:00
chlins
7eed9db404 feat(manifest): introduce cache layer for manifest (#16459)
Implement cache layer for resource manifest, it will read manifest
from cache instead of proxying to distribution if enabled.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-05-19 10:25:50 +08:00
Shijun Sun
5a4f6c6167
Improve css for accessories component (#16868)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-18 14:58:50 +08:00
Shijun Sun
4f253731f4
Allow all roles to see 'listed in CVE allowlist' column (#16860)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-18 13:50:34 +08:00
Wang Yan
ae83f9a027
fix accessory count issue (#16866)
The count api should ignore the pagination.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-17 15:02:29 +08:00
stonezdj(Daojun Zhang)
2852a7606b
Merge pull request #16833 from stonezdj/22may10_purge_audit_log
(feat) Add job service to purge audit_log
2022-05-17 09:02:56 +08:00
stonezdj
3ac7281177 Add job service to purge audit_log
Add jobservice type PurgeAuditLog

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-05-16 21:52:58 +08:00
Chenyu Zhang
d56a505fa7
Merge pull request #16846 from chlins/feat/cache-layer-for-repo
feat(repository): introduce cache manager for repository (#16741)
2022-05-16 11:39:28 +08:00
Shijun Sun
bb8839b6a3
Upgrade clarity to the latest version (#16840)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-16 10:13:46 +08:00
Shijun Sun
73295ff891
migrate tslint to eslint (#16856)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-13 16:00:45 +08:00
Wang Yan
54a857f2aa
fix artifact count issue (#16851)
The count should filter out the accessory, the result should be consistent with list method.

Fixes #16816

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-13 11:48:20 +08:00
chlins
a82f1ba63d feat(repository): introduce cache manager for repository (#16741)
Implement cache layer for resource repository and migrate repository.Mgr
to pkg.RepositoryMgr.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-05-12 10:14:35 +08:00
Shengwen YU
ee214f0347
Merge pull request #16841 from zyyw/issue-16355-gc-update_time
fix: gc history update_time
2022-05-12 10:12:47 +08:00
Shengwen Yu
d2c4c4f71b fix: gc history update_time
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-05-11 17:17:09 +08:00
chlins
0fd0c84446 feat(project): introduce cache manager for project (#16740)
Implement cached manager for resource project and migrate project.Mgr
to pkg.ProjectMgr.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-05-11 15:52:09 +08:00
Shijun Sun
6ca3665207
Improve css for tags column (#16811)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-10 17:47:09 +08:00
Wang Yan
d3d4ad6a34
fix staticcheck issues (#16828)
Fix the staticcheck problems that reported by golangci-line staticcheck

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-10 16:07:10 +08:00
prahaladdarkin
27ec871185
System Artifact Manager database schema creation, model definitons, and tests (#16678)
Closes:
https://github.com/goharbor/harbor/issues/16540
https://github.com/goharbor/harbor/issues/16541
https://github.com/goharbor/harbor/issues/16542

Signed-off-by: prahaladdarkin <prahaladd@vmware.com>
2022-05-09 17:32:57 +08:00
MinerYang
1f797fafc4
add lint with golangci-lint, remove golint (#16821)
Signed-off-by: yminer <yminer@vmmware.com>

test ut_install.sh

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

test ut_install.sh001

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

test ut_install002

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

use curl binary to download golangcilint instead of go get

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

test ut-ci make lint

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

check ci GO111MODULE

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

test ci go env

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

test ci goenv 002

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

test ci GO111MODULE=auto

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

ci test entire ut_install.sh

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

remove needless debug comment

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

Co-authored-by: yminer <yminer@vmmware.com>
2022-05-09 11:19:02 +08:00
Wang Yan
c333218ba2
fix close response missing (#16820)
It has to close the http response on deleting manifest

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-05-07 13:03:15 +08:00
Shengwen Yu
d0c82db519 fix: improve GC log message
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2022-05-06 15:01:45 +08:00
Shijun Sun
584245ec4d
Improve replication policy datagrid (#16806)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-05-05 17:36:11 +08:00
Simon Alling
16f38bc591
Fix lint errors in portal (#16799)
This PR fixes all lint errors reported by TSLint (`npm run lint` in `src/portal/`).

TSLint also reports multiple warnings (see #16798), but this PR doesn't fix any of them.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2022-05-05 13:48:09 +08:00
Simon Alling
bb007f70bb
Refactor portal language code (#16795)
* Refactor portal language code

This PR makes the following improvements:

  * The language code is DRYed up by defining `supportedLangs` in terms of `LANGUAGES` (previously `languageNames`).

  * The language selection dropdown code is DRYed up similarly.

  * The Angular locale registration code is DRYed up similarly: the omission of a supported language is now a static type error.

The above improvements mean that it's now impossible to forget to include a supported language in any of those contexts.

Furthermore:

  * The type of supported languages is replaced by a more accurate one than `string`, namely `SupportedLanguage`.

  * The value acquired from localStorage will never be used unless it is in fact a supported language. (Today, the GUI breaks pretty badly and errors are spammed in the console if localStorage contains an invalid value.)

  * Redundant implicit existence checks such as `localStorage &&` and `browserCultureLang &&` are removed.

  * The implementation of `initLangauge` is generally simplified and clarified.

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

* Restore accidentally deleted date check

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2022-05-05 13:16:41 +08:00
Shijun Sun
ca019f4030
Upgrade Angular to 13.3.4 (#16772)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-29 16:24:30 +08:00
Shijun Sun
a5da06078f
Store default page size to local storage (#16753)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-29 16:24:07 +08:00
MinerYang
083b44e719
bump up astaxie/beego@v1.12.1 to beego/beego/@v1.12.7 (#16770)
Signed-off-by: yminer <yminer@vmmware.com>

goo mod tidy

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

Co-authored-by: yminer <yminer@vmmware.com>
2022-04-28 11:58:44 +08:00
Chenyu Zhang
bb53493607
Merge pull request #16593 from chlins/feat/cache-layer-for-artifact
feat: add cache layer for artifact
2022-04-26 10:57:50 +08:00
Shijun Sun
23b22c8288
Fix some css style issues (#16709)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-26 09:22:55 +08:00
Shijun Sun
bef9f5f5f1
Provide more useful error info when editing a problematic replication rule (#16736)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-26 09:21:46 +08:00
chlins
8c223135e7 feat: add cache layer for artifact (#16739)
Implement cache layer for resource artifact and define common
cache manager and workflow. Also add cache related options to
configuration yaml.

Signed-off-by: chlins <chenyuzh@vmware.com>
2022-04-25 18:01:45 +08:00
Lars Lehtonen
ef835e107a
pkg/scan: fix dropped error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2022-04-18 10:34:27 -07:00
Chenyu Zhang
7df0c3906d
Merge pull request #16510 from chlins/fix/check-before-update-tag-pulltime
fix: check the existence of the tag before updating pull time
2022-04-18 17:10:15 +08:00
Chenyu Zhang
85d12f6557
Merge pull request #16608 from alrs/blob-err
fix: controller/blob: dropped test error
2022-04-18 17:09:40 +08:00
Shijun Sun
40191e0bcd
Add dotted line between the artifacts and their accessories (#16701)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-18 11:08:43 +08:00
Shijun Sun
02ea4be0de
Update docker building for UI (#16692)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-18 11:07:00 +08:00
Shijun Sun
1cc0c44040
Clear some UI building warnings (#16684)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-12 20:35:52 +08:00
Shijun Sun
185d38cf49
Improve user setting component (#16665)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-07 15:45:00 +08:00
Wang Yan
bb6693b496
skip policy check on pull cosign signature (#16658)
When user enables the cosign policy and triggers the replication, the harbor adapter will try to  pull the cosign siguature if it has to do the further push.
In this case, it has to skip policy check.

Signed-off-by: wang yan <wangyan@vmware.com>
2022-04-07 09:59:26 +08:00
Shijun Sun
df54e1e13c
Improve copy-artifact component (#16628)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-04-06 10:51:06 +08:00
Shijun Sun
a5b5e21ec9
Use list user groups API to search groups (#16610)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-30 19:46:29 +08:00
stonezdj
97a64d551d Update usergroups API to support search by group_name
Add group_name parameter to GET usergroups API
  Related to issue #16408
  UI should also switch from search api to usergroups list api

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-03-30 10:59:56 +08:00
Lars Lehtonen
3fcefc8bda
controller/blob: fix dropped test error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2022-03-29 10:34:03 -07:00
chlins
4af3725cc2 fix: return BAD_REQUEST when validate project metadata public value error
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-03-29 14:57:21 +08:00
stonezdj(Daojun Zhang)
1449988353
Delete unused files and functions (#16599)
testing/apitest/apilib is not used after harbor 2.4 refactor
 no testcase removed

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-03-29 14:19:36 +08:00
chlins
7f75a20bdb fix: validate project metadata public value
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-03-28 15:06:27 +08:00
Shijun Sun
a0fcb91492
Remove state restrictions for gc log button (#16585)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-25 19:45:29 +08:00
Shijun Sun
29eaaf1b53
Upgrade UI dependencies (#16586)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-25 19:45:12 +08:00
chlins
dbb8859ad8 feat: implement beego session provider
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-03-24 10:33:21 +08:00
bmfp
7bee632406
update french translation (#16570)
Signed-off-by: molinber <bertrand.molin@credit-agricole.net>

Co-authored-by: molinber <bertrand.molin@credit-agricole.net>
2022-03-23 11:31:08 +08:00