chore: add yuejin gb32960 platform config

This commit is contained in:
lingniu
2026-07-01 08:15:55 +08:00
parent 37902be034
commit 8c61ae7139
4 changed files with 39 additions and 1 deletions

View File

@@ -62,6 +62,9 @@ services:
GB32960_PLATFORM_USER_HYUNDAI: ${GB32960_PLATFORM_USER_HYUNDAI:-Hyundai} GB32960_PLATFORM_USER_HYUNDAI: ${GB32960_PLATFORM_USER_HYUNDAI:-Hyundai}
GB32960_PLATFORM_PWD_HYUNDAI: ${GB32960_PLATFORM_PWD_HYUNDAI:-} GB32960_PLATFORM_PWD_HYUNDAI: ${GB32960_PLATFORM_PWD_HYUNDAI:-}
GB32960_PLATFORM_IP_HYUNDAI: ${GB32960_PLATFORM_IP_HYUNDAI:-} GB32960_PLATFORM_IP_HYUNDAI: ${GB32960_PLATFORM_IP_HYUNDAI:-}
GB32960_PLATFORM_USER_YUEJIN: ${GB32960_PLATFORM_USER_YUEJIN:-YueJin}
GB32960_PLATFORM_PWD_YUEJIN: ${GB32960_PLATFORM_PWD_YUEJIN:-}
GB32960_PLATFORM_IP_YUEJIN: ${GB32960_PLATFORM_IP_YUEJIN:-}
GB32960_TLS_ENABLED: ${GB32960_TLS_ENABLED:-false} GB32960_TLS_ENABLED: ${GB32960_TLS_ENABLED:-false}
ports: ports:
- "${GB32960_HTTP_PORT:-20100}:20100" - "${GB32960_HTTP_PORT:-20100}:20100"

View File

@@ -49,10 +49,15 @@ lingniu:
whitelist: [] whitelist: []
platforms: platforms:
- username: ${GB32960_PLATFORM_USER_HYUNDAI:Hyundai} - username: ${GB32960_PLATFORM_USER_HYUNDAI:Hyundai}
password: ${GB32960_PLATFORM_PWD_HYUNDAI:f2e3445d7cda409fb4f278f6fb890734} password: ${GB32960_PLATFORM_PWD_HYUNDAI:}
allowed-ips: allowed-ips:
- ${GB32960_PLATFORM_IP_HYUNDAI:} - ${GB32960_PLATFORM_IP_HYUNDAI:}
description: 外部下级平台 - Hyundai description: 外部下级平台 - Hyundai
- username: ${GB32960_PLATFORM_USER_YUEJIN:YueJin}
password: ${GB32960_PLATFORM_PWD_YUEJIN:}
allowed-ips:
- ${GB32960_PLATFORM_IP_YUEJIN:}
description: 外部下级平台 - YueJin
tls: tls:
enabled: ${GB32960_TLS_ENABLED:false} enabled: ${GB32960_TLS_ENABLED:false}
cert-path: ${GB32960_TLS_CERT:} cert-path: ${GB32960_TLS_CERT:}
@@ -64,6 +69,7 @@ lingniu:
match: match:
platform-accounts: platform-accounts:
- Hyundai - Hyundai
- YueJin
vin-prefixes: [] vin-prefixes: []
vins: [] vins: []
parse: parse:

View File

@@ -28,6 +28,18 @@ class Gb32960IngestAppDefaultsTest {
.containsEntry("lingniu.ingest.gb32960.enabled", true) .containsEntry("lingniu.ingest.gb32960.enabled", true)
.containsEntry("lingniu.ingest.gb32960.server.enabled", true) .containsEntry("lingniu.ingest.gb32960.server.enabled", true)
.containsEntry("lingniu.ingest.gb32960.port", "${GB32960_PORT:32960}") .containsEntry("lingniu.ingest.gb32960.port", "${GB32960_PORT:32960}")
.containsEntry("lingniu.ingest.gb32960.auth.platforms[0].username",
"${GB32960_PLATFORM_USER_HYUNDAI:Hyundai}")
.containsEntry("lingniu.ingest.gb32960.auth.platforms[0].password",
"${GB32960_PLATFORM_PWD_HYUNDAI:}")
.containsEntry("lingniu.ingest.gb32960.auth.platforms[1].username",
"${GB32960_PLATFORM_USER_YUEJIN:YueJin}")
.containsEntry("lingniu.ingest.gb32960.auth.platforms[1].password",
"${GB32960_PLATFORM_PWD_YUEJIN:}")
.containsEntry("lingniu.ingest.gb32960.vendor-extensions[0].match.platform-accounts[0]",
"Hyundai")
.containsEntry("lingniu.ingest.gb32960.vendor-extensions[0].match.platform-accounts[1]",
"YueJin")
.containsEntry("lingniu.ingest.sink.mq.enabled", "${KAFKA_ENABLED:true}") .containsEntry("lingniu.ingest.sink.mq.enabled", "${KAFKA_ENABLED:true}")
.containsEntry("lingniu.ingest.sink.mq.consumer.enabled", false) .containsEntry("lingniu.ingest.sink.mq.consumer.enabled", false)
.containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED:true}") .containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED:true}")
@@ -45,6 +57,9 @@ class Gb32960IngestAppDefaultsTest {
assertThat(properties.stringPropertyNames()) assertThat(properties.stringPropertyNames())
.noneMatch(name -> name.startsWith("lingniu.ingest.event-file-store.")); .noneMatch(name -> name.startsWith("lingniu.ingest.event-file-store."));
assertThat(applicationYaml()).doesNotContain("event-file-store:"); assertThat(applicationYaml()).doesNotContain("event-file-store:");
assertThat(applicationYaml())
.contains("password: ${GB32960_PLATFORM_PWD_HYUNDAI:}")
.contains("password: ${GB32960_PLATFORM_PWD_YUEJIN:}");
} }
private static Properties applicationProperties() { private static Properties applicationProperties() {

View File

@@ -21,6 +21,20 @@ class PortainerComposeResourceLimitsTest {
assertServiceMemoryLimit(compose, "vehicle-analytics-app", "VEHICLE_ANALYTICS_MEM_LIMIT", "1024m"); assertServiceMemoryLimit(compose, "vehicle-analytics-app", "VEHICLE_ANALYTICS_MEM_LIMIT", "1024m");
} }
@Test
void gb32960ComposeExposesBothPlatformAccountsWithoutSecrets() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));
String gb32960Service = serviceBlock(compose, "gb32960-ingest-app");
assertThat(gb32960Service)
.contains("GB32960_PLATFORM_USER_HYUNDAI: ${GB32960_PLATFORM_USER_HYUNDAI:-Hyundai}")
.contains("GB32960_PLATFORM_PWD_HYUNDAI: ${GB32960_PLATFORM_PWD_HYUNDAI:-}")
.contains("GB32960_PLATFORM_IP_HYUNDAI: ${GB32960_PLATFORM_IP_HYUNDAI:-}")
.contains("GB32960_PLATFORM_USER_YUEJIN: ${GB32960_PLATFORM_USER_YUEJIN:-YueJin}")
.contains("GB32960_PLATFORM_PWD_YUEJIN: ${GB32960_PLATFORM_PWD_YUEJIN:-}")
.contains("GB32960_PLATFORM_IP_YUEJIN: ${GB32960_PLATFORM_IP_YUEJIN:-}");
}
@Test @Test
void vehicleHistoryUsesApplicationConsumerGroupEnvironmentNames() throws IOException { void vehicleHistoryUsesApplicationConsumerGroupEnvironmentNames() throws IOException {
String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml")); String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));