diff --git a/template/.gitignore b/template/.gitignore index c2255f4..5c4a67d 100644 --- a/template/.gitignore +++ b/template/.gitignore @@ -33,3 +33,10 @@ logs/ !modules/.gitkeep .gitattributes .toco/config.local.yml +.fslckout +_FOSSIL_ +_FOSSIL_-journal +.fslckout +.fslckout-journal + +*.pem \ No newline at end of file diff --git a/template/.toco/README b/template/.toco/README new file mode 100644 index 0000000..37d9861 --- /dev/null +++ b/template/.toco/README @@ -0,0 +1,8 @@ +目录用于存放rules,只支持.md文件。 + +global: 目录用于存放所有agent通用rules +toco: 目录用于存放Toco Agent专用rules,用于外层流程整体控制 +modeling:目录用于存放Modeling Agent专用rules,用于领域建模阶段 +plan: 目录用于存放Plan Agent专用rules,用于整体规划阶段 +design:目录用于存放Design Agent专用rules,用于TOCO设计元素设计 +coding:目录用于存放Coding Agent专用rules,用于编码阶段 \ No newline at end of file diff --git a/template/.toco/coding/README b/template/.toco/coding/README new file mode 100644 index 0000000..853d163 --- /dev/null +++ b/template/.toco/coding/README @@ -0,0 +1 @@ +目录用于存放Coding Agent专用rules,用于编码阶段,只支持.md文件 \ No newline at end of file diff --git a/template/.toco/design/README b/template/.toco/design/README new file mode 100644 index 0000000..51a2107 --- /dev/null +++ b/template/.toco/design/README @@ -0,0 +1 @@ +目录用于存放Design Agent专用rules,用于TOCO设计元素设计,只支持.md文件 \ No newline at end of file diff --git a/template/.toco/global/README b/template/.toco/global/README new file mode 100644 index 0000000..3ce091c --- /dev/null +++ b/template/.toco/global/README @@ -0,0 +1 @@ +目录用于存放所有agent通用rules,只支持.md文件 \ No newline at end of file diff --git a/template/.toco/modeling/README b/template/.toco/modeling/README new file mode 100644 index 0000000..7aa52d8 --- /dev/null +++ b/template/.toco/modeling/README @@ -0,0 +1 @@ +目录用于存放Modeling Agent专用rules,用于领域建模阶段,只支持.md文件 \ No newline at end of file diff --git a/template/.toco/plan/README b/template/.toco/plan/README new file mode 100644 index 0000000..78bf077 --- /dev/null +++ b/template/.toco/plan/README @@ -0,0 +1 @@ +目录用于存放Plan Agent专用rules,用于整体规划阶段,只支持.md文件 \ No newline at end of file diff --git a/template/.toco/toco/README b/template/.toco/toco/README new file mode 100644 index 0000000..621f823 --- /dev/null +++ b/template/.toco/toco/README @@ -0,0 +1 @@ +目录用于存放Toco Agent专用rules,用于外层流程整体控制,只支持.md文件 \ No newline at end of file diff --git a/template/common/pom.xml b/template/common/pom.xml index 8c75673..fdf7930 100644 --- a/template/common/pom.xml +++ b/template/common/pom.xml @@ -63,6 +63,11 @@ rocketmq-client + + io.jsonwebtoken + jjwt + + org.apache.tomcat.embed tomcat-embed-core diff --git a/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/config/SSLConfig.java b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/config/SSLConfig.java new file mode 100644 index 0000000..ce97ed4 --- /dev/null +++ b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/config/SSLConfig.java @@ -0,0 +1,71 @@ +package {{ .package }}.entrance.web.config; + +import org.apache.catalina.connector.Connector; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.env.Environment; +import org.springframework.core.io.ClassPathResource; + +import java.io.IOException; + +@Configuration +public class SSLConfig { + + @Bean + public ServletWebServerFactory servletContainer(Environment env) { + TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); + + // 禁用自动配置的SSL(如果存在) + tomcat.setRegisterDefaultServlet(false); + + if (hasSslConfig(env)) { + tomcat.addAdditionalTomcatConnectors(createSslConnector(env)); + } + + return tomcat; + } + + private boolean hasSslConfig(Environment env) { + return env.containsProperty("ssl_certificate") + && env.containsProperty("ssl_certificate-private-key"); + } + + private Connector createSslConnector(Environment env) { + String certPath = env.getProperty("ssl_certificate"); + String keyPath = env.getProperty("ssl_certificate-private-key"); + String httpsPort = env.getProperty("server.https.port", "8443"); + + Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); + connector.setScheme("https"); + connector.setSecure(true); + connector.setPort(Integer.parseInt(httpsPort)); + + // 明确设置SSL配置 + connector.setProperty("SSLEnabled", "true"); + connector.setProperty("sslProtocol", "TLS"); + connector.setProperty("clientAuth", "false"); + connector.setProperty("sslEnabledProtocols", "TLSv1.2,TLSv1.3"); + + // 处理证书路径 + connector.setProperty("certificateFile", extractFilePath(certPath)); + connector.setProperty("certificateKeyFile", extractFilePath(keyPath)); + + return connector; + } + + private String extractFilePath(String classpathResource) { + if (classpathResource == null) return null; + + if (classpathResource.startsWith("classpath:")) { + String resource = classpathResource.substring("classpath:".length()); + try { + return new ClassPathResource(resource).getFile().getAbsolutePath(); + } catch (IOException e) { + throw new RuntimeException("Failed to locate SSL certificate file", e); + } + } + return classpathResource; + } +} \ No newline at end of file diff --git a/template/entrance/web/src/main/resources/application-local.properties b/template/entrance/web/src/main/resources/application-local.properties index 777b292..ac2cabc 100644 --- a/template/entrance/web/src/main/resources/application-local.properties +++ b/template/entrance/web/src/main/resources/application-local.properties @@ -128,3 +128,4 @@ liteflow.monitor.enable-log=true #create default table auto vs.db.basetable.create=true +server.ssl.enabled=false diff --git a/template/pom.xml b/template/pom.xml index a1fd35c..7db37bf 100644 --- a/template/pom.xml +++ b/template/pom.xml @@ -80,6 +80,7 @@ 1.0-SNAPSHOT 1.0-SNAPSHOT 1.0.0-SNAPSHOT + 0.9.1 {{- if eq .dbType "dm" }} 18 8.1.3.140 @@ -371,6 +372,11 @@ opensearch-rest-high-level-client ${opensearch.version} + + io.jsonwebtoken + jjwt + ${jjwt.version} + org.hibernate hibernate-core @@ -468,23 +474,6 @@ true - - com.diffplug.spotless - spotless-maven-plugin - 2.43.0 - - - - com.google.googlejavaformat:google-java-format - 1.22.0 - - true - true - true - - - -