diff --git a/CHANGELOG.md b/CHANGELOG.md index 406cadc38..efbeabb34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ### 🐞 解决BUG、优化功能 +1. 【server】 ssh 授权目录不能为根目录 + ------ diff --git a/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java b/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java index 9443a2b2f..c000a8999 100644 --- a/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java +++ b/modules/server/src/main/java/io/jpom/controller/ssh/SshController.java @@ -38,10 +38,12 @@ import com.alibaba.fastjson.JSONObject; import com.jcraft.jsch.Session; import io.jpom.common.BaseServerController; import io.jpom.common.Type; +import io.jpom.common.interceptor.PermissionInterceptor; import io.jpom.model.PageResultDto; import io.jpom.model.data.AgentWhitelist; import io.jpom.model.data.NodeModel; import io.jpom.model.data.SshModel; +import io.jpom.model.data.UserModel; import io.jpom.model.enums.BuildReleaseMethod; import io.jpom.model.log.SshTerminalExecuteLog; import io.jpom.plugin.ClassFeature; @@ -143,6 +145,14 @@ public class SshController extends BaseServerController { sshModel.fileDirs(null); } else { List list = StrSplitter.splitTrim(fileDirs, StrUtil.LF, true); + for (String s : list) { + String normalize = FileUtil.normalize(s); + int count = StrUtil.count(normalize, StrUtil.SLASH); + Assert.state(count >= 2, "ssh 授权目录不能是根目录"); + } + // + UserModel userModel = getUser(); + Assert.state(!userModel.isDemoUser(), PermissionInterceptor.DEMO_TIP); sshModel.fileDirs(list); } sshModel.setHost(host); diff --git a/web-vue/src/pages/system/upgrade.vue b/web-vue/src/pages/system/upgrade.vue index c65ee81af..6ba2e66ed 100644 --- a/web-vue/src/pages/system/upgrade.vue +++ b/web-vue/src/pages/system/upgrade.vue @@ -3,69 +3,62 @@ - - -
- - - - - - {{ item }} - - 搜索 - -
-
+ + + + + +
@@ -106,7 +99,7 @@ export default { { title: "打包时间", dataIndex: "timeStamp", ellipsis: true, scopedSlots: { customRender: "timeStamp" } }, { title: "状态", dataIndex: "status", ellipsis: true, scopedSlots: { customRender: "status" } }, // {title: '自动更新', dataIndex: 'autoUpdate', ellipsis: true, scopedSlots: {customRender: 'autoUpdate'}}, - { title: "操作", dataIndex: "operation", width: 120, scopedSlots: { customRender: "operation" }, align: "left" }, + { title: "操作", dataIndex: "operation", width: 90, scopedSlots: { customRender: "operation" }, align: "center" }, ], nodeVersion: {}, nodeStatus: {},