Commit Graph

4640 Commits

Author SHA1 Message Date
Wang Yan
8e61a3ea31 add robot account 2 api handler
Signed-off-by: Wang Yan <wangyan@vmware.com>
2020-11-26 11:10:05 +08:00
stonezdj(Daojun Zhang)
90c5505430
Merge pull request #13591 from heww/fix-issue-13387
fix(quota): ignore the fail when getting reference of quota
2020-11-25 15:09:22 +08:00
He Weiwei
eb38180483 fix(quota): ignore the fail when getting reference of quota
1. Clean the dirty data in quota/quota_usage.
2. Ignore the fail when getting the reference of quota.

Closes #13387

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-11-24 14:50:38 +00:00
Will Sun
039722c518
Merge pull request #13585 from AllForNothing/proxy
Add new supported registries for proxy cache on UI
2020-11-24 16:45:07 +08:00
Will Sun
fc4a6fdd7b
Merge pull request #13496 from AllForNothing/rep-cron
Improve adding replication rule page
2020-11-24 16:16:37 +08:00
AllForNothing
69b5722cef Add new supported registries for proxy cache on UI
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-11-24 15:56:18 +08:00
Wenkai Yin(尹文开)
fe8b628f0c
Merge pull request #13437 from ywk253100/200929_replication
Refactor the replication execution
2020-11-24 10:38:22 +08:00
Steven Zou
35a0fc7afd
Merge pull request #13330 from chlins/fix/scanner-apikey-authorization
fix: fix scanner apikey type match error
2020-11-23 17:06:35 +08:00
Wenkai Yin
294385c34d Refactor the replication execution
1. Use the task manager to manage the underlying execution/task
2. Use the pkg/scheduler to schedule the periodical job
3. Apply the new program model
4. Migration the old data into the new data model

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-11-23 14:24:10 +08:00
Daniel Jiang
3536a5dfac
Merge pull request #13452 from ninjadq/fix_status_code_issue_on_metrics
Fix status code in metrics issue
2020-11-23 10:37:47 +08:00
Daniel Jiang
00c941a413
Merge pull request #13557 from heww/fix-issue-13556
fix: remove auto re-readable body in BeforeRequest
2020-11-23 01:08:52 +08:00
He Weiwei
f733f95300 fix: remove auto re-readable body in BeforeRequest
Remove nop close body in the BeforeRequest helper function.
Middleware must make the request body re-readable itself when it wants
read the body in the middleware.

