Commit Graph

5225 Commits

Author SHA1 Message Date
Daniel Jiang
884da19414 Do not check security context in Get of user controller
This commit make sure when security context is not found the `Get`
function in user controller should not return error.
Because this func will be called by security middleware, at which point
of time the security context is not generated.
Additionally, checking security context is not necessary because the
permission checking is already done in the API handler layer.

fixes #15535

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-09-21 16:40:16 +08:00
Qian Deng
31707dbf25 Using harbor lib config
using config manager to get env configs

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
543d044f7a Update vendors
Update vendors for trace

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
bad913cf6d Refactor trace code
* use lib trace helper function
* add gracefull shutdown
* Add commens for new added exposed function
* Add licence on top of new created files
* Update trace library
* Update configs
* Add attribute and namespance in config

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
6fec5b2873 Add trace to jobservice
* Add trace init in main
* Add env template
* Add trace for router

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
14095fb10b Add trace to registryctl
* Add trace init to main
* Add trace for http server
* Add trace for gc
* Add env template trace

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
879eecc926 Refactor and Add trace to http Transport
* Refactor common http GetTransport function signature
* Remove redendent GetHTTPTransport and similar functions
* Update Authorized function signature to meet new HTTPTransport
* Add trace for default Transport

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
Qian Deng
a15983432c Add trace for core
* Add trace related lib
* Add trace middleware for core
* add rid for middleware

