Skip to content

Commit 5b7820a

Browse files
authored
Merge branch 'dev' into Fix-15570
2 parents 102aca5 + 9599b5a commit 5b7820a

File tree

85 files changed

+1704
-548
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1704
-548
lines changed

deploy/kubernetes/dolphinscheduler/templates/configmap.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data:
3232
{{- end }}
3333
{{- end }}
3434
{{- end }}
35-
common_properties: |-
35+
common.properties: |-
3636
{{- if index .Values.conf "common" }}
3737
{{- range $key, $value := index .Values.conf "common" }}
3838
{{- if and $.Values.minio.enabled }}

deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ spec:
114114
name: {{ include "dolphinscheduler.fullname" . }}-alert
115115
- name: config-volume
116116
mountPath: /opt/dolphinscheduler/conf/common.properties
117-
subPath: common_properties
117+
subPath: common.properties
118118
volumes:
119119
- name: {{ include "dolphinscheduler.fullname" . }}-alert
120120
{{- if .Values.alert.persistentVolumeClaim.enabled }}

deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ spec:
115115
name: {{ include "dolphinscheduler.fullname" . }}-api
116116
- name: config-volume
117117
mountPath: /opt/dolphinscheduler/conf/common.properties
118-
subPath: common_properties
118+
subPath: common.properties
119119
{{- if .Values.api.taskTypeFilter.enabled }}
120120
- name: config-volume
121121
mountPath: /opt/dolphinscheduler/conf/task-type-config.yaml

