fix(db): make KingbaseES driver opt-in and restore default SSRF guard

The KingbaseES JDBC driver is not on Maven Central; declaring it as a
required runtime dependency broke the default build for anyone without
the proprietary jar. Move it into an opt-in `kingbase` Maven profile
(build with `mvn package -Pkingbase`). No Java code imports the driver
classes — it is loaded at runtime via driver-class-name only, so the
default build no longer needs it.

Also drop `mateclaw.browser.ssrf-check-enabled: false` from the default
application.yml: the code default is true, and disabling the SSRF guard
globally is unrelated to KingbaseES support.
This commit is contained in:
matevip 2026-06-14 10:33:23 +08:00
parent 446f34b6b5
commit 25a83ad858
2 changed files with 29 additions and 21 deletions

View File

@ -349,27 +349,18 @@
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- ===== KingbaseES (人大金仓) JDBC Driver ===== -->
<!-- <!--
KingbaseES JDBC driver is NOT available on Maven Central. KingbaseES (人大金仓) JDBC driver is NOT on Maven Central, so it is
Install it manually before building: declared in the opt-in `kingbase` Maven profile instead of here.
mvn install:install-file \\ The default build never resolves it. To build with KingbaseES:
-Dfile=/path/to/kingbase8-8.6.0.jar \\ 1. install the driver: mvn install:install-file \
-DgroupId=com.kingbase8 \\ -Dfile=${KINGBASE_HOME}/Interface/jdbc/kingbase8-8.6.0.jar \
-DartifactId=kingbase8 \\ -DgroupId=com.kingbase8 -DartifactId=kingbase8 \
-Dversion=8.6.0 \\ -Dversion=8.6.0 -Dpackaging=jar
-Dpackaging=jar 2. build with the profile: mvn package -Pkingbase
No Java code imports com.kingbase8.* — the driver is loaded at
Or configure a private Maven repository that hosts the driver. runtime via spring.datasource.driver-class-name only.
The driver JAR can be obtained from the KingbaseES installation
directory: ${KINGBASE_HOME}/Interface/jdbc/kingbase8-8.6.0.jar
--> -->
<dependency>
<groupId>com.kingbase8</groupId>
<artifactId>kingbase8</artifactId>
<version>8.6.0</version>
<scope>runtime</scope>
</dependency>
<!-- ===== Spring Boot Test ===== --> <!-- ===== Spring Boot Test ===== -->
<dependency> <dependency>
@ -503,5 +494,24 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<!--
Profile: KingbaseES (人大金仓) JDBC driver.
The driver is not published to Maven Central, so it is kept out of the
default build to keep `mvn package` resolvable for everyone. Install the
driver into the local repository, then build with `mvn package -Pkingbase`.
Runtime selection is via the `kingbase` Spring profile (application-kingbase.yml).
-->
<profile>
<id>kingbase</id>
<dependencies>
<dependency>
<groupId>com.kingbase8</groupId>
<artifactId>kingbase8</artifactId>
<version>8.6.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
</profiles> </profiles>
</project> </project>

View File

@ -131,8 +131,6 @@ mateclaw:
# Set this when agents deliver download links to channels/clients that cannot # Set this when agents deliver download links to channels/clients that cannot
# resolve a relative URL (IM messages, copied links, external downloads). # resolve a relative URL (IM messages, copied links, external downloads).
public-base-url: ${MATECLAW_PUBLIC_BASE_URL:} public-base-url: ${MATECLAW_PUBLIC_BASE_URL:}
browser:
ssrf-check-enabled: false
jwt: jwt:
secret: ${JWT_SECRET:MateClaw-JWT-Secret-Key-2024-Please-Change-In-Production} secret: ${JWT_SECRET:MateClaw-JWT-Secret-Key-2024-Please-Change-In-Production}
expiration: 86400000 expiration: 86400000