diff --git a/service-cli/service-cli-core/src/main/java/com/lanyuanxiaoyao/service/cli/core/RuntimeInfo.java b/service-cli/service-cli-core/src/main/java/com/lanyuanxiaoyao/service/cli/core/RuntimeInfo.java
index 524ec90..6ebca98 100644
--- a/service-cli/service-cli-core/src/main/java/com/lanyuanxiaoyao/service/cli/core/RuntimeInfo.java
+++ b/service-cli/service-cli-core/src/main/java/com/lanyuanxiaoyao/service/cli/core/RuntimeInfo.java
@@ -17,6 +17,7 @@ public class RuntimeInfo {
private String zkUrl;
private String eurekaUrl;
private HudiInfo hudi;
+ private SecurityInfo security;
public String getUser() {
return user;
@@ -98,6 +99,14 @@ public class RuntimeInfo {
this.hudi = hudi;
}
+ public SecurityInfo getSecurity() {
+ return security;
+ }
+
+ public void setSecurity(SecurityInfo security) {
+ this.security = security;
+ }
+
@Override
public String toString() {
return "RuntimeInfo{" +
@@ -111,6 +120,7 @@ public class RuntimeInfo {
", zkUrl='" + zkUrl + '\'' +
", eurekaUrl='" + eurekaUrl + '\'' +
", hudi=" + hudi +
+ ", security=" + security +
'}';
}
@@ -152,4 +162,43 @@ public class RuntimeInfo {
'}';
}
}
+
+ public static final class SecurityInfo {
+ private String authority;
+ private String username;
+ private String darkcode;
+
+ public String getAuthority() {
+ return authority;
+ }
+
+ public void setAuthority(String authority) {
+ this.authority = authority;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getDarkcode() {
+ return darkcode;
+ }
+
+ public void setDarkcode(String darkcode) {
+ this.darkcode = darkcode;
+ }
+
+ @Override
+ public String toString() {
+ return "SecurityInfo{" +
+ "authority='" + authority + '\'' +
+ ", username='" + username + '\'' +
+ ", darkcode='" + darkcode + '\'' +
+ '}';
+ }
+ }
}
diff --git a/service-cli/service-cli-runner/src/main/resources/application.yml b/service-cli/service-cli-runner/src/main/resources/application.yml
index ca6d580..2a945b2 100644
--- a/service-cli/service-cli-runner/src/main/resources/application.yml
+++ b/service-cli/service-cli-runner/src/main/resources/application.yml
@@ -9,11 +9,15 @@ deploy:
loki-base-url: http://132.122.116.142:33100
loki-url: ${deploy.runtime.loki-base-url}/loki/api/v1/push
zk-url: b5m1.hdp.dc:2181,b5m2.hdp.dc:2181,b5m3.hdp.dc:2181
- eureka-url: http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.142:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.143:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.144:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.145:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.146:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.147:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.148:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.149:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.150:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.151:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.152:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.153:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.154:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.155:35670/eureka/,http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.156:35670/eureka
+ eureka-url: ENC(1gFdUy0/FYxDMK910ZS65qNqdULnnSOPrR8EkqrZ3zYXsTP9kk8y55C7WbcxM5vaa1KIDNEqilEIA2sOLX3920gu3Woq805pf8dzxl9/velQWdaTFUxn9XqypuP+p/bSyY3upCYehCZFWgPPSn8ag0m3JKSofkk9V4mO+WswxFDlWiM1P5Om7Ev7WsWSIYMqhN2viRjCscctrIkxh3trIgsb9qfw5snNYZvh+gHRQJ1GA0VYlLmqJLvasKcHSzKGabu8iRAnXMHaAv7jwgdMpHBz7uBeeQh+BIFqurSEotjRG+TlmidLA8X0BWiRTGiGp9X9mV/5Zm5QkBp1em8L1D9+wz8R9rn8eFPXMSHhlqocxKl7ZJgnzSfu9CS67y5k7PzSIjkViN01HTPzg36zyv9xzqVt5W+7rXbQJpmXLXfUAPsjRP/ns0a6ly0jkHoIOHqapZcJ8gVCVH46D0e5C59h57Q6iX/BW0f8VIsH4HfbSGi2doRqNVqbIRwdVnkzUMDihhKNvLFTh70H20v1uw6wNZclYF1wh9Lkn28TKqz/y45FbxhRwjBCvWu55R8/qSkfR2K/QyLw4WvE3raG23fssN2BYlNA/x9OaGBWPXVUZcphGl6rPUZeAqXVKms/qcRuLOzZrZMv42OeKFk/NzR8BrwiXN7NafhXrvH1CNN0b69t7jGqS5+sIwkBjNtD+J17G9G8qUB9ETH6C+uRO4MWJ+KesERdI3E0PIqzimTQiV60lzVL4kYB5KJuDnw0LAsxpu3a5VgKWIZzF/zWXZcBQTeea0IKRBEeujwTCecvaNTjd+x53jwTSobCyL4ADt2hcGHOGMcynuryZYh++XTMEjx0P/cMxXqHDXqb21liJftWmMzqyQ5HHQZCY6Mg1Lh8FsLaV3vyl142rbXan0NwolIGJ96QZ7PoNa9zeQOgcwXvGjHnpzZWsOwq/90Bnl1JDcm0MJpjAq2LnZN5r/7aa74TvC54Pu4jMMzZMdyrUS0bWAxF9NS2erfP2BPywI2AwSGgvl7qh2Sx4d/nh1984TTwtK5jDd+LIdml8SfVIcBfNG3dPvlrJN6TmvbBxtRRFo1lXX47axfr6kL6DNDUPTFbnZRjK0RLRuNdIueLhcUCLAJfVrP0jz4axcg12ZdRU4oPUTQg7m6blN5IjJu90GcHXia2kPXudSQidQLBIrE6RrZxUYO3DPwUXzVvOwYmuGzu2TJWS4vLYR00jDMCEv/Gosy0zurzs/zLCA/awGlR4c3InQo8IahyDh2faSNljCnfUPMMgfl/vE8BBODCKX18m2a+xvyHn+out4sB6MwBqRwINn5/QWKw8qqMOPS5rmLHvPUi8BdZZnetFk2najdRib7o1SdUG1Sn3pDOYRHXVXxoHxebSyAl5ybzis9PAlc9MTJnxM1qVEEdzwUBPElDuPOE8Zr2lYhz4/RKWnwd7BG2WUP3YYVyQmDL/H00xQCagUBoQ6CD3sKmTZSFkJUAKX3r1t+K1LqqjkyYP6XSvgp7ha8CsW4ssPhCFKgieUMR5T8cFVV2tSxLEJTlm15GLVFgiWtmTsHlZ32CU388BUYqVvtv4gNvgxOxfr9suFNa4V/xRTxlpsLjQ+GSSBMHznVykxf9Buk05CuuqfW8U4Ulgc+9LxXpKFcKAHjXe3Hj5RghtuOz+Nb+Iyi3sZibeLjqYoS0pWOE5g44azVPyeSunOWCNmlQI6lwEm/st6FoupwkI70X+V5Mthd90lnFpUtp49GlC81jJZ2zSiKV7ZFGsZfLEDQRU12S)
hudi:
app-hdfs-path: hdfs://b2/apps/datalake/jars/app
archive-hdfs-path: hdfs://b2/apps/datalake/flink/completed-jobs-hudi
victoria-push-url: http://132.122.116.142:35710/api/v1/import/prometheus
+ security:
+ authority: ENC(GXKnbq1LS11U2HaONspvH+D/TkIx13aWTaokdkzaF7HSvq6Z0Rv1+JUWFnYopVXu)
+ username: ENC(moIO5mO39V1Z+RDwROK9JXY4GfM8ZjDgM6Si7wRZ1MPVjbhTpmLz3lz28rAiw7c2LeCmizfJzHkEXIwGlB280g==)
+ darkcode: ENC(0jzpQ7T6S+P7bZrENgYsUoLhlqGvw7DA2MN3BRqEOwq7plhtg72vuuiPQNnr3DaYz0CpyTvxInhpx11W3VZ1trD6NINh7O3LN70ZqO5pWXk=)
hosts:
- host: b5s119
ip: 132.122.116.142
diff --git a/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl b/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl
index 36125f2..0fef32e 100644
--- a/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl
+++ b/service-cli/service-cli-runner/src/main/resources/template/deploy.ftl
@@ -9,23 +9,18 @@ datetime=`date +%Y%m%d%H%M%S`
log_path='${runtime.logPath}'
loki_url='${runtime.lokiUrl}'
eureka_url='${runtime.eurekaUrl}'
-<#--for host in <#noparse>${hosts[@]}#noparse>
-do
- hostname=`ssh $host 'echo $HOSTNAME'`
- echo "$host $hostname"
- ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar
- ssh $host "curl ftp://yyy:QeY\!68\)4nH1@132.121.122.15:2222/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar"
- ssh $host "nohup ${runtime.jdkPath} <#list environments?keys as key>-D${key?replace("_", ".")}=${environments[key]?string} #list>-jar <#noparse>--datetime=${datetime} --hostname=${hostname} --eureka.instance.hostname=${hostname} --logging.parent=${log_path} --loki.url=${loki_url} --eureka.client.service-url.defaultZone=${eureka_url}#noparse> ${runtime.jarPath}/${info.name}.jar <#list arguments?keys as key>--${key?replace("_", ".")}=${arguments[key]?string} #list>> /dev/null 2>&1 &"
-done-->
-<#list hosts as host>
+security_authority='${runtime.security.authority}'
+security_username='${runtime.security.username}'
+security_darkcode='${runtime.security.darkcode}'
+<#list hosts as host>
host=${host}
hostname=`ssh $host 'echo $HOSTNAME'`
echo "${info.name} $host $hostname $datetime"
ssh $host 'bash -s' < stop.sh ${runtime.jarPath}/${info.name}.jar
<#if selectedHosts?seq_contains(host)>
ssh $host "curl ftp://yyy:QeY\!68\)4nH1@132.121.122.15:2222/${info.sourceJar} -o ${runtime.jarPath}/${info.name}.jar"
-ssh $host "nohup ${runtime.jdkPath} <#list environments?keys as key>-D${key?replace("_", ".")}=${environments[key]?string} #list>-jar ${runtime.jarPath}/${info.name}.jar<#noparse> --datetime=${datetime} --hostname=${hostname} --eureka.instance.hostname=${hostname} --logging.parent=${log_path} --loki.url=${loki_url} --eureka.client.service-url.defaultZone=${eureka_url}#noparse> <#list arguments?keys as key>--${key?replace("_", ".")}=${arguments[key]?string} #list>> /dev/null 2>&1 &"
+ssh $host "export JASYPT_ENCRYPTOR_PASSWORD='r#(R,P\"Dp^A47>WSn:Wn].gs/+\"v:q_Q*An~zF*g-@j@jtSTv5H/,S-3:R?r9R}.';nohup ${runtime.jdkPath} <#list environments?keys as key>-D${key?replace("_", ".")}=${environments[key]?string} #list>-jar ${runtime.jarPath}/${info.name}.jar<#noparse> --datetime=${datetime} --hostname=${hostname} --eureka.instance.hostname=${hostname} --logging.parent=${log_path} --loki.url=${loki_url} --eureka.client.service-url.defaultZone='${eureka_url}' --spring.security.meta.authority='${security_authority}' --spring.security.meta.username='${security_username}' --spring.security.meta.darkcode='${security_darkcode}'#noparse> <#list arguments?keys as key>--${key?replace("_", ".")}=${arguments[key]?string} #list>> /dev/null 2>&1 &"
#if>
echo ''
#list>
diff --git a/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/JacksonConfiguration.java b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/JacksonConfiguration.java
index b6b8461..bb22e70 100644
--- a/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/JacksonConfiguration.java
+++ b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/JacksonConfiguration.java
@@ -2,6 +2,8 @@ package com.lanyuanxiaoyao.service.configuration;
import com.fasterxml.jackson.datatype.eclipsecollections.EclipseCollectionsModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -14,11 +16,15 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
public class JacksonConfiguration {
+ private static final Logger logger = LoggerFactory.getLogger(JacksonConfiguration.class);
+
@Bean
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
return builder -> {
- builder.modules(new EclipseCollectionsModule());
- builder.modules(new JavaTimeModule());
+ builder.modules(
+ new EclipseCollectionsModule(),
+ new JavaTimeModule()
+ );
};
}
}
diff --git a/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityConfig.java b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityConfig.java
index 9cfae0c..0e62490 100644
--- a/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityConfig.java
+++ b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityConfig.java
@@ -20,6 +20,13 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
public class SecurityConfig extends WebSecurityConfigurerAdapter {
private static final Logger logger = LoggerFactory.getLogger(SecurityConfig.class);
+ private final SecurityProperties securityProperties;
+
+ @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
+ public SecurityConfig(SecurityProperties securityProperties) {
+ this.securityProperties = securityProperties;
+ }
+
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests()
@@ -37,8 +44,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder builder) throws Exception {
builder.inMemoryAuthentication()
- .withUser(Constants.SPRING_SECURITY_USERNAME)
- .password(Constants.SPRING_SECURITY_PASSWORD)
- .authorities(Constants.SPRING_SECURITY_AUTHORITY);
+ .withUser(securityProperties.getUsername())
+ .password("{noop}" + securityProperties.getDarkcode())
+ .authorities(securityProperties.getAuthority());
}
}
diff --git a/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityProperties.java b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityProperties.java
new file mode 100644
index 0000000..1f18f29
--- /dev/null
+++ b/service-configuration/src/main/java/com/lanyuanxiaoyao/service/configuration/SecurityProperties.java
@@ -0,0 +1,49 @@
+package com.lanyuanxiaoyao.service.configuration;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author lanyuanxiaoyao
+ * @date 2023-07-03
+ */
+@ConfigurationProperties("spring.security.meta")
+@Component
+public class SecurityProperties {
+ private String authority;
+ private String username;
+ private String darkcode;
+
+ public String getAuthority() {
+ return authority;
+ }
+
+ public void setAuthority(String authority) {
+ this.authority = authority;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getDarkcode() {
+ return darkcode;
+ }
+
+ public void setDarkcode(String darkcode) {
+ this.darkcode = darkcode;
+ }
+
+ @Override
+ public String toString() {
+ return "SecurityProperties{" +
+ "authority='" + authority + '\'' +
+ ", username='" + username + '\'' +
+ ", darkcode='" + darkcode + '\'' +
+ '}';
+ }
+}
diff --git a/service-dependencies/pom.xml b/service-dependencies/pom.xml
index 26ce65b..51a8ad1 100644
--- a/service-dependencies/pom.xml
+++ b/service-dependencies/pom.xml
@@ -99,6 +99,11 @@
hutool-all
5.7.16
+
+ com.github.ulisesbocchio
+ jasypt-spring-boot-starter
+ 3.0.4
+
\ No newline at end of file
diff --git a/service-flink-query/src/main/java/com/lanyuanxiaoyao/service/flink/FlinkQueryApplication.java b/service-flink-query/src/main/java/com/lanyuanxiaoyao/service/flink/FlinkQueryApplication.java
index 100158d..ea61542 100644
--- a/service-flink-query/src/main/java/com/lanyuanxiaoyao/service/flink/FlinkQueryApplication.java
+++ b/service-flink-query/src/main/java/com/lanyuanxiaoyao/service/flink/FlinkQueryApplication.java
@@ -1,5 +1,6 @@
package com.lanyuanxiaoyao.service.flink;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
@@ -23,6 +24,7 @@ import org.springframework.retry.annotation.EnableRetry;
}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
public class FlinkQueryApplication {
public static void main(String[] args) {
diff --git a/service-hudi-query/src/main/java/com/lanyuanxiaoyao/service/hudi/HudiQueryApplication.java b/service-hudi-query/src/main/java/com/lanyuanxiaoyao/service/hudi/HudiQueryApplication.java
index 74bd8b4..dae38e9 100644
--- a/service-hudi-query/src/main/java/com/lanyuanxiaoyao/service/hudi/HudiQueryApplication.java
+++ b/service-hudi-query/src/main/java/com/lanyuanxiaoyao/service/hudi/HudiQueryApplication.java
@@ -1,5 +1,6 @@
package com.lanyuanxiaoyao.service.hudi;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
@@ -21,6 +22,7 @@ import org.springframework.retry.annotation.EnableRetry;
exclude = {GsonAutoConfiguration.class}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
public class HudiQueryApplication implements ApplicationRunner {
private static final Logger logger = LoggerFactory.getLogger(HudiQueryApplication.class);
@@ -31,5 +33,6 @@ public class HudiQueryApplication implements ApplicationRunner {
@Override
public void run(ApplicationArguments args) {
+ // Test
}
}
diff --git a/service-info-query/src/main/java/com/lanyuanxiaoyao/service/info/InfoQueryApplication.java b/service-info-query/src/main/java/com/lanyuanxiaoyao/service/info/InfoQueryApplication.java
index 24f00ff..468cf58 100644
--- a/service-info-query/src/main/java/com/lanyuanxiaoyao/service/info/InfoQueryApplication.java
+++ b/service-info-query/src/main/java/com/lanyuanxiaoyao/service/info/InfoQueryApplication.java
@@ -1,5 +1,6 @@
package com.lanyuanxiaoyao.service.info;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@@ -25,6 +26,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
exclude = {GsonAutoConfiguration.class}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
@EnableScheduling
public class InfoQueryApplication {
diff --git a/service-info-query/src/main/resources/application.yml b/service-info-query/src/main/resources/application.yml
index b67e031..600d837 100644
--- a/service-info-query/src/main/resources/application.yml
+++ b/service-info-query/src/main/resources/application.yml
@@ -4,9 +4,9 @@ spring:
profiles:
include: random-port,common,eureka,metrics
datasource:
- url: jdbc:mysql://132.121.204.217:17906/iap-datahub?useSSL=false
- username: odcp
- password: wFg_fR492#&
+ url: ENC(tDeB9gYs1IHN90VV+KhNQAVEKSqeInEmFhgma7A0g6surB5pOyJC3lJx0QrvQo4zYz0WOhSgqjglHDSX7nh7k9ak3OQMgLYkHQGVawAZfcsGT/1m0csyjQzCxTCOZr5r)
+ username: ENC(29BKiU1cMKlA61gszFeYfWvoDVtLCCQAtfraxMq+f6Gm2LFu+67lkkBhoWgWIJga)
+ password: ENC(t+7GZM/tfqYeTlOugjcO6lUsHlacoVaomxLOeDpb6LhVB5+wbZHkKkW1xke8jNhQ)
driver-class-name: com.mysql.jdbc.Driver
druid:
initial-size: 5
diff --git a/service-loki-query/src/main/java/com/lanyuanxiaoyao/service/loki/LokiQueryApplication.java b/service-loki-query/src/main/java/com/lanyuanxiaoyao/service/loki/LokiQueryApplication.java
index 91992c1..1a497e2 100644
--- a/service-loki-query/src/main/java/com/lanyuanxiaoyao/service/loki/LokiQueryApplication.java
+++ b/service-loki-query/src/main/java/com/lanyuanxiaoyao/service/loki/LokiQueryApplication.java
@@ -2,6 +2,8 @@ package com.lanyuanxiaoyao.service.loki;
import com.lanyuanxiaoyao.service.configuration.entity.loki.LokiLogLine;
import com.lanyuanxiaoyao.service.loki.service.LokiQueryService;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
+import java.util.Map;
import org.eclipse.collections.api.factory.Maps;
import org.eclipse.collections.api.list.ImmutableList;
import org.slf4j.Logger;
@@ -17,8 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import java.util.Map;
-
/**
* 启动类
*
@@ -31,6 +31,7 @@ import java.util.Map;
exclude = {GsonAutoConfiguration.class}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
@RequestMapping("loki")
@RestController
diff --git a/service-pulsar-query/src/main/java/com/lanyuanxiaoyao/service/pulsar/PulsarQueryApplication.java b/service-pulsar-query/src/main/java/com/lanyuanxiaoyao/service/pulsar/PulsarQueryApplication.java
index 89f88c1..cd597af 100644
--- a/service-pulsar-query/src/main/java/com/lanyuanxiaoyao/service/pulsar/PulsarQueryApplication.java
+++ b/service-pulsar-query/src/main/java/com/lanyuanxiaoyao/service/pulsar/PulsarQueryApplication.java
@@ -7,6 +7,11 @@ import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarInfo;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarNamespace;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarTenant;
import com.lanyuanxiaoyao.service.configuration.entity.pulsar.PulsarTopic;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.client.admin.PulsarAdminException;
import org.apache.pulsar.client.api.MessageId;
@@ -26,11 +31,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
/**
* @author lanyuanxiaoyao
* @date 2023-04-27
@@ -44,6 +44,7 @@ import java.util.Map;
}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
@RestController
@RequestMapping("pulsar")
diff --git a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/WebApplication.java b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/WebApplication.java
index cccaefd..035e0ae 100644
--- a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/WebApplication.java
+++ b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/WebApplication.java
@@ -1,6 +1,6 @@
package com.lanyuanxiaoyao.service.web;
-import javax.annotation.Resource;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
@@ -8,10 +8,9 @@ import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.netflix.eureka.EurekaServiceInstance;
import org.springframework.scheduling.annotation.EnableAsync;
/**
@@ -27,6 +26,8 @@ import org.springframework.scheduling.annotation.EnableAsync;
@EnableDiscoveryClient
@EnableAsync
@EnableCaching
+@EnableConfigurationProperties
+@EnableEncryptableProperties
public class WebApplication implements ApplicationRunner {
private static final Logger logger = LoggerFactory.getLogger(WebApplication.class);
@@ -35,6 +36,7 @@ public class WebApplication implements ApplicationRunner {
}
@Override
- public void run(ApplicationArguments args) throws Exception {
+ public void run(ApplicationArguments args) {
+ // Test
}
}
diff --git a/service-yarn-query/src/main/java/com/lanyuanxiaoyao/service/yarn/YarnQueryApplication.java b/service-yarn-query/src/main/java/com/lanyuanxiaoyao/service/yarn/YarnQueryApplication.java
index 7ebbdf8..1bceac8 100644
--- a/service-yarn-query/src/main/java/com/lanyuanxiaoyao/service/yarn/YarnQueryApplication.java
+++ b/service-yarn-query/src/main/java/com/lanyuanxiaoyao/service/yarn/YarnQueryApplication.java
@@ -1,6 +1,6 @@
package com.lanyuanxiaoyao.service.yarn;
-import com.lanyuanxiaoyao.service.yarn.configuration.YarnConfiguration;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
@@ -29,23 +29,18 @@ import org.springframework.scheduling.annotation.EnableScheduling;
}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
@EnableScheduling
public class YarnQueryApplication implements ApplicationRunner {
private static final Logger logger = LoggerFactory.getLogger(YarnQueryApplication.class);
- public YarnQueryApplication(YarnConfiguration yarnConfiguration) {
- this.yarnConfiguration = yarnConfiguration;
- }
-
public static void main(String[] args) {
SpringApplication.run(YarnQueryApplication.class, args);
}
- private final YarnConfiguration yarnConfiguration;
-
@Override
- public void run(ApplicationArguments args) throws Exception {
- logger.info("Yarn configuration: {}", yarnConfiguration);
+ public void run(ApplicationArguments args) {
+ // Test
}
}
diff --git a/service-zookeeper-query/src/main/java/com/lanyuanxiaoyao/service/zookeeper/ZookeeperQueryApplication.java b/service-zookeeper-query/src/main/java/com/lanyuanxiaoyao/service/zookeeper/ZookeeperQueryApplication.java
index 7659f4d..41dcf40 100644
--- a/service-zookeeper-query/src/main/java/com/lanyuanxiaoyao/service/zookeeper/ZookeeperQueryApplication.java
+++ b/service-zookeeper-query/src/main/java/com/lanyuanxiaoyao/service/zookeeper/ZookeeperQueryApplication.java
@@ -1,13 +1,12 @@
package com.lanyuanxiaoyao.service.zookeeper;
+import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.retry.annotation.EnableRetry;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
/**
* zk 查询
@@ -21,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
exclude = {GsonAutoConfiguration.class}
)
@EnableConfigurationProperties
+@EnableEncryptableProperties
@EnableRetry
public class ZookeeperQueryApplication {
public static void main(String[] args) {
diff --git a/test/test.http b/test/test.http
index 9de2e2f..5c02f37 100644
--- a/test/test.http
+++ b/test/test.http
@@ -45,4 +45,7 @@ GET http://{{username}}:{{password}}@132.122.116.146:18166/info/compaction_metri
GET http://{{username}}:{{password}}@132.122.116.150:27510/table/list_compaction_metrics?search_flink_job_id=1542097996099055616&search_alias=acct_acct_item_fs
### Query Scheduler
-GET {{scheduler-url}}/schedule/all_un_scheduled
+GET {{scheduler-url}}/schedule/all_focus
+
+### Yarn query
+GET http://AxhEbscwsJDbYMH2:cYxg3b4PtWoVD5SjFayWxtnSVsjzRsg4@132.122.116.143:34903/job/list?cluster=a4