deploy/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-master.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ spec:
112112
{{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
113113
- name: config-volume
114114
mountPath: /opt/dolphinscheduler/conf/common.properties
115-
subPath: common_properties
115+
subPath: common.properties
116116
{{- include "dolphinscheduler.etcd.ssl.volumeMount" . | nindent 12 }}
117117
volumes:
118118
- name: {{ include "dolphinscheduler.fullname" . }}-master

deploy/kubernetes/dolphinscheduler/templates/statefulset-dolphinscheduler-worker.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
name: {{ include "dolphinscheduler.fullname" . }}-worker-logs
114114
- name: config-volume
115115
mountPath: /opt/dolphinscheduler/conf/common.properties
116-
subPath: common_properties
116+
subPath: common.properties
117117
{{- include "dolphinscheduler.sharedStorage.volumeMount" . | nindent 12 }}
118118
{{- include "dolphinscheduler.fsFileResource.volumeMount" . | nindent 12 }}
119119
{{- include "dolphinscheduler.etcd.ssl.volumeMount" . | nindent 12 }}

docs/docs/en/guide/remote-logging.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ If you deploy DolphinScheduler in `Standalone` mode, you only need to configure
1010
```properties
1111
# Whether to enable remote logging
1212
remote.logging.enable=false
13-
# if remote.logging.enable = true, set the target of remote logging
13+
# if remote.logging.enable = true, set the target of remote logging, currently support OSS, S3, GCS, ABS
1414
remote.logging.target=OSS
1515
# if remote.logging.enable = true, set the log base directory
1616
remote.logging.base.dir=logs
@@ -66,12 +66,12 @@ remote.logging.google.cloud.storage.bucket.name=<your-bucket>
6666
Configure `common.properties` as follows:
6767

6868
```properties
69-
# abs container name, required if you set resource.storage.type=ABS
70-
resource.azure.blob.storage.container.name=<your-container>
7169
# abs account name, required if you set resource.storage.type=ABS
72-
resource.azure.blob.storage.account.name=<your-account-name>
73-
# abs connection string, required if you set resource.storage.type=ABS
74-
resource.azure.blob.storage.connection.string=<your-connection-string>
70+
remote.logging.abs.account.name=<your-account-name>
71+
# abs account key, required if you set resource.storage.type=ABS
72+
remote.logging.abs.account.key=<your-account-key>
73+
# abs container name, required if you set resource.storage.type=ABS
74+
remote.logging.abs.container.name=<your-container-name>
7575
```
7676

7777
### Notice

docs/docs/zh/guide/remote-logging.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Apache DolphinScheduler支持将任务日志传输到远端存储上。当配置
1010
```properties
1111
# 是否开启远程日志存储
1212
remote.logging.enable=true
13-
# 任务日志写入的远端存储,目前支持OSS, S3, GCS
13+
# 任务日志写入的远端存储,目前支持OSS, S3, GCS, ABS
1414
remote.logging.target=OSS
1515
# 任务日志在远端存储上的目录
1616
remote.logging.base.dir=logs
@@ -66,12 +66,12 @@ remote.logging.google.cloud.storage.bucket.name=<your-bucket>
6666
配置`common.propertis`如下:
6767

6868
```properties
69-
# abs container name, required if you set resource.storage.type=ABS
70-
resource.azure.blob.storage.container.name=<your-container>
7169
# abs account name, required if you set resource.storage.type=ABS
72-
resource.azure.blob.storage.account.name=<your-account-name>
73-
# abs connection string, required if you set resource.storage.type=ABS
74-
resource.azure.blob.storage.connection.string=<your-connection-string>
70+
remote.logging.abs.account.name=<your-account-name>
71+
# abs account key, required if you set resource.storage.type=ABS
72+
remote.logging.abs.account.key=<your-account-key>
73+
# abs container name, required if you set resource.storage.type=ABS
74+
remote.logging.abs.container.name=<your-container-name>
7575
```
7676

7777
### 注意事项

dolphinscheduler-api/pom.xml

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@
6161
<artifactId>dolphinscheduler-meter</artifactId>
6262
</dependency>
6363

64+
<dependency>
65+
<groupId>org.apache.dolphinscheduler</groupId>
66+
<artifactId>dolphinscheduler-data-quality</artifactId>
67+
</dependency>
68+
6469
<dependency>
6570
<groupId>org.apache.dolphinscheduler</groupId>
6671
<artifactId>dolphinscheduler-datasource-all</artifactId>

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/constants/ApiFuncIdentificationConstant.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public class ApiFuncIdentificationConstant {
3737
public static final String TENANT_CREATE = "security:tenant:create";
3838
public static final String TENANT_UPDATE = "security:tenant:update";
3939
public static final String TENANT_DELETE = "security:tenant:delete";
40-
public static final String ALART_LIST = "monitor:alert:view";
41-
public static final String ALART_INSTANCE_CREATE = "security:alert-plugin:create";
40+
public static final String ALERT_INSTANCE_CREATE = "security:alert-plugin:create";
4241
public static final String ALERT_PLUGIN_UPDATE = "security:alert-plugin:update";
4342
public static final String ALERT_PLUGIN_DELETE = "security:alert-plugin:delete";
4443
public static final String WORKER_GROUP_CREATE = "security:worker-group:create";

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/DataSourceController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public Result<Object> queryDataSource(@Parameter(hidden = true) @RequestAttribut
162162
@ApiException(QUERY_DATASOURCE_ERROR)
163163
public Result<Object> queryDataSourceList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
164164
@RequestParam("type") DbType type) {
165-
List<DataSource> datasourceList = dataSourceService.queryDataSourceList(loginUser, type.ordinal());
165+
List<DataSource> datasourceList = dataSourceService.queryDataSourceList(loginUser, type.getCode());
166166
return Result.success(datasourceList);
167167
}
168168

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public Result<Object> queryUdfFuncListPaging(@Parameter(hidden = true) @RequestA
554554
@ApiException(QUERY_DATASOURCE_BY_TYPE_ERROR)
555555
public Result<Object> queryUdfFuncList(@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
556556
@RequestParam("type") UdfType type) {
557-
return udfFuncService.queryUdfFuncList(loginUser, type.ordinal());
557+
return udfFuncService.queryUdfFuncList(loginUser, type.getCode());
558558
}
559559

560560
/**

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java

+2
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ public enum Status {
323323

324324
REMOVE_TASK_INSTANCE_CACHE_ERROR(20019, "remove task instance cache error", "删除任务实例缓存错误"),
325325

326+
ILLEGAL_RESOURCE_PATH(20020, "Resource file [{0}] is illegal", "非法的资源路径[{0}]"),
327+
326328
USER_NO_OPERATION_PERM(30001, "user has no operation privilege", "当前用户没有操作权限"),
327329
USER_NO_OPERATION_PROJECT_PERM(30002, "user {0} is not has project {1} permission", "当前用户[{0}]没有[{1}]项目的操作权限"),
328330
USER_NO_WRITE_PROJECT_PERM(30003, "user [{0}] does not have write permission for project [{1}]",

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,13 @@ Result<Object> updateResourceContent(User loginUser, String fullName, String ten
194194
org.springframework.core.io.Resource downloadResource(User loginUser, String fullName) throws IOException;
195195

196196
/**
197-
* Get resource by given resource type and full name.
197+
* Get resource by given resource type and file name.
198198
* Useful in Python API create task which need processDefinition information.
199199
*
200200
* @param userName user who query resource
201-
* @param fullName full name of the resource
201+
* @param fileName file name of the resource
202202
*/
203-
StorageEntity queryFileStatus(String userName, String fullName) throws Exception;
203+
StorageEntity queryFileStatus(String userName, String fileName) throws Exception;
204204

205205
/**
206206
* delete DATA_TRANSFER data in resource center

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package org.apache.dolphinscheduler.api.service.impl;
1919

20-
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.ALART_INSTANCE_CREATE;
20+
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.ALERT_INSTANCE_CREATE;
2121
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.ALERT_PLUGIN_DELETE;
2222
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.ALERT_PLUGIN_UPDATE;
2323

@@ -108,7 +108,7 @@ public AlertPluginInstance create(User loginUser,
108108
WarningType warningType,
109109
String pluginInstanceParams) {
110110

111-
if (!canOperatorPermissions(loginUser, null, AuthorizationType.ALERT_PLUGIN_INSTANCE, ALART_INSTANCE_CREATE)) {
111+
if (!canOperatorPermissions(loginUser, null, AuthorizationType.ALERT_PLUGIN_INSTANCE, ALERT_INSTANCE_CREATE)) {
112112
throw new ServiceException(Status.USER_NO_OPERATION_PERM);
113113
}
114114

@@ -359,7 +359,7 @@ public void testSend(int pluginDefineId, String pluginInstanceParams) {
359359
throw new ServiceException(Status.ALERT_TEST_SENDING_FAILED, e.getMessage());
360360
}
361361

362-
if (alertSendResponse.isSuccess()) {
362+
if (!alertSendResponse.isSuccess()) {
363363
throw new ServiceException(Status.ALERT_TEST_SENDING_FAILED,
364364
alertSendResponse.getResResults().get(0).getMessage());
365365
}

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataSourceServiceImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public BaseDataSourceParamDTO queryDataSource(int id, User loginUser) {
230230
@Override
231231
public PageInfo<DataSource> queryDataSourceListPaging(User loginUser, String searchVal, Integer pageNo,
232232
Integer pageSize) {
233-
IPage<DataSource> dataSourceList = null;
233+
IPage<DataSource> dataSourceList;
234234
Page<DataSource> dataSourcePage = new Page<>(pageNo, pageSize);
235235
PageInfo<DataSource> pageInfo = new PageInfo<>(pageNo, pageSize);
236236
if (loginUser.getUserType().equals(UserType.ADMIN_USER)) {
@@ -282,7 +282,7 @@ private String getHiddenPassword() {
282282
@Override
283283
public List<DataSource> queryDataSourceList(User loginUser, Integer type) {
284284

285-
List<DataSource> datasourceList = null;
285+
List<DataSource> datasourceList;
286286
if (loginUser.getUserType().equals(UserType.ADMIN_USER)) {
287287
datasourceList = dataSourceMapper.queryDataSourceByType(0, type);
288288
} else {
@@ -420,7 +420,7 @@ public List<DataSource> authedDatasource(User loginUser, Integer userId) {
420420
public List<ParamsOptions> getTables(Integer datasourceId, String database) {
421421
DataSource dataSource = dataSourceMapper.selectById(datasourceId);
422422

423-
List<String> tableList = null;
423+
List<String> tableList;
424424
BaseConnectionParam connectionParam =
425425
(BaseConnectionParam) DataSourceUtils.buildConnectionParams(
426426
dataSource.getType(),

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectParameterServiceImpl.java

+2
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ public Result updateProjectParameter(User loginUser, long projectCode, long code
155155

156156
projectParameter.setParamName(projectParameterName);
157157
projectParameter.setParamValue(projectParameterValue);
158+
projectParameter.setUpdateTime(new Date());
159+
projectParameter.setOperator(loginUser.getId());
158160

159161
if (projectParameterMapper.updateById(projectParameter) > 0) {
160162
log.info("Project parameter is updated and id is :{}", projectParameter.getId());

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java

+17-3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ public Result<Object> createDirectory(User loginUser, String name, ResourceType
126126
}
127127

128128
String tenantCode = getTenantCode(user);
129+
checkFullName(tenantCode, currentDir);
129130

130131
String userResRootPath = ResourceType.UDF.equals(type) ? storageOperate.getUdfDir(tenantCode)
131132
: storageOperate.getResDir(tenantCode);
@@ -171,6 +172,7 @@ public Result<Object> uploadResource(User loginUser, String name, ResourceType t
171172
}
172173

173174
String tenantCode = getTenantCode(user);
175+
checkFullName(tenantCode, currentDir);
174176

175177
result = verifyFile(name, type, file);
176178
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
@@ -257,14 +259,15 @@ public Result<Object> updateResource(User loginUser, String resourceFullName, St
257259
}
258260

259261
String tenantCode = getTenantCode(user);
262+
checkFullName(tenantCode, resourceFullName);
260263

261264
if (!isUserTenantValid(isAdmin(loginUser), tenantCode, resTenantCode)) {
262265
log.error("current user does not have permission");
263266
putMsg(result, Status.NO_CURRENT_OPERATING_PERMISSION);
264267
return result;
265268
}
266269

267-
String defaultPath = storageOperate.getResDir(tenantCode);
270+
String defaultPath = storageOperate.getDir(type, tenantCode);
268271

269272
StorageEntity resource;
270273
try {
@@ -949,6 +952,7 @@ public Result<Object> createResourceFile(User loginUser, ResourceType type, Stri
949952
}
950953

951954
String tenantCode = getTenantCode(user);
955+
checkFullName(tenantCode, currentDir);
952956

953957
if (FileUtils.directoryTraversal(fileName)) {
954958
log.warn("File name verify failed, fileName:{}.", RegexUtils.escapeNRT(fileName));
@@ -1280,9 +1284,19 @@ private String getTenantCode(User user) {
12801284
}
12811285

12821286
private void checkFullName(String userTenantCode, String fullName) {
1287+
if (StringUtils.isEmpty(fullName)) {
1288+
return;
1289+
}
1290+
if (FOLDER_SEPARATOR.equalsIgnoreCase(fullName)) {
1291+
return;
1292+
}
1293+
// Avoid returning to the parent directory
1294+
if (fullName.contains("../")) {
1295+
throw new ServiceException(Status.ILLEGAL_RESOURCE_PATH, fullName);
1296+
}
12831297
String baseDir = storageOperate.getDir(ResourceType.ALL, userTenantCode);
1284-
if (StringUtils.isNotBlank(fullName) && !StringUtils.startsWith(fullName, baseDir)) {
1285-
throw new ServiceException("Resource file: " + fullName + " is illegal");
1298+
if (!StringUtils.startsWith(fullName, baseDir)) {
1299+
throw new ServiceException(Status.ILLEGAL_RESOURCE_PATH, fullName);
12861300
}
12871301
}
12881302
}

0 commit comments

Comments
 (0)