diff --git a/config/dev/ruoyi-sentinel-dashboard.yml b/config/dev/ruoyi-sentinel-dashboard.yml new file mode 100644 index 00000000..c637d57d --- /dev/null +++ b/config/dev/ruoyi-sentinel-dashboard.yml @@ -0,0 +1,21 @@ +server: + servlet: + encoding: + force: true + charset: UTF-8 + enabled: true + session: + cookie: + name: sentinel_dashboard_cookie + +logging: + level: + org.springframework.web: INFO + +auth: + enabled: true + filter: + exclude-urls: /,/auth/login,/auth/logout,/registry/machine,/version + exclude-url-suffixes: htm,html,js,css,map,ico,ttf,woff,png + username: sentinel + password: sentinel diff --git a/ruoyi-visual/ruoyi-sentinel-dashboard/pom.xml b/ruoyi-visual/ruoyi-sentinel-dashboard/pom.xml index dcc69a27..e958e63f 100644 --- a/ruoyi-visual/ruoyi-sentinel-dashboard/pom.xml +++ b/ruoyi-visual/ruoyi-sentinel-dashboard/pom.xml @@ -20,6 +20,18 @@ + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + com.alibaba.csp sentinel-core diff --git a/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/application.properties b/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/application.properties deleted file mode 100644 index 6bbb872c..00000000 --- a/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/application.properties +++ /dev/null @@ -1,24 +0,0 @@ -server.port=8718 -spring.application.name=ruoyi-sentinel-dashboard - -#spring settings -server.servlet.encoding.force=true -server.servlet.encoding.charset=UTF-8 -server.servlet.encoding.enabled=true - -#cookie name setting -server.servlet.session.cookie.name=sentinel_dashboard_cookie - -#logging settings -logging.level.org.springframework.web=INFO - -#auth settings -auth.filter.exclude-urls=/,/auth/login,/auth/logout,/registry/machine,/version -auth.filter.exclude-url-suffixes=htm,html,js,css,map,ico,ttf,woff,png -# If auth.enabled=false, Sentinel console disable login -auth.username=sentinel -auth.password=sentinel - -# Inject the dashboard version. It's required to enable -# filtering in pom.xml for this resource file. -sentinel.dashboard.version=@sentinel.version@ diff --git a/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/bootstrap.yml b/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/bootstrap.yml new file mode 100644 index 00000000..84cff126 --- /dev/null +++ b/ruoyi-visual/ruoyi-sentinel-dashboard/src/main/resources/bootstrap.yml @@ -0,0 +1,42 @@ +# Tomcat +server: + port: 8718 + +# Spring +spring: + main: + # 此配置禁止放入 nacos 优先级不够 + allow-circular-references: true + application: + # 应用名称 + name: ruoyi-sentinel-dashboard + profiles: + # 环境配置 + active: @profiles.active@ + +sentinel: + dashboard: + version: @sentinel.version@ + +--- # nacos 配置 +spring: + cloud: + nacos: + # nacos 服务地址 + server-addr: @nacos.server@ + discovery: + # 注册组 + group: @nacos.discovery.group@ + namespace: ${spring.profiles.active} + config: + # 配置组 + group: @nacos.config.group@ + namespace: ${spring.profiles.active} + # 配置文件格式 + file-extension: yml + # 共享配置 + shared-configs: + - data-id: application.${spring.cloud.nacos.config.file-extension} + refresh: true + - data-id: datasource.${spring.cloud.nacos.config.file-extension} + refresh: true diff --git a/sql/ry-config.sql b/sql/ry-config.sql index 723388ac..6cf00a05 100644 --- a/sql/ry-config.sql +++ b/sql/ry-config.sql @@ -44,6 +44,7 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod (10, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '限流策略', NULL, NULL, 'json', NULL), (11, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', '定时任务控制台', NULL, NULL, 'yaml', NULL), (12, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'seata配置文件', NULL, NULL, 'properties', NULL), +(13, 'ruoyi-sentinel-dashboard.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'sentinel控制台配置文件', NULL, NULL, 'yaml', NULL), (101, 'application.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '通用配置基础配置', NULL, NULL, 'yaml', NULL), (102, 'datasource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '数据源配置', NULL, NULL, 'yaml', NULL), @@ -56,7 +57,8 @@ insert into config_info(id, data_id, group_id, content, md5, gmt_create, gmt_mod (109, 'ruoyi-resource.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '文件服务', NULL, NULL, 'yaml', NULL), (110, 'sentinel-ruoyi-gateway.json', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:23:00', '2022-01-09 15:23:00', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '限流策略', NULL, NULL, 'json', NULL), (111, 'ruoyi-xxl-job-admin.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', '定时任务控制台', NULL, NULL, 'yaml', NULL), -(112, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', 'seata配置文件', NULL, NULL, 'properties', NULL); +(112, 'seata-server.properties', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'prod', 'seata配置文件', NULL, NULL, 'properties', NULL), +(113, 'ruoyi-sentinel-dashboard.yml', 'DEFAULT_GROUP', '# 将项目路径:config/下对应文件中内容复制到此处', '2944a25cb97926efcaa43b3ad7a64cf0', '2022-01-09 15:21:02', '2022-01-09 15:21:02', NULL, '0:0:0:0:0:0:0:1', '', 'dev', 'sentinel控制台配置文件', NULL, NULL, 'yaml', NULL); /******************************************/ /* 表名称 = config_info_aggr */