mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 20:54:25 +08:00
🔒 Fixing security issues. 开启nacos 认证
This commit is contained in:
parent
f99dbbd90c
commit
95d0091c3e
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
config:
|
config:
|
||||||
|
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
watch:
|
watch:
|
||||||
|
@ -43,7 +43,7 @@ public class PigNacosApplication {
|
|||||||
*/
|
*/
|
||||||
private static boolean initEnv() {
|
private static boolean initEnv() {
|
||||||
System.setProperty(ConfigConstants.STANDALONE_MODE, "true");
|
System.setProperty(ConfigConstants.STANDALONE_MODE, "true");
|
||||||
System.setProperty(ConfigConstants.AUTH_ENABLED, "false");
|
System.setProperty(ConfigConstants.AUTH_ENABLED, "true");
|
||||||
System.setProperty(ConfigConstants.LOG_BASEDIR, "logs");
|
System.setProperty(ConfigConstants.LOG_BASEDIR, "logs");
|
||||||
System.setProperty(ConfigConstants.LOG_ENABLED, "false");
|
System.setProperty(ConfigConstants.LOG_ENABLED, "false");
|
||||||
System.setProperty(ConfigConstants.NACOS_CONTEXT_PATH, "/nacos");
|
System.setProperty(ConfigConstants.NACOS_CONTEXT_PATH, "/nacos");
|
||||||
|
@ -16,6 +16,10 @@ db:
|
|||||||
nacos:
|
nacos:
|
||||||
core:
|
core:
|
||||||
auth:
|
auth:
|
||||||
|
server:
|
||||||
|
identity:
|
||||||
|
key: serverIdentity
|
||||||
|
value: security
|
||||||
plugin.nacos.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
plugin.nacos.token.secret.key: SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||||
enabled: false
|
enabled: false
|
||||||
system.type: nacos
|
system.type: nacos
|
||||||
|
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
config:
|
config:
|
||||||
|
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
config:
|
config:
|
||||||
|
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
config:
|
config:
|
||||||
|
@ -6,6 +6,8 @@ spring:
|
|||||||
name: @artifactId@
|
name: @artifactId@
|
||||||
cloud:
|
cloud:
|
||||||
nacos:
|
nacos:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
server-addr: ${NACOS_HOST:pig-register}:${NACOS_PORT:8848}
|
||||||
config:
|
config:
|
||||||
@ -14,9 +16,3 @@ spring:
|
|||||||
import:
|
import:
|
||||||
- optional:nacos:application-@profiles.active@.yml
|
- optional:nacos:application-@profiles.active@.yml
|
||||||
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
- optional:nacos:${spring.application.name}-@profiles.active@.yml
|
||||||
datasource:
|
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: root
|
|
||||||
url: jdbc:mysql://pig-mysql:3306/pig_job?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
|
|
||||||
|
2
pom.xml
2
pom.xml
@ -262,6 +262,8 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<!-- 环境标识,需要与配置文件的名称相对应 -->
|
<!-- 环境标识,需要与配置文件的名称相对应 -->
|
||||||
<profiles.active>dev</profiles.active>
|
<profiles.active>dev</profiles.active>
|
||||||
|
<nacos.username>nacos</nacos.username>
|
||||||
|
<nacos.password>nacos</nacos.password>
|
||||||
</properties>
|
</properties>
|
||||||
<activation>
|
<activation>
|
||||||
<!-- 默认环境 -->
|
<!-- 默认环境 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user