mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 20:08:40 +08:00
fix
This commit is contained in:
parent
83ddfde688
commit
2374be13b3
@ -26,6 +26,7 @@
|
||||
11. 【server】取消服务端授权 token 配置
|
||||
12. 【all】下架 节点脚本导入功能
|
||||
13. 【server】取消限制创建用户最大数配置:`user.maxCount`
|
||||
14. 【server】删除 node_info 表 cycle 字段
|
||||
|
||||
### ❌ 不兼容的属性配置变更
|
||||
|
||||
@ -59,4 +60,7 @@
|
||||
3. 节点转发模块优化
|
||||
4. 分片上传文件
|
||||
5. 构建事件触发新增更多(前后)
|
||||
6. 复制项目
|
||||
6. 复制项目
|
||||
7. 测命令行参数
|
||||
8. 资产管理
|
||||
9. 标签页缓存问题(定时器未清空)
|
@ -56,10 +56,6 @@ server:
|
||||
tomcat:
|
||||
uri-encoding: UTF-8
|
||||
spring:
|
||||
application:
|
||||
name: jpom agent
|
||||
profiles:
|
||||
active: default
|
||||
servlet:
|
||||
session:
|
||||
timeout: 1H
|
||||
|
@ -66,4 +66,24 @@
|
||||
<appender-ref ref="LOG-ROOT"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</root>
|
||||
|
||||
<logger name="org.springframework.web.servlet.DispatcherServlet" additivity="false">
|
||||
<!-- 打印请求信息方式二-->
|
||||
<level value="debug"/>
|
||||
<appender-ref ref="LOG-ROOT"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</logger>
|
||||
|
||||
<!--请求响应日志-->
|
||||
<logger name="io.jpom.system.WebAopLog" additivity="false">
|
||||
<level value="INFO"/>
|
||||
<appender-ref ref="LOG-ROOT"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</logger>
|
||||
|
||||
<logger name="io.jpom" additivity="false">
|
||||
<level value="debug"/>
|
||||
<appender-ref ref="LOG-ROOT"/>
|
||||
<appender-ref ref="STDOUT"/>
|
||||
</logger>
|
||||
</configuration>
|
||||
|
@ -75,13 +75,7 @@ public class NodeModel extends BaseGroupModel {
|
||||
* 锁定类型
|
||||
*/
|
||||
private String unLockType;
|
||||
/**
|
||||
* 监控周期
|
||||
*
|
||||
* @see io.jpom.model.Cycle
|
||||
*/
|
||||
@Deprecated
|
||||
private Integer cycle;
|
||||
|
||||
/**
|
||||
* http 代理
|
||||
*/
|
||||
|
@ -67,6 +67,10 @@ public class NodeService extends BaseGroupService<NodeModel> {
|
||||
@Lazy
|
||||
private WorkspaceService workspaceService;
|
||||
|
||||
@Resource
|
||||
@Lazy
|
||||
private ProjectInfoCacheService projectInfoCacheService;
|
||||
|
||||
public NodeService(SshService sshService) {
|
||||
this.sshService = sshService;
|
||||
}
|
||||
@ -89,7 +93,7 @@ public class NodeService extends BaseGroupService<NodeModel> {
|
||||
// 检查是否可用默认为5秒,避免太长时间无法连接一直等待
|
||||
nodeModel.setTimeOut(5);
|
||||
//
|
||||
JsonMessage<Object> objectJsonMessage = NodeForward.requestBySys(nodeModel, NodeUrl.Info, "nodeId", nodeModel.getId());
|
||||
JsonMessage<JpomManifest> objectJsonMessage = NodeForward.requestBySys(nodeModel, NodeUrl.Info, "nodeId", nodeModel.getId());
|
||||
try {
|
||||
JpomManifest jpomManifest = objectJsonMessage.getData(JpomManifest.class);
|
||||
Assert.notNull(jpomManifest, "节点连接失败,请检查节点是否在线");
|
||||
@ -152,9 +156,10 @@ public class NodeService extends BaseGroupService<NodeModel> {
|
||||
SshModel byKey = sshService.getByKey(sshId, request);
|
||||
Assert.notNull(byKey, "对应的 SSH 不存在");
|
||||
List<NodeModel> nodeBySshId = this.getNodeBySshId(sshId);
|
||||
nodeBySshId = ObjectUtil.defaultIfNull(nodeBySshId, Collections.EMPTY_LIST);
|
||||
Optional<NodeModel> any = nodeBySshId.stream().filter(nodeModel2 -> !StrUtil.equals(id, nodeModel2.getId())).findAny();
|
||||
Assert.state(!any.isPresent(), "对应的SSH已经被其他节点绑定啦");
|
||||
nodeBySshId = ObjectUtil.defaultIfNull(nodeBySshId, Collections.emptyList());
|
||||
boolean anyMatch = nodeBySshId.stream().anyMatch(nodeModel2 -> !StrUtil.equals(id, nodeModel2.getId()));
|
||||
// Optional<NodeModel> any = anyMatch.findAny();
|
||||
Assert.state(!anyMatch, "对应的SSH已经被其他节点绑定啦");
|
||||
}
|
||||
if (nodeModel.isOpenStatus()) {
|
||||
//
|
||||
@ -165,7 +170,6 @@ public class NodeService extends BaseGroupService<NodeModel> {
|
||||
|
||||
this.insert(nodeModel);
|
||||
// 同步项目
|
||||
ProjectInfoCacheService projectInfoCacheService = SpringUtil.getBean(ProjectInfoCacheService.class);
|
||||
projectInfoCacheService.syncNode(nodeModel);
|
||||
} else {
|
||||
this.update(nodeModel);
|
||||
@ -292,7 +296,6 @@ public class NodeService extends BaseGroupService<NodeModel> {
|
||||
*/
|
||||
private void fillNodeInfo(NodeModel nodeModel) {
|
||||
nodeModel.setProtocol(StrUtil.emptyToDefault(nodeModel.getProtocol(), "http"));
|
||||
nodeModel.setCycle(0);
|
||||
nodeModel.setOpenStatus(ObjectUtil.defaultIfNull(nodeModel.getOpenStatus(), 0));
|
||||
}
|
||||
|
||||
|
@ -176,8 +176,7 @@ public class InitDb implements DisposableBean, ApplicationContextAware {
|
||||
//
|
||||
} catch (Exception e) {
|
||||
log.error("初始化数据库失败 {}", sqlFileNow[0], e);
|
||||
System.exit(0);
|
||||
return;
|
||||
throw Lombok.sneakyThrow(e);
|
||||
}
|
||||
dbConfig.initOk();
|
||||
log.info("h2 db Successfully loaded, url is 【{}】", dbUrl);
|
||||
|
@ -109,10 +109,6 @@ spring:
|
||||
web:
|
||||
resources:
|
||||
static-locations: classpath:/dist/
|
||||
application:
|
||||
name: jpom server
|
||||
profiles:
|
||||
active: default
|
||||
mvc:
|
||||
throw-exception-if-no-handler-found: true
|
||||
log-request-details: true
|
||||
@ -124,7 +120,7 @@ spring:
|
||||
h2:
|
||||
console:
|
||||
# 是否开启 web 访问数据库(url: http://${ip}:${port}/h2-console)
|
||||
enabled: false
|
||||
enabled: true
|
||||
# 是否允许远程访问(开启此配置有安全风险),默认为 false(当部署到服务器上之后,是否可以通过其他浏览器访问数据库)
|
||||
settings:
|
||||
web-allow-others: false
|
||||
|
@ -21,23 +21,4 @@
|
||||
-- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
--
|
||||
|
||||
|
||||
-- 命令行信息
|
||||
CREATE TABLE IF NOT EXISTS PUBLIC.COMMAND_MODEL
|
||||
(
|
||||
ID VARCHAR(50) not null comment 'id',
|
||||
CREATETIMEMILLIS BIGINT COMMENT '数据创建时间',
|
||||
MODIFYTIMEMILLIS BIGINT COMMENT '数据修改时间',
|
||||
`NAME` VARCHAR(100) comment '命令名称',
|
||||
DESC VARCHAR(500) comment '命令描述',
|
||||
COMMAND CLOB comment '指令内容',
|
||||
EXECUTIONROLE VARCHAR(100) comment '执行用户,默认为root',
|
||||
executionPath VARCHAR(200) comment '执行路径,默认为/root',
|
||||
TIMEOUT int DEFAULT 60 comment '超时时间,单位:秒,默认60',
|
||||
TYPE int DEFAULT 0 comment '命令类型,0-shell,1-powershell',
|
||||
PARAMS CLOB comment '命令参数',
|
||||
MODIFYUSER VARCHAR(50) comment '修改人',
|
||||
STRIKE int DEFAULT 0 comment '逻辑删除{1,删除,0 未删除(默认)}',
|
||||
CONSTRAINT COMMAND_MODEL_PK PRIMARY KEY (ID)
|
||||
);
|
||||
comment on table COMMAND_MODEL is '命令行信息';
|
||||
ALTER TABLE NODE_INFO DROP COLUMN IF EXISTS `cycle`;
|
Loading…
Reference in New Issue
Block a user