Commit Graph

5380 Commits

Author SHA1 Message Date
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
Wang Yan
7531168c92
update log with more inclusive language (#16569)
Use the deactive for instead in the error log

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-03-23 10:56:00 +08:00
孙世军
f37f93b735
Add secret to download file when refreshing robot secret (#16564)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-22 17:21:46 +08:00
孙世军
33da8e2bcc
Improve UI with more inclusive words (#16548)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-22 17:21:10 +08:00
Chenyu Zhang
84523a2da5
Merge pull request #16494 from alrs/q-err
lib/q: fix dropped test error
2022-03-21 17:01:29 +08:00
孙世军
c898a411d1
Update push and pull command for helm (#16552)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-18 19:41:59 +08:00
Wang Yan
ed1f4ab6fb
enhance health validataion (#16549)
Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-03-18 18:36:50 +08:00
孙世军
c54f51d4d8
Add cosign icon (#16531)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-17 14:36:05 +08:00
Wang Yan
7cb5c34f7e
add cosign signature icon (#16533)
Return icon message for UI to render

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-03-17 11:08:39 +08:00
孙世军
4cec345a45
Fix duplicate labels issue (#16527)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-16 16:07:29 +08:00
Chenyu Zhang
846dc94398
Merge pull request #16492 from chlins/refactor/replace-core-redis-lib
refactor: import go-redis to core as replacement of redigo
2022-03-15 21:43:38 +08:00
chlins
5be0b93caa refactor: import go-redis to core as replacement of redigo
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-03-15 20:44:44 +08:00
sluetze
7dc25cc6dd
Updated translation for 2.5 (#16509)
Signed-off-by: sluetze <13255307+sluetze@users.noreply.github.com>
2022-03-15 09:33:54 +08:00
Wang Yan
ef991ae0c0
add transaction for artifact delete (#16506)
Add transaction for artifact deletion, given API has the transaction when to call artifact controller but other object may not, for example jobservice job.
Here, force add the tx to ensure all the things can be rolled back.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-03-11 14:40:55 +08:00
chlins
4f2cd939ee fix: check the existence of the tag before updating pull time
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-03-11 09:40:53 +08:00
孙世军
38babc1c71
Improve style and correct typos (#16498)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-10 14:23:15 +08:00
孙世军
d05eb5ef4a
Add a new robot permission and sort permissions (#16487)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-10 10:16:42 +08:00
Lars Lehtonen
d3f7ddfe3a
lib/q: fix dropped test error
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2022-03-09 10:03:48 -08:00
MinerYang
2260475d55
bump up github.com/containerd/containerd to v1.5.10 (#16469)
Co-authored-by: yminer <yminer@vmmware.com>
2022-03-04 14:12:47 +08:00
疯魔慕薇
1c4495361b
Fix & UT (#16279)
1. Fix TCR Adapter namespcae check.
2. Add Chart UT.

Signed-off-by: 疯魔慕薇 <kfanjian@gmail.com>
2022-03-04 14:09:25 +08:00
孙世军
3c9fc9fa5a
Fix inline alert issue (#16454)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-04 10:50:33 +08:00
MinerYang
4a9107af93
replace with github.com/distribution/distribution v2.8.0+incompatible (#16460)
Signed-off-by: yminer <yminer@vmmware.com>

Co-authored-by: yminer <yminer@vmmware.com>
2022-03-03 16:35:02 +08:00
stonezdj(Daojun Zhang)
1971e5a3ef
Merge pull request #16462 from stonezdj/22mar3_withnotary_jobservice
The DB config manager is not init on jobservice call config.WithNotary
2022-03-03 16:04:11 +08:00
stonezdj
5618f6d211 The DB config manager is not init on jobservice to call config.WithNotary
Make func defaultMgr() public
  Set DefaultCfgManager to RestCfgManager and Load it in the jobservice main
  config.WithNotary call DefaultMgr(), it wil get the RestCfgManager
  Fixes #16418

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-03-03 14:42:56 +08:00
孙世军
75bc82e5f3
Fix ui issues found on testing day (#16444)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-03 10:06:28 +08:00
孙世军
eca5f48adb
Upgrade swagger-ui to the latest version (#16443)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-03-02 14:47:36 +08:00
stonezdj(Daojun Zhang)
8c698325b5
Merge pull request #16424 from stonezdj/22feb24_trace_failure
Add IP and agent in trace for failed login
2022-03-02 11:46:32 +08:00
MinerYang
848efd067d
bump up github.com/docker/distribution to v2.8.0+incompatible (#16435)
Signed-off-by: yminer <yminer@vmmware.com>

rgoo mod vendor

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

Co-authored-by: yminer <yminer@vmmware.com>
2022-03-01 17:29:02 +08:00
stonezdj
7aed95eda9 Add IP and agent in trace for failed login
Fixes #16423

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-02-28 15:17:55 +08:00
He Weiwei
abd85284d2
feat: merge local and remote tags for repo of proxy cache project in list API (#16394)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2022-02-24 10:27:45 +08:00
Wang Yan
6ef4874011
fix replicate reference accessory (#16401)
fixes #16375

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-02-23 21:24:15 +08:00
Chenyu Zhang
490fe4e5b3
fix: ignore untagged artifact when perform immutable policy (#16386)
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-02-22 15:18:29 +08:00
Wang Yan
8d05007eb5
fix accessory copy for index (#16378)
When issue an copy, it has to copy the reference's accessory as well

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-02-17 12:43:09 +08:00
Chenyu Zhang
1e211db540
Merge pull request #16374 from chlins/fix/codeql-alerts-2
fix: trim linebreaks for log parameters
2022-02-17 09:56:46 +08:00
Chenyu Zhang
9d1e788f8f
Merge pull request #16352 from chlins/fix/exporter-cmd-typo
fix: correct typo in exporter cmd
2022-02-17 09:43:27 +08:00
chlins
3d7a5064e9 fix: trim linebreaks for log parameters
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-02-16 10:52:58 +08:00
孙世军
fd92efe140
Upgrade karma and angular devkit (#16366)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-02-15 20:24:29 +08:00
Chenyu Zhang
7d10dac4bc
Merge pull request #16359 from chlins/fix/codeql-alerts
fix: fix codeql alerts
2022-02-15 18:54:16 +08:00
chlins
b37a987073 fix: fix codeql alerts
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-02-15 17:25:02 +08:00
stonezdj(Daojun Zhang)
79edbf8f82
Merge pull request #16272 from stonezdj/22jan24_improve_upgrade_process
Improve the migrate process
2022-02-14 16:35:35 +08:00
stonezdj
478d21687b Improve the migrate process
In order to separate the migrate process from core process, add parameter -mode for main function, it can be normal, migrate, skip_migrate.
Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-02-14 13:15:18 +08:00
chlins
d2124ce469 fix: correct typo in exporter cmd
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-02-11 15:28:02 +08:00
stonezdj(Daojun Zhang)
02e13390e0
Remove noise in log (#16333)
DB Config Manager could be registered twice if need to enable cache
  Get trace config only when the trace is enabled

Signed-off-by: stonezdj <stonezdj@gmail.com>
2022-02-10 15:42:45 +08:00
Chenyu Zhang
4ef2d65451
Merge pull request #16286 from chlins/fix/skip-replication-for-proxy-cache
fix: skip replication to proxy cache project
2022-02-07 17:06:03 +08:00
Wang Yan
93c0e572a0
fix 16224 (#16307)
fixes #16224, deny the request to scan an accessory.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-30 03:03:39 +08:00
Wang Yan
cda127c27e
bump up containerd to 1.5.9 (#16316)
Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-29 18:00:23 +08:00
孙世军
1cbdeb0b64
Improve UI style (#16314)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-01-29 14:16:46 +08:00
孙世军
88fd4feef5
Add list tag permission for robot account (#16311)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-01-28 14:22:37 +08:00
孙世军
45d9ece105
Modify CVSS3 column for cve datagrid (#16298)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-01-28 11:46:28 +08:00
Wang Yan
2275c6e969
fix accessory lost tags (#16304)
It needs to copy tags for the accessories.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-28 10:44:29 +08:00
孙世军
241391984b
Add delete repo permission for robot account (#16297)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-01-27 13:04:18 +08:00
He Weiwei
8554b7d7c5
refactor: replace lib/pq with jackc/pgx (#16267)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2022-01-27 11:09:37 +08:00
Wang Yan
0a183feab6
add cosign support in replication (#16282)
For the case Harbor-to-Harbor, the accessory can be replicated from source or to target.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2022-01-26 21:35:17 +08:00
chlins
b1afd2efb0 fix: skip replication to proxy cache project
Signed-off-by: chlins <chenyuzh@vmware.com>
2022-01-26 17:24:39 +08:00
孙世军
c9af6c0c35
Improve tooltips for LDAP group config (#16280)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2022-01-25 15:43:21 +08:00
Daniel Jiang
60189f2cef
Merge pull request #16181 from JoooostB/16180-oidc-auto-onboard
Store Username in auto-onboard flow (resolves #16180)
2022-01-25 11:00:38 +08:00