diff --git a/pigx-register/src/main/resources/application.yml b/pigx-register/src/main/resources/application.yml
index 133e2ef95..231bc2613 100755
--- a/pigx-register/src/main/resources/application.yml
+++ b/pigx-register/src/main/resources/application.yml
@@ -21,15 +21,30 @@ nacos:
urls: /,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
spring:
+ application:
+ name: @artifactId@
datasource:
platform: mysql
security:
enabled: true
+ boot: # 接入 spring boot admin
+ admin:
+ client:
+ url: http://pigx-monitor:5001
+ username: pigx
+ password: pigx
useAddressServer: true
# 关闭监控埋点采集
management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: always
metrics:
export:
elastic:
diff --git a/pigx-visual/pigx-sentinel-dashboard/pom.xml b/pigx-visual/pigx-sentinel-dashboard/pom.xml
index 28da71160..cfd74c39d 100755
--- a/pigx-visual/pigx-sentinel-dashboard/pom.xml
+++ b/pigx-visual/pigx-sentinel-dashboard/pom.xml
@@ -13,6 +13,11 @@
jar
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
com.alibaba.csp
sentinel-core
diff --git a/pigx-visual/pigx-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java b/pigx-visual/pigx-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java
index aab3a5112..cd2c2243d 100644
--- a/pigx-visual/pigx-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java
+++ b/pigx-visual/pigx-sentinel-dashboard/src/main/java/com/alibaba/csp/sentinel/dashboard/auth/LoginAuthenticationFilter.java
@@ -20,16 +20,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
+import org.springframework.util.AntPathMatcher;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
+import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import java.io.IOException;
import java.util.List;
@@ -59,6 +54,8 @@ public class LoginAuthenticationFilter implements Filter {
private static final String URL_SUFFIX_DOT = ".";
+ private static final AntPathMatcher PATH_MATCHER = new AntPathMatcher();
+
/**
* Some urls which needn't auth, such as /auth/login, /registry/machine and so on.
*/
@@ -90,6 +87,10 @@ public class LoginAuthenticationFilter implements Filter {
String servletPath = httpRequest.getServletPath();
// Exclude the urls which needn't auth
+ if (authFilterExcludeUrls.stream().anyMatch(s -> PATH_MATCHER.match(s,servletPath))){
+ chain.doFilter(request, response);
+ return;
+ }
if (authFilterExcludeUrls.contains(servletPath)) {
chain.doFilter(request, response);
return;
@@ -106,6 +107,7 @@ public class LoginAuthenticationFilter implements Filter {
authFilterExcludeUrlSuffix = URL_SUFFIX_DOT + authFilterExcludeUrlSuffix;
}
+
if (servletPath.endsWith(authFilterExcludeUrlSuffix)) {
chain.doFilter(request, response);
return;
diff --git a/pigx-visual/pigx-sentinel-dashboard/src/main/resources/application.yml b/pigx-visual/pigx-sentinel-dashboard/src/main/resources/application.yml
index d85b338e5..8cea8bd13 100755
--- a/pigx-visual/pigx-sentinel-dashboard/src/main/resources/application.yml
+++ b/pigx-visual/pigx-sentinel-dashboard/src/main/resources/application.yml
@@ -1,10 +1,17 @@
server:
port: 5020
-
-spring:
- http:
+ servlet:
encoding:
force: true
+
+management:
+ endpoints:
+ web:
+ exposure:
+ include: '*'
+ endpoint:
+ health:
+ show-details: ALWAYS
logging:
level:
org:
@@ -19,7 +26,7 @@ auth:
username: sentinel
password: sentinel
filter:
- exclude-urls: /,/auth/login,/auth/logout,/registry/machine,/version
+ exclude-urls: /,/auth/login,/auth/logout,/registry/machine,/version,/actuator/**,/details
exclude-url-suffixes: htm,html,js,css,map,ico,ttf,woff,png
sentinel:
diff --git a/pigx-visual/pigx-sentinel-dashboard/src/main/resources/bootstrap.yml b/pigx-visual/pigx-sentinel-dashboard/src/main/resources/bootstrap.yml
new file mode 100644
index 000000000..0e47b57b1
--- /dev/null
+++ b/pigx-visual/pigx-sentinel-dashboard/src/main/resources/bootstrap.yml
@@ -0,0 +1,15 @@
+server:
+ port: 5020
+ servlet:
+ encoding:
+ force: true
+
+spring:
+ application:
+ name: @artifactId@
+ cloud:
+ nacos:
+ discovery:
+ server-addr: ${NACOS_HOST:pigx-register}:${NACOS_PORT:8848}
+ profiles:
+ active: @profiles.active@
\ No newline at end of file