Commit Graph

276 Commits

Author SHA1 Message Date
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
Daniel Jiang
df106cf243 Revert "Store User ID in session instead of the whole user model (#12984)"
This reverts commit 6fc0c9d75a.

Because this erases the AdminRoleInAuth attribute in user model as it is
not stored in DB and it will break the admin group of LDAP.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-09-15 10:05:31 +08:00
Daniel Jiang
513c48d47c
Merge pull request #12936 from wy65701436/fix-swagger-dep
remove the dependency on swagger models
2020-09-08 18:14:42 +08:00
He Weiwei
6d50988c8b fix(project): change to use user id to query projects of member
We know the user id when query projects by member, so use the user id
as entity_id directly in project_member, no need to join harbor_user
table.

Closes #12968

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-09-07 06:35:26 +00:00
Daniel Jiang
6fc0c9d75a
Store User ID in session instead of the whole user model (#12984)
This commit makes a change so that the user id will be stored in sessoin
after user login instead of user model to avoid data inconsistency when
user model changes.

Fixes #12934

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-09-07 11:43:37 +08:00
stonezdj(Daojun Zhang)
4267570e99
Merge pull request #12960 from heww/ignore-enable-content-trust-for-proxy-cache
feat(project): ignore enable_content_trust for proxy project
2020-09-07 11:25:53 +08:00
Daniel Jiang
2f7c8c2abd Check the tag in isArtifactSigned func
This commit ensures that when CLI is pulling a tag, the content trust middleware check the data in notary to ensure the particular tag is signed, not only the digest.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-09-05 17:00:55 +08:00
Chlins Zhang
0465ad733f
Merge pull request #12916 from chlins/fix/project-deletion-needs-delete-preheat-policy
fix(p2p): delete all preheat policies before delete project
2020-09-03 17:32:20 +08:00
Daniel Jiang
66c3fa9eec
Return basic auth challenge for /v2/_catalog (#12956)
Fixes #12192

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-09-03 11:31:57 +08:00
He Weiwei
41c839af88 feat(project): ignore enable_content_trust for proxy project
Ignore enable_content_trust metadata for proxy cache project, see
https://github.com/goharbor/harbor/issues/12940 to get more info

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-09-02 15:24:45 +00:00
chlins
e01de8b201 fix(p2p): delete all preheat policies before delete project
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-09-02 16:39:51 +08:00
wang yan
116d295462 remove the dependency on swagger models
1, remove the pkg dependency on v2.0/server/models
2, remove the controller dependency on v2.0/server/models

Signed-off-by: wang yan <wangyan@vmware.com>
2020-09-01 17:43:44 +08:00
Wenkai Yin(尹文开)
560eba7bd1
Merge pull request #12894 from stonezdj/200827_dockerhub_offline
Fallback to local repo on errors when proxy to remote repo
2020-08-28 15:14:21 +08:00
stonezdj
6967d73476 Fallback to local repo on errors when proxy to remote repo
When the remote repo is offline or network issue or credential issue, fall back to local repo.
 Fixes #12853

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-08-27 22:10:54 +08:00
He Weiwei
793c5ca57b refactor(event): change default operator to username of security
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-26 05:52:02 +00:00
He Weiwei
356be80f56 fix(quota): change log to debug level when warning not found
Closes #12861

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-24 07:55:46 +00:00
Daniel Jiang
05afb94b9b Store csrf token in the header of response instead of cookie
The current approach will prevent the effectiveness of `Cache-Control`
header and gorilla's library add `Vary:Cookie` header in all responses.

We will set the token in a header of response so the response can be
cached when needed.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-08-20 15:46:02 +08:00
Wenkai Yin(尹文开)
d4f18139ef
Merge pull request #12618 from ywk253100/200729_tk_mgr
Refresh the status of execution for every status changing of task
2020-08-20 14:38:09 +08:00
Steven Zou
c1b6be6ac9
Merge pull request #12801 from heww/fix-issue-9471
refactor(scan): remove duplicate CVESet types
2020-08-19 10:37:10 +08:00
stonezdj(Daojun Zhang)
f7e1d186e0
Merge pull request #12792 from ywk253100/200814_proxy_cache
Return 403 when trying to push artifacts into the proxy cache project…
2020-08-18 16:22:51 +08:00
stonezdj(Daojun Zhang)
716625a769
Merge pull request #12793 from ywk253100/200816_disable_tag
Disable the tag creation for the artifact under a proxy cache project
2020-08-18 16:15:33 +08:00
He Weiwei
ef37bd1afb refactor(scan): remove duplicate CVESet types
Closes #9471

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-18 06:33:17 +00:00
Wang Yan
da52e677e5
remove robot accounts when to delete a project (#12789)
The robots associate with the project should be removed after the project is deleted.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-08-18 10:38:45 +08:00
He Weiwei
16d1613b10
Merge pull request #12786 from heww/fix-artifact-scan-permission
fix(scan): fix the permission checking for artifact scanning
2020-08-17 18:30:18 +08:00
He Weiwei
f659523f50 fix(scan): fix the permission checking for artifact scanning
Closes #12778

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-17 09:55:38 +00:00
Wenkai Yin
0fd230c2d6 Refresh the status of execution for every status changing of task
Refresh the status of execution for every status changing of task to support filtering executions by status directly

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-08-17 17:38:55 +08:00
chlins
4f95c4d067 fix(preheat): fix the swagger definition of preheat get log api
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-17 12:41:02 +08:00
Wenkai Yin
e9ce631aa3 Disable the tag creation for the artifact under a proxy cache project
Disable the tag creation for the artifact under a proxy cache project
Fixes #12713

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-08-16 22:02:30 +08:00
Wenkai Yin
a73742c0a7 Return 403 when trying to push artifacts into the proxy cache project to avoid the retrying in the docker client
Return 403 when trying to push artifacts into the proxy cache project to avoid the retrying in the docker client
fixes #12731

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-08-16 21:22:22 +08:00
He Weiwei
f309896f2f refactor(api): generate project apis by go-swagger
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-08-15 16:10:57 +00:00
Wenkai Yin
b1ddb5e2cc Implement the icon API to get the icon of artifact
Implement the icon API to get the icon of artifact

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2020-08-15 08:40:38 +08:00
stonezdj
ff937e90d3 Use orm.Context instead request context in background go routing
Fixes #12741,
Avoid use ctx info in event handler because it is background go routine

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-08-14 15:25:06 +08:00
Chlins Zhang
ad158964bb
Merge pull request #12690 from chlins/fix/preheat-disable-instance-precheck
fix(preheat): add precheck before disable instance
2020-08-10 17:36:29 +08:00
stonezdj
aa8b3a1343 Fix #12487: Proxy cache create duplicated operation log
Change method UseLocalManifest to avoid pull manifest frequently

Signed-off-by: stonezdj <stonezdj@gmail.com>
2020-08-10 16:27:59 +08:00
chlins
3340086af5 fix(preheat): add precheck before disable instance
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-10 15:35:44 +08:00
chlins
5c433c0875 fix(preheat): add precheck when delete instance
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-07 14:06:35 +08:00
疯魔慕薇
19234cdb46
Merge pull request #12673 from chlins/fix/preheat-execution-and-task-pagination
fix(preheat): add pagination for execution and task list api
2020-08-06 23:08:21 +08:00
chlins
302e4c6659 fix(preheat): add pagination for execution and task list api
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-06 16:59:38 +08:00
Steven Zou
f7bb6dd233
Merge pull request #12665 from chlins/fix/preheat-list-providers-under-project
fix(preheat): provider more info about p2p provider instance
2020-08-06 16:57:21 +08:00
chlins
5a2d4dd552 fix(preheat): check running executions when delete policy
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-05 17:54:20 +08:00
chlins
89972f766f fix(preheat): provider more info about p2p provider instance
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-05 17:23:43 +08:00
Chlins Zhang
dc58271d3e
Merge pull request #12649 from chlins/fix/prheat-log-display
fix(preheat): fix preheat task log display
2020-08-03 23:01:28 +08:00
chlins
b008dffe70 fix(preheat): fix preheat task log display
Signed-off-by: chlins <chlins.zhang@gmail.com>
2020-08-03 09:45:18 +08:00
He Weiwei
df1bdc1020 refactor(project): add more methods to project controller and manager
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2020-07-31 17:55:35 +00:00
Wang Yan
9ce29c9dc8
update time format of audit log (#12629)
fixes #11522

use the format: date-time as the format of audit op_time, then it could be rendered by FF and Chrome.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-07-30 17:29:25 +08:00
stonezdj(Daojun Zhang)
518a1721a7
Merge pull request #12571 from ywk253100/200723_proxy_cache_secret
Limit the permission of secret used by proxy cache service
2020-07-30 14:04:54 +08:00
Daniel Jiang
0a9219dcd6
Merge pull request #12615 from wy65701436/update-logs
revise the blob logs
2020-07-30 09:10:07 +08:00
Daniel Jiang
1ee4b3dc82
Refine request checking for OIDC CLI secret (#12596)
This commit makes OIDC CLI secret filter allow more URLs so that the
OIDC CLI secret can be used for replication

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2020-07-30 00:21:27 +08:00
wang yan
20df844d5a revise the blob logs
1, update typo in the update blob status sql, the typo will not impact the sql result.
2, correct blob status in the middleware & GC job log.

Signed-off-by: wang yan <wangyan@vmware.com>
2020-07-29 12:45:30 +08:00
fanjiankong
3653d3cdef Schedule preheat policy.
Signed-off-by: fanjiankong <fanjiankong@tencent.com>
2020-07-29 00:36:34 +08:00