Skip to content

Commit 47480b1

Browse files
committed
Merge branch 'pre_dev' of https://github.com/zhoutaoo/SpringCloud into pre_dev
* 'pre_dev' of https://github.com/zhoutaoo/SpringCloud: Revert "网关聚合swagger文档、SwaggerConfig TODO待优化" 数据库改为mysql 网关聚合swagger文档、SwaggerConfig TODO待优化 将网关redis缓存初始化命令注释,设为可选命令,有需要自行打开 解决授权服务,认证服务的/actuator/health无法使用,导致SpringCloudAdmin显示服务为DOWN且后台报错 org.springframework.security.access.AccessDeniedException: Access is denied 升级docker-maven-plugin到1.2.0解决兼容性问题 修复一件部署关于bus-server启动的问题
2 parents 0ad1dcb + 3453d6f commit 47480b1

File tree

23 files changed

+78
-43
lines changed

23 files changed

+78
-43
lines changed

auth/authentication-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<plugin>
3737
<groupId>com.spotify</groupId>
3838
<artifactId>docker-maven-plugin</artifactId>
39-
<version>1.0.0</version>
39+
<version>1.2.0</version>
4040
<configuration>
4141
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
4242
<imageName>cike/${project.artifactId}</imageName>
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
package com.springboot.auth.authentication.config;
22

3-
import lombok.extern.slf4j.Slf4j;
43
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.core.annotation.Order;
55
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
66
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
77
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
88

9+
import lombok.extern.slf4j.Slf4j;
10+
11+
@Slf4j
912
@Configuration
1013
@EnableWebSecurity
11-
@Slf4j
14+
@Order(1)
1215
public class WebServerSecurityConfig extends WebSecurityConfigurerAdapter {
1316

1417
@Override
1518
protected void configure(HttpSecurity http) throws Exception {
1619
log.debug("HttpSecurity configure method");
1720
http.csrf().disable();
1821
http.authorizeRequests()
22+
.antMatchers("/actuator/**").permitAll()
1923
.anyRequest().authenticated();
2024
}
2125
}

auth/authentication-server/src/main/resources/application.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ spring:
1919
port: ${REDIS_PORT:6379}
2020
##password: ${REDIS_PASSWORD:}
2121
datasource:
22-
url: jdbc:${DATASOURCE_DB:postgresql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:5432}/sc_auth
23-
username: ${DATASOURCE_USERNAME:postgres}
24-
password: ${DATASOURCE_PASSWORD:postgres}
25-
driver-class-name: ${DATASOURCE_DRIVER:org.postgresql.Driver}
22+
driver-class-name: com.mysql.jdbc.Driver
23+
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
24+
username: ${DATASOURCE_USERNAME:root}
25+
password: ${DATASOURCE_PASSWORD:123456}
2626

2727
zipkin:
2828
enabled: true

auth/authorization-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<plugin>
4343
<groupId>com.spotify</groupId>
4444
<artifactId>docker-maven-plugin</artifactId>
45-
<version>1.0.0</version>
45+
<version>1.2.0</version>
4646
<configuration>
4747
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
4848
<imageName>cike/${project.artifactId}</imageName>

auth/authorization-server/src/main/java/com/springboot/auth/authorization/config/WebServerSecurityConfig.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.springboot.auth.authorization.config;
22

3-
import com.springboot.auth.authorization.oauth2.granter.MobileAuthenticationProvider;
4-
import lombok.extern.slf4j.Slf4j;
53
import org.springframework.beans.factory.annotation.Autowired;
64
import org.springframework.beans.factory.annotation.Qualifier;
75
import org.springframework.context.annotation.Bean;
@@ -15,6 +13,10 @@
1513
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
1614
import org.springframework.security.crypto.password.PasswordEncoder;
1715

16+
import com.springboot.auth.authorization.oauth2.granter.MobileAuthenticationProvider;
17+
18+
import lombok.extern.slf4j.Slf4j;
19+
1820
@Slf4j
1921
@Configuration
2022
@EnableWebSecurity
@@ -32,6 +34,7 @@ public class WebServerSecurityConfig extends WebSecurityConfigurerAdapter {
3234
protected void configure(HttpSecurity http) throws Exception {
3335
http.csrf().disable();
3436
http.authorizeRequests()
37+
.antMatchers("/actuator/**").permitAll()
3538
.anyRequest().authenticated()
3639
.and()
3740
.formLogin().permitAll();

auth/authorization-server/src/main/resources/application.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ spring:
1919
port: ${REDIS_PORT:6379}
2020
##password: ${REDIS_PASSWORD:}
2121
datasource:
22-
url: jdbc:${DATASOURCE_DB:postgresql}://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:5432}/sc_auth
23-
username: ${DATASOURCE_USERNAME:postgres}
24-
password: ${DATASOURCE_PASSWORD:postgres}
25-
driver-class-name: ${DATASOURCE_DRIVER:org.postgresql.Driver}
22+
driver-class-name: com.mysql.jdbc.Driver
23+
url: jdbc:mysql://${DATASOURCE_HOST:localhost}:${DATASOURCE_PORT:3306}/sc_auth?characterEncoding=UTF-8&useUnicode=true&useSSL=false
24+
username: ${DATASOURCE_USERNAME:root}
25+
password: ${DATASOURCE_PASSWORD:123456}
2626

2727
zipkin:
2828
enabled: true

auth/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
<artifactId>druid-spring-boot-starter</artifactId>
5454
<version>1.1.9</version>
5555
</dependency>
56+
<dependency>
57+
<groupId>mysql</groupId>
58+
<artifactId>mysql-connector-java</artifactId>
59+
<version>5.1.39</version>
60+
</dependency>
5661
<!--数据库-->
5762
<dependency>
5863
<groupId>org.postgresql</groupId>

center/bus/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<plugin>
2424
<groupId>com.spotify</groupId>
2525
<artifactId>docker-maven-plugin</artifactId>
26-
<version>1.0.0</version>
26+
<version>1.2.0</version>
2727
<configuration>
2828
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
2929
<imageName>cike/${project.artifactId}</imageName>

center/config/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<plugin>
3737
<groupId>com.spotify</groupId>
3838
<artifactId>docker-maven-plugin</artifactId>
39-
<version>1.0.0</version>
39+
<version>1.2.0</version>
4040
<configuration>
4141
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
4242
<imageName>cike/${project.artifactId}</imageName>

center/eureka/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<plugin>
3232
<groupId>com.spotify</groupId>
3333
<artifactId>docker-maven-plugin</artifactId>
34-
<version>1.0.0</version>
34+
<version>1.2.0</version>
3535
<configuration>
3636
<!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
3737
<imageName>cike/${project.artifactId}</imageName>

0 commit comments

Comments
 (0)