Commit Graph

108 Commits

Author SHA1 Message Date
stonezdj
79bac7a64e Change admin server to core in jobservice
Signed-off-by: stonezdj <stonezdj@gmail.com>
2018-10-15 14:56:18 +08:00
Steven Zou
326e0d455a Log error if failed to create logger for job
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-11 16:29:00 +08:00
Wenkai Yin
b4a9eae8cc
Merge pull request #6009 from reasonerjt/fix-insecure-transport
Use secure transport to access HTTP endpoint
2018-10-11 10:23:12 +08:00
Steven Zou
95d48436b8 Add README doc for job service (#6010)
Signed-off-by: Steven Zou <szou@vmware.com>
2018-10-10 19:08:20 +08:00
Daniel Jiang
1188bd89b9 Use secure transport to access HTTP endpoint
In various parts of the code, we used insecure transport in http Client
when we assume the endpoint is http.  This causes complaints form
security scanner.  We should use secure transport in such cases.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-10-10 17:51:02 +08:00
Daniel Jiang
0699980924 Add Scan All job to job service (#5934)
This commit adds the job to scan all images on registry.
It also makes necessary change to Secret based security context, to
job service has higher permission to call the API of core service.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-09-22 13:07:32 +08:00
clouderati
587459df15 Replacing copyright notices with "Copyright Project Harbor Authors".
Signed-off-by: clouderati <35942204+clouderati@users.noreply.github.com>
2018-09-19 16:59:36 +00:00
Qian Deng
7873a0312a Rename harbor-ui to harbor-core
1. Update the nginx.conf
2. Update Makefile
3. Update docker-compose
4. Update image name
5. Rename folder ui to core
6. Change the harbor-ui's package name to core
7. Remove unused static file on harbor-core
8. Remove unused code for harbor-portal

Signed-off-by: Qian Deng <dengq@vmware.com>
2018-09-19 16:35:13 +08:00
陈德
0582db9a82 Apply consistent format for comments
Signed-off-by: 陈德 <chende@caicloud.io>
2018-09-05 16:16:31 +08:00
Steven Zou
1636b138f2 Return more data of the job when reporting status info via webhook
- update the status report func `RedisJobStatsManager.reportStatus`
- update the UT case for the above change

Signed-off-by: Steven Zou <szou@vmware.com>
2018-08-30 14:28:12 +08:00
wang yan
aab761ac8a Fix gofmt check results
Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-29 11:50:00 +08:00
Yan
fca2bb3a6b
Fix misspell checking results (#5749)
Signed-off-by: wang yan <wangyan@vmware.com>
2018-08-29 10:25:42 +08:00
Daniel Jiang
dcf4e2ee78 Update import path in go code
vmware -> goharbor

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-08-23 17:50:53 +08:00
Daniel Jiang
65cf02a1d7 Validate job ID when getting job log
Add validation to job ID in the API to get job log in job service, to
prevent file path traversal attack.

Signed-off-by: Daniel Jiang <jiangd@vmware.com>
2018-08-15 15:33:13 +08:00
wangyan
29d0d51403 Signed-off-by: wangyan <wangyan@vmware.com>
Add clean registry cache to gc job

To workaround the issue: https://github.com/docker/distribution/issues/2094
GC needs to clean cache before to call the docker reigstry api to delete blobs.
Otherwise, the following docker push will not be performed as docker registry
does not clean cache in GC, it thinks the image is still there, and the new
blobs will be uploaded.
2018-08-13 02:58:27 -07:00
wangyan
9a95f14918 Cherry-pick -- Fix security issue found by gas 2018-08-03 01:16:53 -07:00
Wenkai Yin
2a40068d75 Fix cross slot issue of redis
This commit upgrdes the github.com/gocraft/work package to 0.5.1 and updates the namespace value
to fix the redis cross slot issue mentioned in #4633
2018-07-27 14:23:39 +08:00
Yan
efdb57548f
add admin job api (#5344)
It supports Harbor admin to trigger job either manual or
schedule. The job will be populated to job service to execute. 
The api includes:
1. POST /api/system/gc
2, GET /api/system/gc/:id 
3, GET /api/system/gc/:id/log
4, PUT/GET/POST /api/system/gc/schedule
2018-07-20 19:22:37 +08:00
Yan
9e65499c10
Add garbage collection job implemention, this job could (#5268)
be triggered by manual and schedule. It calls registrtctl
to do the GC job, and log the output.
2018-07-16 18:08:40 +08:00
Steven Zou
4db708096b Add retry for getting configs from admin server when doing job conetxt initialization 2018-05-10 15:26:59 +08:00
Steven Zou
f7bc467c99 Return none zero code when job service exit with error
replace fmt.Println/logger.Errorf with logger.Fatal(f)
2018-05-10 14:44:04 +08:00
Yan
ae257433cc
Fully migrate harbor db to postgresql (#4689)
* Merge harbor db to postgres
2018-04-27 02:27:12 -07:00
Steven Zou
e1b509e3f3 Fix the issue of intermittent restarting of job service
github issue: #4712
ping redis server before pool starting

Let worker pool to restart the message server if message server exits with error (controlled by max retries)
2018-04-25 17:02:16 +08:00
Steven Zou
a17436962f Return the logger.Interface instead of the pointer of logger to avoid nil checking issue 2018-04-20 14:59:28 +08:00
Steven Zou
ca8d3bdcc9
Merge pull request #4638 from vmware/use_redis_url_addr
Use redis URL address to replace host:port when connecting to redis server
2018-04-17 10:12:51 +08:00
Steven Zou
adc2f8f124 Use redis URL address to replace host:port when connecting to redis server
replace tcp host:port with
'redis://arbitrary_usrname:password@ipaddress:port/database_index'

update prepare to generate config yaml file of job service based on harbor.cfg

update harbor.cfg default values
2018-04-13 19:19:56 +08:00
Steven Zou
b5b728bee3 Fix the vulnerability issues in the job service code
'Errors unhandled' in 'jobservice/job/impl/logger/job_logger.go'
'TLS InsecureSkipVerify set true' in 'jobservice/opm/hook_client.go'
2018-04-12 15:12:39 +08:00
Steven Zou
85ae40f5ec Apply auth checking to all the incoming requests 2018-04-08 18:12:13 +08:00
Steven Zou
529ad3e079
Merge pull request #4593 from vmware/add_more_log_2_js
Fix issue: failed to update the status of job if runtme error occurred
2018-04-08 14:03:34 +08:00
Steven Zou
233692c127 fix issue: job context may be nil pointer when trying to be closed in defer func 2018-04-08 13:03:23 +08:00
Steven Zou
1cb40368f5 Fix issue: failed to update the status of job if runtme error occurred 2018-04-08 10:38:47 +08:00
Tan Jiang
ff06ec05c3 Store secret in header instead of cookie 2018-04-07 22:02:06 +08:00
Tan Jiang
15580a5e8c Read the system properties from scan job context 2018-04-04 19:58:54 +08:00
Steven Zou
6c69a8cd05 Fix issue of stopping periodic job
improve op command by using cache
return 404 if no job found to stop
2018-04-02 18:08:03 +08:00
Steven Zou
fee7f6ddef Merge branch 'job_service' into switch_job_service 2018-04-02 12:06:23 +08:00
Steven Zou
250360307b Modify docker compose file template and make file to enable new job service
Fix typo in Makefile under photon

Fix version tag issue of redis container

Assign container name for redis container

Update docker compose template to enable network for redis

Remove exposed ports of redis from compose yaml tpl
2018-03-30 16:52:55 +08:00
Steven Zou
013028ef4a Replace old job service package with V2 (rename packages) 2018-03-30 11:22:29 +08:00
Steven Zou
bfbb949034 Use the new job service(v2) to replace the old one 2018-03-29 23:30:03 +08:00
yixingj
cb64ad96ff Make endpoint configurable
Move all the endpoint to harbor.cfg
2018-03-26 10:50:18 +08:00
Wenkai Yin
9022abfc13 Fix code issues found by Gas 2018-01-29 15:17:03 +08:00
Wenkai Yin
4070ed5152 Provide a mechanism to stop pending and retrying jobs 2018-01-12 15:29:20 +08:00
Wenkai Yin
3be1d5a7fd Assign read-only privilege of replication policy to project admin and add stopping replication jobs API. 2017-12-25 23:49:21 +08:00
Wenkai Yin
260ef561c4 Update the HTTP client for easy use by add more util functions 2017-12-16 06:45:59 +08:00
Wenkai Yin
a736cb7b09 Update the HTTP client according to the comments 2017-12-15 09:40:31 +08:00
Wenkai Yin
b5e7de331e Delete enabled and start_time properties of replication rule 2017-12-15 09:40:31 +08:00
Wenkai Yin
fe10c2e7f5 Create replicator to submit replication job to jobservice 2017-12-15 09:40:31 +08:00
Daniel Jiang
cdadc94d0f
Merge pull request #3804 from ywk253100/171215_jobservice
Print stack trace when recover from panic and print warning message rather than returning an error when updating 0 records
2017-12-18 16:36:20 +08:00
stonezdj
9393d26fdc Fix ldap ping issue #3653 2017-12-15 14:47:54 +08:00
Wenkai Yin
43489c2b67 Print stack trace when recover from panic and print warning message rather than returning an error when updating 0 records 2017-12-14 13:48:45 +08:00
Tan Jiang
b3e0af2382 Fix permission issue in job_log directory 2017-11-21 19:31:15 +08:00