From 8c61ae71395d62a0a050b8f32a1f78f24df350cb Mon Sep 17 00:00:00 2001 From: lingniu Date: Wed, 1 Jul 2026 08:15:55 +0800 Subject: [PATCH] chore: add yuejin gb32960 platform config --- deploy/portainer/docker-compose.yml | 3 +++ .../src/main/resources/application.yml | 8 +++++++- .../gb32960app/Gb32960IngestAppDefaultsTest.java | 15 +++++++++++++++ .../PortainerComposeResourceLimitsTest.java | 14 ++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/deploy/portainer/docker-compose.yml b/deploy/portainer/docker-compose.yml index 103353cc..9a71234c 100644 --- a/deploy/portainer/docker-compose.yml +++ b/deploy/portainer/docker-compose.yml @@ -62,6 +62,9 @@ services: GB32960_PLATFORM_USER_HYUNDAI: ${GB32960_PLATFORM_USER_HYUNDAI:-Hyundai} GB32960_PLATFORM_PWD_HYUNDAI: ${GB32960_PLATFORM_PWD_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} ports: - "${GB32960_HTTP_PORT:-20100}:20100" diff --git a/modules/apps/gb32960-ingest-app/src/main/resources/application.yml b/modules/apps/gb32960-ingest-app/src/main/resources/application.yml index 2771e184..9b208a2d 100644 --- a/modules/apps/gb32960-ingest-app/src/main/resources/application.yml +++ b/modules/apps/gb32960-ingest-app/src/main/resources/application.yml @@ -49,10 +49,15 @@ lingniu: whitelist: [] platforms: - username: ${GB32960_PLATFORM_USER_HYUNDAI:Hyundai} - password: ${GB32960_PLATFORM_PWD_HYUNDAI:f2e3445d7cda409fb4f278f6fb890734} + password: ${GB32960_PLATFORM_PWD_HYUNDAI:} allowed-ips: - ${GB32960_PLATFORM_IP_HYUNDAI:} description: 外部下级平台 - Hyundai + - username: ${GB32960_PLATFORM_USER_YUEJIN:YueJin} + password: ${GB32960_PLATFORM_PWD_YUEJIN:} + allowed-ips: + - ${GB32960_PLATFORM_IP_YUEJIN:} + description: 外部下级平台 - YueJin tls: enabled: ${GB32960_TLS_ENABLED:false} cert-path: ${GB32960_TLS_CERT:} @@ -64,6 +69,7 @@ lingniu: match: platform-accounts: - Hyundai + - YueJin vin-prefixes: [] vins: [] parse: diff --git a/modules/apps/gb32960-ingest-app/src/test/java/com/lingniu/ingest/gb32960app/Gb32960IngestAppDefaultsTest.java b/modules/apps/gb32960-ingest-app/src/test/java/com/lingniu/ingest/gb32960app/Gb32960IngestAppDefaultsTest.java index d50d63e1..bfad7674 100644 --- a/modules/apps/gb32960-ingest-app/src/test/java/com/lingniu/ingest/gb32960app/Gb32960IngestAppDefaultsTest.java +++ b/modules/apps/gb32960-ingest-app/src/test/java/com/lingniu/ingest/gb32960app/Gb32960IngestAppDefaultsTest.java @@ -28,6 +28,18 @@ class Gb32960IngestAppDefaultsTest { .containsEntry("lingniu.ingest.gb32960.enabled", true) .containsEntry("lingniu.ingest.gb32960.server.enabled", true) .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.consumer.enabled", false) .containsEntry("lingniu.ingest.sink.archive.enabled", "${SINK_ARCHIVE_ENABLED:true}") @@ -45,6 +57,9 @@ class Gb32960IngestAppDefaultsTest { assertThat(properties.stringPropertyNames()) .noneMatch(name -> name.startsWith("lingniu.ingest.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() { diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java index 8555d34a..3129772c 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java @@ -21,6 +21,20 @@ class PortainerComposeResourceLimitsTest { 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 void vehicleHistoryUsesApplicationConsumerGroupEnvironmentNames() throws IOException { String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml"));