Signed-off-by: Qian Deng <dengq@vmware.com>
2021-09-18 10:58:52 +00:00
He Weiwei
ecc1a04c92
refactor: implement a lock free quota (#15399)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-09-17 11:26:37 +08:00
He Weiwei
d9a0687461
refactor: using ctx from http request for credMaker of preheat enforcer (#15568)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-09-16 18:40:02 +08:00
Steven Zou
0839028096
Merge pull request #15581 from bitsf/fix_gitlab_filters
fix(replication) gitlab filters may not work
2021-09-16 14:14:30 +08:00
孙世军
9e9c4a03bb
Add stop scan functionality (#15528)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-09-15 17:00:08 +08:00
孙世军
c5003f38ba
Add bandwidth input to adding replication rule (#15550)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-09-15 16:59:14 +08:00
Shengwen YU
ce9bea807e
fix: update context to "makeCtx func() context.Context" (#15584)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>

Co-authored-by: Shengwen Yu <yshengwen@vmware.com>
2021-09-15 10:10:39 +08:00
Ziming Zhang
98cef43ead limit replication bandwidth
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-09-14 11:23:28 +08:00
孙世军
9fdf8e286d
Clear selected row after refreshing for replication task list component (#15549)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-09-14 11:21:16 +08:00
Junyoung, Sung
251feea1fd
Fix typo maxDeepth -> maxDepth (#15574)
Signed-off-by: Junyoung, Sung <junyoung.sung@naverlabs.com>
2021-09-13 21:23:31 +08:00
Wenkai Yin(尹文开)
8e1ffd022c
Merge pull request #15543 from steven-zou/feat/sync-schedules
feat(schedule):sync schedules in db to js datastore
2021-09-13 20:15:00 +08:00
Ziming Zhang
d62aaaa625 fix(replication) gitlab filters may not work
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-09-13 17:23:12 +08:00
Shengwen YU
9cb266a8a0
Merge pull request #15548 from zyyw/ISSUE-14831
Add stop scan a particular artifact & stop scan all
2021-09-13 15:07:49 +08:00
Shengwen Yu
e2e3bcca1c feat: add stop scan & stop scan-all feature
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2021-09-13 11:19:21 +08:00
He Weiwei
d00024ab36 refactor: initialize the remote helper using ctx from http request
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-09-09 11:13:53 +00:00
Steven Zou
6b5cd3a7a5 feat(schedule):sync schedules in db to js datastore
- add a sync worker to sync db schedules when js starting. add missing ones and clear dirty ones.
- update task model to contain status revision info
- update job lifecycle tracker save() method
- update job ACK model
- add UT cases
- update malformat comments

fix #15323

Signed-off-by: Steven Zou <szou@vmware.com>
2021-09-07 08:33:01 +08:00
AllForNothing
a3883e41a9 Fix ui issue for add p2p policy component
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-09-03 10:45:10 +08:00
He Weiwei
06f2414d1c
fix: use ctx from http request for middlewares (#15523)
1. Use ctx from http request for the readonly middleware.
2. Refactor the AuthenticateHelper to let it get orm from ctx of the http request.
3. Change to use ctx from http request for oidc and authproxy http handlers.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-09-02 19:05:35 +08:00
孙世军
383635e970
Refactor add group component (#15518)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-09-02 15:30:43 +08:00
stonezdj(Daojun Zhang)
6b8c5c9edd
Add usergroup search API (#15483)
Fixes #15450
  Add paging function to usergroup list/search API
  Fix some 500 error when adding LDAP user/group to project member

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-09-02 09:04:33 +08:00
Wang Yan
581bb8833e remove the internal legacy API to switch quota
The init design of this API is to avoid the quota error leads to system disaster.
As quota has been refineded and redis lock has been removed, the API can be deprecated safely.

And this API is only call the DB to refresh quota data, user can call the SyncQuota API to handle this.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-09-01 10:49:03 +08:00
Pei-Tang Huang
ff617950b7
Helm Chart should not be translated. (#15438)
And the existing translation is also not accurate to the meaning of Helm.

Signed-off-by: Pei-Tang Huang <tangtheone@gmail.com>
2021-08-31 15:43:30 +08:00
Julio H Morimoto
9799598f33
Fixes https://github.com/goharbor/harbor/issues/15454. (#15455)
Signed-off-by: Julio Morimoto <julio@morimoto.net.br>
2021-08-31 15:39:36 +08:00
Wang Yan
e0c4ebd84d
fix gc delete manifest log issue (#15495)
It needs to use the logger to print error log when timeout, otherwise, it will be dropped.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-08-30 13:40:33 +08:00
He Weiwei
d482a0c323
fix: avoid panic in the RetryUntil (#15501)
1. Use jpillora/backoff to get the backoff to avoid the panic in RetryUntil.
2. Return with last err when retry timeout.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-08-27 17:28:33 +08:00
孙世军
b58158c30f
Fix some UI bugs (#15486)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-26 15:24:45 +08:00
孙世军
9aab74d382
Correct clrDgTotalItems for tag-retention-tasks component (#15492)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-26 15:24:22 +08:00
孙世军
4e998b7dce
Fix chart download issue (#15472)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-24 17:05:13 +08:00
孙世军
eca3d82d9c
Improve global search component (#15462)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-24 17:04:37 +08:00
Wang Yan
b9228096dc
enable robot to support create project (#15461)
1, for admin only, the system level robot should contains the project creation access.
2, for not admin only, the system level robot can create project.
3, for the project that created by system level robot, use the admin ID as the ownerID.

No path for project level robot to create project.

Signed-off-by: wang yan <wangyan@vmware.com>
2021-08-24 09:34:02 +08:00
孙世军
b73480ed0c
Improve css style for autofill input (#15457)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-20 12:08:39 +08:00
yunkunrao
246d863c59 Refactor ping method into util pkg
Signed-off-by: yunkunrao <yunkunrao@gmail.com>
2021-08-19 21:57:25 +08:00
孙世军
14c0a61d3d
Support excluding rule for adding a replication rule (#15368)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-19 14:54:09 +08:00
Steven Zou
f3a875abd7
Merge pull request #15344 from bitsf/replication_policy_exclude
feat(replication) add exclude decoration in policy
2021-08-19 14:26:17 +08:00
孙世军
2e8c3463ec
Disable add group button for LDAP project admin (#15448)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-18 19:48:02 +08:00
Daniel Jiang
cdb13f5191
Merge pull request #15291 from kschu91/bugfix/15290
if username is not available in remote, fall back to username from token
2021-08-17 16:58:46 +08:00
Wang Yan
14f7274989
support robot to list project (#15431)
1, add permission check for API of List Projects
2, add permission check for API of List Repositories
3, use the self defined query to handle both names and public query

Signed-off-by: wang yan <wangyan@vmware.com>
2021-08-17 16:35:36 +08:00
Ziming Zhang
62808bf014 feat(replication) refactor replication filter Validate()
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-08-17 14:19:14 +08:00
Ziming Zhang
698c336421 feat(replication) add exclude decoration in policy
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-08-17 14:19:13 +08:00
孙世军
eabff82366
Improve getChanges function for edit registries compoment (#15404)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-12 10:08:49 +08:00
Gustavo Stein
cd987c6b8a
Fixes bizarre translation for CLI in pt-br. (#15390)
Signed-off-by: Gustavo Raphael Stein <grstein.ramone@gmail.com>
2021-08-11 09:59:54 +08:00
Tianon Gravi
af18f5bd20
Adjust "flattening" tooltip quotes to be consistent (#15393)
This is a minor consistency issue, but it also turns into a minor rendering issue where something is converting "backtick + a" into "à"

Signed-off-by: Tianon Gravi <tianon@infosiftr.com>
2021-08-10 15:21:13 +08:00
stonezdj(Daojun Zhang)
d7c8c722f5
Merge pull request #15397 from stonezdj/21aug4_fix_ldap_ipv6
Support IPv6 when connecting to LDAP server
2021-08-09 12:47:20 +08:00
孙世军
9a10c6627b
Add docker build to deploy Harbor UI for testing (#15381)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-08-09 10:37:49 +08:00
stonezdj
409039b502 Support IPv6 when connecting to LDAP server
Use net.SplitHostPort instead of strings.Split
 Fixes #15354

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-08-04 12:54:44 +08:00
Wang Yan
9e11753949
upgrade helm v3 version (#15372)
1. update helm v3 to v3.6.1
2. update autorest to v14.2.0
3. update other related models

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-30 14:43:42 +08:00
Wang Yan
f7b1610476
replace jwt model (#15367)
update the jwt model to github.com/golang-jwt/jwt
Starting from v3.2.1, the import path has changed from github.com/dgrijalva/jwt-go to github.com/golang-jwt/jwt.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-29 11:08:10 +08:00
孙世军
538266c51a
Handle invalid date for HarborDatePipe (#15359)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-07-27 08:18:20 +08:00
孙世军
f6801cea57
Improve event service (#15353)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-07-26 12:16:49 +08:00
Daniel Jiang
5984175a1f
Merge pull request #15288 from malacoss/patch-1
Fix OIDC connect button string - [French]
2021-07-26 11:31:00 +08:00
Vadim Bauer
13d5e4a7de
fixes the broken pipe connection error with postgres. Similar as PR: #4719 (#15211)
Signed-off-by: Vadim Bauer <vb@container-registry.com>

Co-authored-by: Vadim Bauer <vb@container-registry.com>
2021-07-23 14:56:54 +08:00
Wang Yan
e5a614967d
drop gc api of registryctl (#15325)
The API is desiged for read-only gc job, as the read only gc has already deprecated, remove this api accordingly.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-23 14:15:02 +08:00
Shengwen Yu
766e953325 fix: update adapter ut (mock http requests)
Closes: #15318

Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
2021-07-22 19:45:36 +08:00
malacoss
f11a6f21e8 Fix OIDC connect button string - [French]
Signed-off-by: Mathieu Alorent <mathieu.alorent-externe@acoss.fr>
2021-07-19 10:53:14 +02:00
孙世军
8da8acde19
Fix style issue for oidc-onbord component (#15333)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-07-19 12:26:47 +08:00
Daniel Jiang
e46e9631fa
Merge pull request #15303 from reasonerjt/fix-15241
Remediate the empty subiss problem
2021-07-16 13:34:40 +08:00
Daniel Jiang
3e983b1747
Merge pull request #15242 from kschu91/bugfix/15241
Fix refreshing oidc access token breaks users subiss in database
2021-07-16 10:58:31 +08:00
Daniel Jiang
422894a0f5 Remediate the empty subiss problem
This commit include 2 changes to mitigate and remediate the problem
described in #15241

1. When the token is to be updated in the "oidc_user" table, make sure
   only the column "token" will be udpated.
2. Restore the subiss column for the record that has this column cleared
   by mistake, by decoding the persisted token.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-07-16 00:07:47 +08:00
stonezdj(Daojun Zhang)
2fa530eefa
Merge pull request #15247 from stonezdj/21jun30_remove_auth_user
Delete users under auth_mode other than db_auth
2021-07-14 13:25:43 +08:00
孙世军
8fb76689ab
Update UI to support deleting OIDC users (#15305)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-07-13 15:28:53 +08:00
Wang Yan
f7a4401dcb
deprecate version 1 robot account (#15296)
1, deprecate support for version 1 robot support, the robotv1 cannot be used anymore.
2, reserve the /project/{id_or_name}/robots api.

After the PR, user cannot use the robotv1 to login, and do any interaction with Harbor,
but still can view & delete them with UI or API.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-13 13:39:44 +08:00
Daniel Jiang
3e502ec9a4
Merge pull request #15196 from sixeIa/fix-basedn-empty
Add SearchDN error, mark field as required in UI
2021-07-12 12:32:52 +08:00
stonezdj
c163bc8317 Delete users under auth_mode other than db_auth
The following information should cleanup before delete user:
  Delete project member of this user.
  Delete oidc_user when auth_mode is oidc_auth.
  Fixes #8424
  It also removes the deleted user from project member and the deleted condition in the project member query for consistency
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-07-12 11:31:40 +08:00
stonezdj(Daojun Zhang)
7b84f4e137
Merge pull request #15270 from stonezdj/21jun05_fix_rest_int_parse_fail
Fix invalid syntax errors when int value is convert to scientific notation
2021-07-11 21:00:06 +08:00
Alexis L
2ce814329b
Merge branch 'goharbor:master' into fix-basedn-empty 2021-07-09 22:32:35 +02:00
Alexis
d6283ee913
Add SearchDN error, mark field as required in UI
Signed-off-by: Alexis <60alexis@gmail.com>
2021-07-09 22:30:52 +02:00
ChenYu Zhang
304aff33db
Merge pull request #15280 from chlins/fix/p2p-task-time-format
fix(p2p): adjust task time format
2021-07-09 16:29:09 +08:00
Wang Yan
248be37c3e
clean code of common util (#15287)
Remove the useless code from the common util

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-09 15:35:05 +08:00
Kevin Schu
03b7b01f77 reverted unintentional committed change
Signed-off-by: Kevin Schu <kevin.schu@aoe.com>
2021-07-08 15:43:14 +02:00
Kevin Schu
0679f4701e if username is not available in remote, fall back to username from token
Signed-off-by: Kevin Schu <kevin.schu@aoe.com>
2021-07-08 15:36:18 +02:00
Wang Yan
494d74d32d
bump up go version to 1.16 (#15286)
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-08 16:25:15 +08:00
chlins
f93fc2aa0b fix(p2p): adjust task time format
Signed-off-by: chlins <chlins.zhang@gmail.com>
2021-07-07 21:39:46 +08:00
Wang Yan
b158086642
fix conformance failure (#15261)
fixes #15252

Give 404 for invalid digest when to get/head manifest

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-06 15:11:13 +08:00
stonezdj
41968091a2 Fix invalid syntax errors when int value is convert to scientific notation
Add parseInt function to parse the scientific notation

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-07-05 22:20:00 +08:00
Jiaolin Yang
ddb6619769
Merge pull request #15245 from ilyee/typo
Fix commentline typos in src/pkg/repository/model/model.go
2021-07-05 16:38:11 +08:00
Steven Zou
4ddaecdc3f
Merge pull request #15238 from chlins/fix/create-p2p-policy-permission
fix(p2p): fix p2p create policy permission
2021-07-05 11:04:28 +08:00
elihe
426f7bc7bc Fix commentline typos in src/pkg/repository/model/model.go
Signed-off-by: elihe <elihe@tencent.com>
2021-07-02 10:12:15 +08:00
孙世军
bb57264f11
Improve login page for OIDC (#15214)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-07-02 09:42:04 +08:00
Kevin Schu
4147fbeba0 subiss needs to be part of selected fields, otherwise this attribute would be empty and will cause issues when working with the user object later on.
Signed-off-by: Kevin Schu <kevin.schu@aoe.com>
2021-07-01 15:12:28 +02:00
Wang Yan
29ccdff766
add retry for blob & manifest deletion in GC (#15235)
Fixes #15197

To handle the blob & manifest deletion error, add 1 minute retry.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-07-01 18:49:40 +08:00
chlins
f1456558db fix(p2p): fix p2p create policy permission
Signed-off-by: chlins <chlins.zhang@gmail.com>
2021-07-01 16:14:26 +08:00
stonezdj(Daojun Zhang)
4e1f6633af
Merge pull request #15229 from stonezdj/21jun28_update_swagger_search_group
Add ldap_group_dn parameter to search group with ldap group dn
2021-06-30 14:04:21 +08:00
孙世军
91f4d412f0
Improve i18n service (#15215)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-30 10:22:48 +08:00
孙世军
f902db9d85
Change quota unit to Mebibyte (#15220)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-30 10:22:32 +08:00
stonezdj
fcd2fbcfe7 Add ldap_group_dn parameter to search group with ldap group dn
Fixes #15171
 Cannot use q.Query because ldap_group_dn contains comma(,) and equal(=), which are reserved characters in q.Query

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-06-29 20:20:47 +08:00
孙世军
ff11cbafa1
Improve event log component (#15191)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-29 18:15:17 +08:00
Steven Zou
2a3b91a11a
Merge pull request #15217 from wy65701436/joblog-ref
refactor job log
2021-06-29 17:44:17 +08:00
stonezdj(Daojun Zhang)
08d47f471a
Move genyaml to cmd/swagger (#15062)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-06-29 14:29:03 +08:00
Wang Yan
1abe978e87 refactor job log
Move job service logger to new program model

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-06-29 13:37:45 +08:00
Alexis L
573d97f15b
Add TiB support for display, fix unit to correct one (#15201)
* Add TiB support for display, fix unit to correct one

Signed-off-by: Alexis <60alexis@gmail.com>

* Fix unit test

Signed-off-by: Alexis <60alexis@gmail.com>
2021-06-29 10:40:30 +08:00
孙世军
b789674ada
Fix css bug for disabled checkbox (#15181)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-23 17:13:41 +08:00
孙世军
33301ec65e
Enhance swagger UI (#15168)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-23 16:28:14 +08:00
孙世军
0464305bcc
Bump up UI version to v2.4.0 (#15174)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-23 16:27:40 +08:00
Will Sun
410c5bcd78
Undate Angular to the latest version (#15129)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-16 16:39:10 +08:00
Wenkai Yin(尹文开)
4997eea4c6
Merge pull request #15124 from ywk253100/210610_rep
Add validation for destination namespace when creating/updating replication policy
2021-06-15 09:46:09 +08:00
Will Sun
47b7457378
Add validator to destination namespace input (#15120)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-11 11:58:43 +08:00
Wenkai Yin
9ebd517c7e Add validation for destination namespace when creating/updating replication policy
Add validation for destination namespace when creating/updating replication policy

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-06-10 22:16:05 +08:00
Wenkai Yin
c26e45efab Fix the concurrent pushing the same image issue
The transaction will be aborted when get errors during the execution which causes the following sqls report error.
This commit moves the re-getting artifact logic out of the second transaction to avoid the concurrent pushing issue

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-06-10 21:16:05 +08:00
Wenkai Yin(尹文开)
df000bd7fe
Merge pull request #15090 from heww/tag-for-scanning
fix: supply the latest tag of artifact to scan request
2021-06-09 14:00:44 +08:00
Steven Zou
cdfbe7b92b
Merge pull request #15084 from ywk253100/210608_dest_ns
Flattening repository path components excepting the last one
2021-06-09 13:36:41 +08:00
Will Sun
e774976811
Fix UI issues found in round-2 testing day (#15093)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-09 12:50:33 +08:00
He Weiwei
1b955cd28e fix: supply the latest tag of artifact to scan request
Closes #14416 #14299

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-06-08 10:11:10 +00:00
Wenkai Yin
120be22988 Flattening repository path components excepting the last one
Flattening repository path components excepting the last one in replication

Fixes #15072

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-06-08 15:39:45 +08:00
Will Sun
706de334d3
Optimize UI imports (#15042)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-07 10:06:06 +08:00
Wang Yan
8a0cd99473
fixes 13976 (#15047)
Fixes #13976 for the quota exceed case, gc will print the untagged blobs for dry-run

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-06-04 15:56:53 +08:00
Wang Yan
ea35e7b9ec
enable policy checker for head manifest request (#15056)
As from docker v20, the containerd leverages the cache when to pull a manifest, that leads to the
client doesn't send the get manifest request if the image exists in local.

The content trust and vul checker are only valid for get manifest request, the PR is to enable the checkers on
head manifest request to handle the containerd local cache scenario.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-06-03 16:54:04 +08:00
Jiaolin Yang
a2992327be
Merge pull request #14919 from yunkunrao/master
Fix dragonfly preheat error.
2021-06-03 13:36:15 +08:00
Will Sun
c4f4e6e7e1
Fix critical CVEs for ui packages (#15030)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-06-02 09:54:05 +08:00
yunkunrao
af814a2af2 Code clean
Signed-off-by: yunkunrao <yunkunrao@gmail.com>
2021-06-01 23:13:03 +08:00
Wang Yan
2a1c9ec96a
update the log level of robot v1 context (#15037)
The robotv1 context uses the robot$ as a hardcoded prefix to identify robot account, it will raise error
for a valid robotv2 account with this prefix.

Update the log level to avoid the redundant logs for the default installation.

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-06-01 18:30:40 +08:00
He Weiwei
fec9f59a43 test: use mockery generated artifact Manager in tests
Closes #14284

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-06-01 04:00:08 +00:00
Will Sun
50b44e13d2
Fix ui issues found in testing day (#15015)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-31 18:58:58 +08:00
Wenkai Yin(尹文开)
6e649ac39f
Merge pull request #15014 from heww/move-scan-report-to-job
refactor: convert scan report in scan job
2021-05-31 15:55:31 +08:00
Wenkai Yin(尹文开)
f0e1ba4e1b
Merge pull request #15005 from ywk253100/210528_ns
Declare the capability of supported repository path component for registries
2021-05-31 15:53:40 +08:00
Daniel Jiang
238bea2066
Merge pull request #15010 from reasonerjt/v2auth-enhancement
Make v2auth more strict
2021-05-31 13:10:31 +08:00
Daniel Jiang
486554caa1
Merge pull request #15011 from reasonerjt/merge-slash-middleware
Add merge slash middleware
2021-05-31 13:09:39 +08:00
Wenkai Yin(尹文开)
4ed5fee681
Merge pull request #14949 from stonezdj/21may22_fallback_localregistry
Fall back to local registry when upstream registry is not working
2021-05-31 11:00:43 +08:00
ChenYu Zhang
04cd5f86dd
Merge pull request #14999 from chlins/fix/p2p-preheat-executions-time-format
fix: format p2p preheat execution start_time and end_time to standard…
2021-05-30 13:07:16 +08:00
He Weiwei
f6a1c31f9f refactor: convert scan report in scan job
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-29 12:19:36 +00:00
Daniel Jiang
f4ac81b710 Add merge slash middleware
There are code in the core component to conditionally execute code based
on the pattern of url path, and different ingress controller or reverse
proxy may handle the dup slashes in the url path differently.
This commit merge dup slashes in the url paths to make things more
consistent.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-28 17:24:48 +08:00
He Weiwei
c7a4af3170
test: mock the API requests for the huawei registry (#15009)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-28 17:09:48 +08:00
Daniel Jiang
d3b8c613fd Make v2auth more strict
This commit enhances the v2auth middleware, such that any un-recognized
request sent to /v2/ will be blocked.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-28 16:41:48 +08:00
chlins
5833f5498c fix: format p2p preheat execution start_time and end_time to standard time format
Signed-off-by: chlins <chlins.zhang@gmail.com>
2021-05-28 13:05:01 +08:00
Wenkai Yin
741793a553 Declare the capability of supported repository path component for registries
Declare the capability of supported repository path component for registries

fixes #14981
fixes #14980

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-28 10:42:16 +08:00
Ziming Zhang
77b44a62e7 fix aws adapter url
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-05-27 23:29:12 +08:00
yunkunrao
82fd606f8f Update Unit Test.
Signed-off-by: yunkunrao <yunkunrao@gmail.com>
2021-05-27 18:50:47 +08:00
Eike David Lenz
a3e27ebb87
fix nil map assignment in gc handler (#14918)
Signed-off-by: Eike David Lenz <e.lenz@mittwald.de>
2021-05-26 10:46:11 +08:00
Daniel Jiang
12420ae31d
Merge pull request #14957 from stonezdj/21may24_update_configure
Change configurations in swagger.yaml make it more readable
2021-05-25 23:58:40 +08:00
Wang Yan
42a9d0d905
remove common project code (#14939)
move project model from common to pkg

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-05-25 11:01:19 +08:00
Will Sun
d88dcffa03
Remove redundant sorting code for list projects (#14956)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-25 10:24:44 +08:00
stonezdj
fe830ac4d2 Change configurations in swagger.yaml make it more readable
Update the genyaml to generate the configurations type
Add toCfgMap in config handler

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-05-24 19:13:55 +08:00
Wenkai Yin(尹文开)
544fa806fa
Set null list when or list is nil in query (#14941)
Set null list when or list is nil in query

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-24 16:22:39 +08:00
stonezdj
d7d26c0966 Fall back to local registry when upstream registry is not working
Fixes #14822
When upstream registry not working, but status might stay healthy because the health check interval is 5 minutes, if a pull request comes before registry status turns to unhealthy, the proxy cache middleware might proxy the request to the upstream registry and get a 401 error and this 401 error might translate to a http 500 error to the client eventually.

To solve this issue, it fall back all error to local registry when proxying manifest except the NotFoundError from the local registry.

Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-05-24 14:29:05 +08:00
fanjiankong
306e519dbe Fix tencentcr adapter.
1. Limit API qps for the adapter.
2. Allow set qps via env.
3. Fix Tencnet SDK pagenation.
4. Fix resource filter.

Signed-off-by: fanjiankong <fanjiankong@tencent.com>
2021-05-24 10:33:49 +08:00
He Weiwei
a1ac9b98df
fix: delete robots by project id using raw sql (#14951)
QuerySeter.Delete will call two queies in the orm of beego. First it
will query all primary keys of the model by the QuerySeter, and then the
orm will delete the models using the IN statement of these primary keys.
This will be failed in the postgres when the records more than 65535.
This commit changes to use the raw query to delete the robots of the
project.

Closes #14678

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-24 10:31:48 +08:00
yunkunrao
fa8a0d09d6 Fix dragonfly preheat error.
Signed-off-by: yunkunrao <yunkunrao@gmail.com>
2021-05-23 17:50:54 +08:00
Will Sun
bea27a7da1
Improve scan all page (#14940)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-21 17:55:57 +08:00
Daniel Jiang
dee6064e60
Merge pull request #14926 from reasonerjt/rm-common-dao-oidc-user-onboard
Remove the onboard and update funcs for OIDC user from common/dao
2021-05-20 19:34:59 +08:00
Daniel Jiang
66766a8f69 Remove the onboard and update funcs for OIDC user from common/dao
Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-20 16:23:07 +08:00
ChenYu Zhang
a50f782beb
fix: change sql to improve the performance of catalog api (#14820)
Signed-off-by: chlins <chlins.zhang@gmail.com>
2021-05-20 15:52:53 +08:00
Daniel Jiang
8600b06975
Merge pull request #14925 from ywk253100/210520_perf
Improve the performance of artifact related APIs
2021-05-20 14:10:45 +08:00
Daniel Jiang
5be0c6d35a
Merge pull request #14911 from reasonerjt/fix-14386
Use system configuration resource for permission checking
2021-05-20 14:05:06 +08:00
Wenkai Yin(尹文开)
9afeb90646
Merge pull request #14923 from reasonerjt/fix-14862
Fail with 401 for GET .../users/current/permissions
2021-05-20 14:02:32 +08:00