Compare commits

10 Commits

Author SHA1 Message Date
oyo
b2569c2eba 删除 template/TOCO.md 2025-10-14 11:38:28 +08:00
oyo
670b15774c 添加 template/.toco/README 2025-10-14 11:36:50 +08:00
oyo
5c8a96034c 更新 template/.toco/toco/README 2025-10-14 11:22:05 +08:00
oyo
49fc2dbff2 添加 template/.toco/toco/README 2025-10-14 11:20:28 +08:00
oyo
08e6fca59d 添加 template/.toco/plan/README 2025-10-14 11:17:56 +08:00
oyo
03faa454a6 添加 template/.toco/modeling/README 2025-10-14 11:17:34 +08:00
oyo
7bf4c268ce 添加 template/.toco/global/README 2025-10-14 11:17:13 +08:00
oyo
e2207ad688 添加 template/.toco/design/README 2025-10-14 11:16:54 +08:00
oyo
257f3b1baf 添加 template/.toco/coding/README 2025-10-14 11:16:34 +08:00
oyo
0580907b37 添加 template/TOCO.md 2025-10-14 11:15:54 +08:00
5 changed files with 17 additions and 90 deletions

7
template/.gitignore vendored
View File

@@ -33,10 +33,3 @@ logs/
!modules/.gitkeep
.gitattributes
.toco/config.local.yml
.fslckout
_FOSSIL_
_FOSSIL_-journal
.fslckout
.fslckout-journal
*.pem

View File

@@ -63,11 +63,6 @@
<artifactId>rocketmq-client</artifactId>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>

View File

@@ -1,71 +0,0 @@
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;
}
}

View File

@@ -128,4 +128,3 @@ liteflow.monitor.enable-log=true
#create default table auto
vs.db.basetable.create=true
server.ssl.enabled=false

View File

@@ -80,7 +80,6 @@
<ox.sprintboot.web.starter.version>1.0-SNAPSHOT</ox.sprintboot.web.starter.version>
<ox.basidc.common>1.0-SNAPSHOT</ox.basidc.common>
<vs.sqlmapper.spring>1.0.0-SNAPSHOT</vs.sqlmapper.spring>
<jjwt.version>0.9.1</jjwt.version>
{{- if eq .dbType "dm" }}
<dm.driver.version>18</dm.driver.version>
<db.hiernate.dialect.version>8.1.3.140</db.hiernate.dialect.version>
@@ -372,11 +371,6 @@
<artifactId>opensearch-rest-high-level-client</artifactId>
<version>${opensearch.version}</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
@@ -474,6 +468,23 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.43.0</version>
<configuration>
<java>
<googleJavaFormat>
<groupArtifact>com.google.googlejavaformat:google-java-format</groupArtifact>
<version>1.22.0</version>
<style>AOSP</style>
<reorderImports>true</reorderImports>
<reflowLongStrings>true</reflowLongStrings>
<formatJavadoc>true</formatJavadoc>
</googleJavaFormat>
</java>
</configuration>
</plugin>
</plugins>
</build>
<modules>