SbloodyS commented on code in PR #16923:
URL:
https://github.com/apache/dolphinscheduler/pull/16923#discussion_r1897729516
##########
docs/docs/en/guide/security/security.md:
##########
@@ -19,7 +19,9 @@ Administrator login, default username/password:
admin/dolphinscheduler123
- Tenant Code: **The tenant code is the user on Linux, unique and cannot be
repeated**
- The administrator enters the `Security Center->Tenant Management` page, and
clicks the `Create Tenant` button to create a tenant.
-> Note: Currently, only admin users can modify tenant.
+> Note:
+> 1. Currently, only admin users can modify tenant.
+> 2. If you create a tenant manually in the environment, you need to add the
current tenant to the configured group, otherwise the tenant does not have
working directory permissions.
Review Comment:
```suggestion
> 2. If you create a tenant manually in the Linux, you need to add the
manually created tenant to the dolphinscheduler bootstrap user's group, so that
the tenant will have enough working directory permissions.
```
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java:
##########
@@ -289,6 +291,29 @@ public static void setFileTo755(File file) throws
IOException {
}
}
+ public static void createDirectoryWith775(@NonNull Path path) throws
IOException {
+ if (path.toFile().exists()) {
+ return;
+ }
+ if (OSUtils.isWindows()) {
+ Files.createDirectories(path);
+ } else {
+ Path parent = path.getParent();
+ if (parent != null && !parent.toFile().exists()) {
+ createDirectoryWith755(parent);
+ }
+
+ try {
+ Files.createDirectory(path);
+ Files.setPosixFilePermissions(path, PERMISSION_775);
+ } catch (FileAlreadyExistsException fileAlreadyExistsException) {
+ // Catch the FileAlreadyExistsException here to avoid create
the same parent directory in parallel
+ log.debug("The directory: {} already exists", path);
Review Comment:
```suggestion
log.error("The directory: {} already exists", path);
```
##########
docs/docs/zh/guide/security/security.md:
##########
@@ -18,7 +18,9 @@
- 租户编码:**租户编码是 Linux上 的用户,唯一,不能重复**
- 管理员进入安全中心->租户管理页面,点击“创建租户”按钮,创建租户。
-> 注意:目前仅有 admin 用户可以修改租户。
+> 注意:
+> 1. 目前仅有 admin 用户可以修改租户;
+> 2. 如果用户手动在环境中创建租户,需要把当前租户添加到已配置的用户组下,否则该租户不具备工作目录的权限。
Review Comment:
Same as english.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]