Closes #13556

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-11-20 01:41:12 +00:00
Wang Yan
04c4354df9
add robot account version 2 controller (#13472)
the controller is for the enhanced robot account

Signed-off-by: Wang Yan <wangyan@vmware.com>
2020-11-19 15:39:45 +08:00
Wenkai Yin(尹文开)
def782b6f8
Don't escape the name when doing the exact matching for tag (#13533)
Don't escape the name when doing the exact matching for tag
Fixes #13106

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-11-18 14:34:48 +08:00
DQ
a6edf51574 Fix status code in metrics issue
Stauts code can't get from request. It shoud be recorded by a delegator

Signed-off-by: DQ <dengq@vmware.com>
2020-11-17 19:53:06 +08:00
stonezdj(Daojun Zhang)
fb549b2d9e
Merge pull request #13444 from wy65701436/robot2-self-mgr
add robot mgr
2020-11-16 11:33:33 +08:00
Christian Baumann
4530e9feee Fix api ldap group search by name
Signed-off-by: Christian Baumann <thechristschn@gmail.com>
2020-11-12 23:01:02 +00:00
sshijun
3d526e220c Improve adding replication rule page
Signed-off-by: sshijun <sshijun@vmware.com>
2020-11-12 18:17:26 +08:00
He Weiwei
76f1afbe0d
refactor: remove core/promgr pkg (#13408)
* refactor: remove core/promgr pkg

Remove `core/promgr` package and use `controller/project` instead of it.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-11-12 15:33:13 +08:00
Wang Yan
3550b5e5e9 add robot mgr
the robot account manager to handle the CRUD

Signed-off-by: wang yan <wangyan@vmware.com>
2020-11-11 13:47:03 +08:00
stonezdj(Daojun Zhang)
ca8cb87790
Merge pull request #13439 from wy65701436/robot2-mgr
add role permission manager for robot enhancement
2020-11-11 10:35:10 +08:00
Will Sun
d32527dfd7
Merge pull request #13470 from AllForNothing/tooltp
Fix tooltip bug for adding replication rule page
2020-11-10 20:43:12 +08:00
Wang Yan
9723655378 update code per review comments
1, rename table name to permission_policy
2, rename functions name

Signed-off-by: Wang Yan <wangyan@vmware.com>
2020-11-10 18:11:31 +08:00
Wang Yan
ec15e320bf add role permission manager for robot enhancement
1, add two db tables of role permission and rbac policy
2, add manager of these two tables

Signed-off-by: Wang Yan <wangyan@vmware.com>
2020-11-10 16:49:29 +08:00
He Weiwei
ebc3443da9
Merge pull request #13474 from heww/fix-issue-11892
fix: compute artifact size from db for schema1 manifest
2020-11-10 16:20:39 +08:00
sshijun
bf99f6d5cd Fix tooltip bug for adding replication rule page
Signed-off-by: sshijun <sshijun@vmware.com>
2020-11-10 10:29:08 +08:00
Wenkai Yin
69ddb9c2a8 Downgrade the version of github.com/prometheus/client_golang to 1.7.1 to avoid the compile error in mac
The version 1.8.0 of "github.com/prometheus/client_golang" bumps up lib "golang.org/x/sys" which referenced by "github.com/docker/docker@1.4.2". The changes of "golang.org/x/sys" causes the compile error in mac

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-11-10 08:49:03 +08:00
He Weiwei
9c8377909b fix: compute artifact size from db for schema1 manifest
Closes #11892

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-11-09 12:32:07 +00:00
Will Sun
039733b200
Merge pull request #13435 from AllForNothing/robot-prefix
[UI]add robot name prefix
2020-11-05 10:36:53 +08:00
He Weiwei
955431257c
Merge pull request #13422 from heww/disable-db-acess-for-ping
feat: skip middlewares require db for ping
2020-11-05 08:19:49 +08:00
stonezdj(Daojun Zhang)
7c1ad11763
Merge pull request #13425 from wy65701436/robot-prefix
add robot name prefix
2020-11-04 11:48:42 +08:00
Steven Zou
af7000d277
Merge pull request #13417 from bitsf/fix_gitlab_replication_task_num
fix(replication) gitlab replication task num not correct
2020-11-04 11:33:57 +08:00
Will Sun
c42ffe0915
Merge pull request #13410 from AllForNothing/helm-hub
Add deprecated mark to Helm Hub
2020-11-04 11:03:45 +08:00
Wang Yan
62208dc3e4 fix code conflict
Signed-off-by: Wang Yan <wangyan@vmware.com>
2020-11-03 09:42:37 -08:00
AllForNothing
ca93eb2218 Add robot name prefix to system setting UI
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-11-03 16:34:36 +08:00
Will Sun
e0617be15d
Merge pull request #13419 from AllForNothing/improve-ui
Improve UI according to the designer's commonts
2020-11-03 16:11:33 +08:00
Wang Yan
5a22019e3d add robot name prefix
The system admin can set the prefix in configuration UI.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-11-02 23:12:57 -08:00
AllForNothing
6452d38925 Add deprecated mark to Helm Hub
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-11-03 15:04:15 +08:00
DQ
ae80aa796e Upgrade Prometheus Client Version
upgrade to v1.8.0

Signed-off-by: DQ <dengq@vmware.com>
2020-11-03 14:33:11 +08:00
DQ
eb470501be Add metrics to Harbor Core
1. Add configs in prepare
 2. Add models and config items in Core
 3. Encapdulate getting metric in commom package
 4. Add a middleware for global request to collect 3 metrics

Signed-off-by: DQ <dengq@vmware.com>
2020-11-03 14:33:10 +08:00
Ziming Zhang
8c2c758677 fix(replication) gitlab replication task num not correct
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2020-11-03 10:55:46 +08:00
Wenkai Yin(尹文开)
99d818f4db
Merge pull request #13406 from mmpei/offical-replicate-chart-fix-20201031
fix chart replication issue of uppercase letters
2020-11-03 10:55:40 +08:00
He Weiwei
0c5aedb3d9 feat: skip middlewares require db for ping
The ping endpoint will be blocked when DB conns reach the max open conns
of the sql.DB which will make ping request timeout,
so skip the middlewares which will require DB conn.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-11-03 01:58:59 +00:00
AllForNothing
58450c335f Improve UI according to the designer's commonts
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-11-02 17:17:35 +08:00
Wenkai Yin(尹文开)
dd3ffd4147
Merge pull request #13361 from bitsf/aws_adapter_namespace_check
feature(replication) check namespace existing first for AWS adapter
2020-11-02 16:56:50 +08:00
Will Sun
9a38dca1a6
Merge pull request #13401 from AllForNothing/label-selection
Improve label selection for artifact list page
2020-11-02 13:44:28 +08:00
peimingming
6394cc767e fix chart replication issue of uppercase letters
Signed-off-by: peimingming <peimingming@corp.netease.com>
2020-11-01 00:29:46 +08:00
疯魔慕薇
2bab4a10db
Merge pull request #13393 from chlins/fix/p2p-preheat-instance-and-policy-post-no-location
fix(preheat): add location when create instance and policy
2020-10-31 23:48:41 +08:00
AllForNothing
120e8dd3d1 Improve label selection for artifact list page
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-30 14:43:59 +08:00
Will Sun
a255f3e74d
Merge pull request #13376 from AllForNothing/p2p-css
Fix a bug for editing p2p instance
2020-10-29 19:57:51 +08:00
Will Sun
8fda6bbb83
Merge pull request #13386 from AllForNothing/align
Fix css bug for adding p2p policy
2020-10-29 19:57:14 +08:00
Greg
d1ee94bbc9
DTR replication support (#9512)
Adding DTR replication support

Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
2020-10-29 18:54:44 +08:00
chlins
9887154a0a fix(preheat): add location when create instance and policy
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-10-29 18:16:59 +08:00
AllForNothing
1417be1ffc Fix css bug for adding p2p policy
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-29 09:25:35 +08:00
AllForNothing
cc1eb1de86 Fix a bug for editing p2p instance
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-29 09:14:14 +08:00
Will Sun
fc65f5bf69
Merge pull request #13375 from AllForNothing/rep-filter
Fix filter bug for replication rule list
2020-10-29 09:10:31 +08:00
Daniel Jiang
535728d11f
Merge pull request #13306 from heww/refactor-security-context
refactor(security): use controller instead of promgr in security
2020-10-29 02:39:59 +08:00
Flávio Ramalho
ef6414be3e
Fix deadlock on harbor-core initialization
During the harbor core initialization if the database takes longer to
be ready there is a risk of deadlock when checking for the TCP connection
with the database.

The `TestTCPConn` function uses unbuffered channels to check when the
connection succeeds/timeouts. The timeout check is executed in parallel
with the connection check (this runs in a gorountine). The deadlock happens
when the goroutine execution takes longer than the function timeout
(hence setting `cancel <- 1`) and the DialTimeout call succeeds (hence
setting `success <- 1`). At this point both threads are waiting for the
channels values to be read.

This is reproducible mostly on slow systems where initializing the
database takes longer and finishes during the 5th time of the
`DialTimeout` call where it eventually exceeds the TestTCPConn timeout.

This fix sets the `success` and `cancel` channels as buffered
(non-blocking).

Signed-off-by: Flávio Ramalho <framalho@suse.com>
2020-10-28 17:09:34 +01:00
AllForNothing
53dc8f0bcf Fix filter bug for replication rule list
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-28 12:29:33 +08:00
Will Sun
ec790d0afd
Merge pull request #13347 from AllForNothing/vul-list
Improve vilnerability list UI
2020-10-28 10:24:18 +08:00
Ziming Zhang
a7d906649c feature(replication) check namespace existing first for AWS adapter
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2020-10-26 16:40:13 +08:00
AllForNothing
5475738a28 Fix css and i18n bugs
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-26 16:09:13 +08:00
AllForNothing
64ddef2e1d Improve vilnerability list UI
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-23 15:03:33 +08:00
Daniel Jiang
9c1da3a405 Add more info in log message to help debug
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-10-22 18:55:01 +08:00
Daniel Jiang
eadb65f988
Merge pull request #13312 from reasonerjt/oidc-admin-group
Add admin group support to OIDC auth mode
2020-10-22 18:30:10 +08:00
Daniel Jiang
649c9814e4 Address review comment by Yan
Resolve review comment in PR #13312

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-10-22 16:53:37 +08:00
AllForNothing
ea494af06e Fix a css bug of Clarity page size selection
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-22 16:48:35 +08:00
chlins
21b56d241a fix: fix scanner apikey type match error
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-10-21 18:29:19 +08:00
danfengliu
8af343f27a
Merge pull request #13324 from ywk253100/201021_project_cherry_pick
Return the location header when creating proxy cache project
2020-10-21 17:07:15 +08:00
Wenkai Yin(尹文开)
84971fc77d
Merge pull request #13316 from stonezdj/201020_dup_group_filter
Remove dup call to createGroupSearchFilter in searchGroup
2020-10-21 14:53:45 +08:00
Wenkai Yin
3021558272 Return the location header when creating proxy cache project
Fixes #13303. Return the location header when creating proxy cache project

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-10-21 14:35:48 +08:00
Will Sun
1e421748bc
Merge pull request #13302 from AllForNothing/rep-rule
Add page size options to datagrid
2020-10-21 11:14:44 +08:00
Daniel Jiang
7c57e984a8
Merge pull request #13313 from AllForNothing/oidc
[UI]Add admin group support to OIDC auth mode
2020-10-21 11:10:28 +08:00
stonezdj
ca7258617b Remove dup call to createGroupSearchFilter in searchGroup
Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-10-20 19:07:33 +08:00
AllForNothing
e7c53dc28a Add oidc admin group to oidc setting ui
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-20 17:47:00 +08:00
Daniel Jiang
f4ff369ed0 Add admin group support to OIDC auth mode
Add oidc_admin_group to configuration, and make sure a token with the
group name in group claim has the admin authority.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-10-20 15:38:58 +08:00
chlins
73981062a9 fix: fix quay adapter catalog api return error
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-10-20 14:24:25 +08:00
AllForNothing
7b32fdb9f9 Add page size options to datagrid
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-19 18:42:19 +08:00
He Weiwei
ea0fbbeace refactor(security): use controller instead of promgr in security
Use `project.Controller` instead of `promgr.ProjectManager` in security
implementations because we will remove `promgr` package later.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-10-19 10:33:51 +00:00
Will Sun
69b6bfd50a
Merge pull request #13239 from AllForNothing/unlogged
Allow un-logged users to visit public repos
2020-10-19 11:22:43 +08:00
stonezdj(Daojun Zhang)
88005e5028
Merge pull request #13267 from stonezdj/201014_no_default_group_filter
Refine ldap searchGroup function
2020-10-19 09:58:04 +08:00
stonezdj(Daojun Zhang)
8156f74bf4
Merge pull request #13266 from stonezdj/201009_proxy_head_containerd
Add middleware to proxy HEAD request for proxy cache project
2020-10-16 20:26:01 +08:00
AllForNothing
59fe9830b5 Allow un-logged users to visit public repos
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-10-16 17:21:36 +08:00
Wenkai Yin(尹文开)
c491c4f513
Merge pull request #13257 from reasonerjt/jwt-refact
Use pkg/token to generate JWT token
2020-10-16 16:31:26 +08:00
stonezdj
20ef7d3219 Refine LDAP searchGroup function
Search LDAP group with groupDN+filter, then match baseDN
Create a default filter when ldap group filter is empty
Fixes #13156

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-10-16 16:20:41 +08:00
stonezdj
0641b300f3 Add middleware to proxy HEAD request for proxy cache project
Fixes: #13153, containerd need to head manifest before pull image
Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-10-16 13:02:32 +08:00
Daniel Jiang
fb687aeef8 Use pkg/token to generate JWT token
This commit refactors the approach to encode a token in handler of /service/token,
by reusing pkg/token to avoid inconsistency.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-10-15 16:16:44 +08:00
stonezdj(Daojun Zhang)
cdd0eee2d4
Merge pull request #13162 from stonezdj/200921_rating_limit
Change the condition of LocalManifest
2020-10-14 19:34:38 +08:00
stonezdj
ee4b16ccdb Change the condition of LocalManifest
Compare the local digest and the remote digest when pull by tag
Use HEAD request (ManifestExist) instead of GET request (GetManifest) to avoid been throttled
For manifest list, it can avoid GET request because cached manifest list maybe different with the original manifest list
Make RemoteInterface public
Fixes #13112

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-10-14 15:15:48 +08:00
stonezdj
9264105934 Add pull time for proxy cache artifact in first pull
Fixes #13152

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-10-14 13:35:42 +08:00
Daniel Jiang
c93858cdbc
Remove UT for helm hub adapter (#13255)
The helm hub adapter will not work due to the shift to artifact hub and
the API has changed. more details see #13244
Remove the UT for helm hub adapter to unblock CI.
Later we need to rework the adapter to replicate from artifact hub.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-10-14 10:22:03 +08:00
Wenkai Yin(尹文开)
4d78fd4e4e
Merge pull request #13126 from Thoro/fix-10913-oidc-error-after-restart
fix #10913: initialize oidc provider before calling Load
2020-10-14 10:13:52 +08:00
Thomas Rosenstein
874b0b1c0c fix #10913: initialize provider before calling Load
Signed-off-by: Thomas Rosenstein <thomas.rosenstein@creamfinance.com>
2020-09-30 17:25:29 +02:00
stonezdj(Daojun Zhang)
5293c8ff4b
Merge pull request #13053 from reasonerjt/fix-ldap-admingroup
Revert "Store User ID in session instead of the whole user model (#12…
2020-09-30 20:18:30 +08:00
AllForNothing
e999a15b02 Handle 504 error from backend
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-09-28 18:09:05 +08:00
AllForNothing
8d9a18b539 Update UI package to latest version
Signed-off-by: AllForNothing <sshijun@vmware.com>
2020-09-25 09:46:05 +08:00
Will Sun
18f41bad88
Merge pull request #13085 from AllForNothing/replication
Add disable/enable function to replication rules
2020-09-24 17:35:51 +08:00
Wenkai Yin(尹文开)
8b9727f53f
Support store the cron type in the schedule (#13097)
There is requirement that show the cron type(daily, weekly, etc.) on the UI, this commit adds the support for storing the cron type in the schedule model

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-09-24 16:48:56 +08:00
Wang Yan
1af4c5e7cb
bump up go-digest version (#12992)
Signed-off-by: wang yan <wangyan@vmware.com>
2020-09-24 16:47:29 +08:00
Wenkai Yin(尹文开)
a62f05893f
Merge pull request #13129 from ywk253100/200917_task_mgr
Tiny improvement for the task manager
2020-09-24 16:46:44 +08:00