Commit Graph

5092 Commits

Author SHA1 Message Date
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
Wenkai Yin(尹文开)
0fe551274d
Merge pull request #14921 from ywk253100/210519_db
Clean up tech debt codes
2021-05-20 13:44:10 +08:00
Wenkai Yin(尹文开)
36d76d8704
Merge pull request #14912 from ywk253100/210518_bug
Truncate the string when deletinng the resources when the length exceeds the limit
2021-05-20 12:09:36 +08:00
Wenkai Yin
998e392bb4 Clean up tech debt codes
Clean up tech debt codes

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-20 11:47:46 +08:00
Wenkai Yin
dc059a9a8f Improve the performance of artifact related APIs
Improve the performance of artifact related APIs by adding indexes and refactoring sql logic

Closes #13890 #14813 #14814

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-20 11:25:43 +08:00
Wenkai Yin(尹文开)
08ed886936
Merge pull request #14914 from ywk253100/210518_registry
Update the field name of registry model
2021-05-19 17:20:12 +08:00
Daniel Jiang
93fe178dc3 Fail with 401 for GET .../users/current/permissions
fixes #14862

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-19 16:28:39 +08:00
Will Sun
1896df2cfb
Improve css style (#14909)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-19 12:49:38 +08:00
Daniel Jiang
294ee52d7a
Merge pull request #14900 from reasonerjt/rm-common-dao-getuser-onboard
Remove GetUser and Onboard from common/dao
2021-05-19 11:21:00 +08:00
He Weiwei
c6bd7b2ec2
ci: lint the swagger file (#14916)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-19 10:36:09 +08:00
Daniel Jiang
4492e47e89
Merge pull request #14910 from reasonerjt/fix-oidc-callback-nil-pointer
Check user in security context before getting the ID
2021-05-18 23:35:46 +08:00
Wenkai Yin
315f490d3c Update the field name of registry model
Update the field name of registry mode

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-18 17:26:20 +08:00
Wenkai Yin
5ebc8b4fdd Truncate the string when deletinng the resources when the length exceeds the limit
Truncate the string when deletinng the resources when the length exceeds the limit

Signed-off-by: Wenkai Yin <yinw@vmware.com>
2021-05-18 17:17:41 +08:00
Daniel Jiang
c41d75fb31 Use system configuration resource for permission checking
This commit uses system configuration resource for permission check
against API to ping OIDC and update systen CVE allowlist.
Fixes #14386

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-18 16:06:58 +08:00
Daniel Jiang
952644e23f Remove GetUser and Onboard from common/dao
Replaced by funcs in src/pkg/user and src/controller/user

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-18 15:28:41 +08:00
Daniel Jiang
ebe5733f27 Check user in security context before getting the ID
This commit fix a potential nil pointer issue when trying to read User
ID from security context

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2021-05-18 14:54:58 +08:00
He Weiwei
0c315d8aee
refactor: remove allowlist in GetSummary of scan controller (#14836)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-18 14:01:59 +08:00
Vadim Bauer
1a3335edc5
Provide information about missing RBAC permissions in debug mode. (#14906)
Signed-off-by: Vadim Bauer <vb@container-registry.com>

Co-authored-by: Vadim Bauer <vb@container-registry.com>
2021-05-18 10:02:34 +08:00
Wenkai Yin(尹文开)
aaff28f6ff
Merge pull request #14843 from ninjadq/fix_webhook_parse_chartname
Fix webhook parse chartname panic
2021-05-18 09:30:22 +08:00
Will Sun
0a8ff4c1f9
Update project summary page (#14874)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-17 10:39:33 +08:00
Wenkai Yin(尹文开)
e553cbe795
Merge pull request #14887 from wy65701436/golang-15
bump up go to v1.15.12
2021-05-17 10:32:19 +08:00
Will Sun
ba68f16b8d
Support searching quota by project name (#14881)
Signed-off-by: AllForNothing <sshijun@vmware.com>
2021-05-17 09:46:24 +08:00
He Weiwei
7fb1bc538c
refactor: remove unused core/api/models pkg (#14882)
Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-14 17:15:44 +08:00
Wang Yan
0fb520a33b bump up go to v1.15.12
Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-05-14 15:36:23 +08:00
He Weiwei
6f3607cebd
perf: cache the metadata of the scanner (#14879)
1. Cache the metadata of scanner 30s.
2. Change the scanner client request timeout to 5s.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-14 14:27:37 +08:00
Ziming
1665dbcbc8
fix(retention) add delete retention API (#14747)
Signed-off-by: Ziming Zhang <zziming@vmware.com>
2021-05-14 14:15:42 +08:00
Daniel Jiang
35c9a98272
Merge pull request #14875 from heww/fix-scan-all
fix: using new ctx to scan artifact when scanAll
2021-05-14 12:56:10 +08:00
He Weiwei
eed91dab45
fix: requires authn for apis of project scanner (#14880)
Closes #14863

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-14 11:27:23 +08:00
He Weiwei
f800d531ec fix: using new ctx to scan artifact when scanAll
DB transaction failure may break the loop query of the artifacts, the
result is that not all artifacts are scanned in one scan all job. Using
a new DB connection to call the Scan method of the controller to avoid
this problem.

Signed-off-by: He Weiwei <hweiwei@vmware.com>
2021-05-13 12:33:10 +00:00
Daniel Jiang
fa46b0d736
Merge pull request #14095 from jsoref/tokens
Tokens
2021-05-13 13:25:58 +08:00
Wang Yan
ad9569da26
refactor preheat model (#14858)
Move the notification to preheat models

Signed-off-by: Wang Yan <wangyan@vmware.com>
2021-05-12 22:29:01 +08:00
DQ
2583107446 Fix panic issue when there are '--' in chart name
let webhook get name function consistent with chartmuseum

Signed-off-by: DQ <dengq@vmware.com>
2021-05-12 14:11:57 +00:00
Qian Deng
17dd48e5a3
Merge pull request #14854 from ninjadq/upgrade_helm_chart
Upgrade helm chart
2021-05-12 19:33:03 +08:00
stonezdj(Daojun Zhang)
0dfc801a50
Error string should not be capitalized (#14840)
Signed-off-by: stonezdj <stonezdj@gmail.com>
2021-05-12 16:53:37 +08:00