提交 301d6f42 作者: 方治民

feat: 移除 Spring Boot Admin Client 依赖及相关配置,防止意外的配置可能暴露环境变量、配置信息等信息的情况

上级 e4c817a5
...@@ -23,8 +23,6 @@ dependencies { ...@@ -23,8 +23,6 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation' implementation 'org.springframework.boot:spring-boot-starter-validation'
// Spring Boot Admin Client
implementation 'de.codecentric:spring-boot-admin-starter-client'
// Sentry // Sentry
implementation "io.sentry:sentry-spring-boot-starter-jakarta" implementation "io.sentry:sentry-spring-boot-starter-jakarta"
......
/* (C) 2024 YiRing, Inc. */
package com.yiring.app.config;
import org.springframework.boot.actuate.audit.InMemoryAuditEventRepository;
import org.springframework.boot.actuate.web.exchanges.HttpExchangeRepository;
import org.springframework.boot.actuate.web.exchanges.InMemoryHttpExchangeRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author Jim
*/
@Configuration
public class ActuatorConfiguration {
@Bean
public HttpExchangeRepository httpExchangeRepository() {
InMemoryHttpExchangeRepository repository = new InMemoryHttpExchangeRepository();
repository.setCapacity(100);
return repository;
}
@Bean
public InMemoryAuditEventRepository repository() {
return new InMemoryAuditEventRepository();
}
}
/* (C) 2021 YiRing, Inc. */ /* (C) 2021 YiRing, Inc. */
package com.yiring.app.config; package com.yiring.app.config;
import com.yiring.common.core.I18n;
import com.yiring.common.core.Result; import com.yiring.common.core.Result;
import com.yiring.common.core.Status; import com.yiring.common.core.Status;
import io.sentry.Sentry; import io.sentry.Sentry;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
...@@ -22,11 +20,8 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; ...@@ -22,11 +20,8 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
@Slf4j @Slf4j
@Order @Order
@RestControllerAdvice @RestControllerAdvice
@RequiredArgsConstructor
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
final I18n i18n;
/** /**
* 其他异常 * 其他异常
* *
......
...@@ -10,48 +10,6 @@ sentry: ...@@ -10,48 +10,6 @@ sentry:
traces-sample-rate: 1.0 traces-sample-rate: 1.0
debug: false debug: false
# Spring Boot Admin Client Config
spring:
boot:
admin:
client:
# url: http://127.0.0.1:18891
url: https://sbas.yiring.com
username: admin
password: sba.developer@Yiring.com
instance:
# TODO: 替换成正式项目的 Spring Boot Admin Server URL
management-base-url: http://39.100.252.176:42100/api
# Spring Boot Actuator
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: always
mappings:
enabled: false
shutdown:
enabled: false
startup:
enabled: false
heapdump:
enabled: false
info:
build:
enabled: true
git:
enabled: true
env:
enabled: false
java:
enabled: true
os:
enabled: true
# Uptime Kuma 服务地址 # Uptime Kuma 服务地址
uptime: uptime:
domain: https://uptime.yiring.com domain: https://uptime.yiring.com
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论