diff --git a/README.md b/README.md index 15b155b1783bb707e8592b3d618dbaf614a6a80d..c33e780e7e54118c5394d5c6efed638d51cd4d2d 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇 # 技术栈 -- Springboot 2.0.1 +- Springboot 2.0.8 - Apache Shiro 1.2.2 - Logback - Redis @@ -99,9 +99,9 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇 2. 新建数据库`CREATE DATABASE dblog;` 3. 导入数据库`docs/db/dblog.sql` 4. 修改配置文件 - 1. 数据库链接属性(在`resources/application-{env}.yml`配置文件中搜索`datasource`或定位到L.7) - 2. redis配置(在`resources/application.yml`配置文件中搜索`redis`或定位到L.65) - 3. mail配置(在`resources/application-{env}.yml`配置文件中搜索`mail`或定位到L.14) + 1. 数据库链接属性(在`[blog-core]/resources/config/application-center-{env}.yml`配置文件中搜索`datasource`或定位到L.5) + 2. redis配置(在`[blog-core]/resources/config/application-center-{env}.yml`配置文件中搜索`redis`或定位到L.14) + 3. mail配置(在`resources/application-{env}.yml`配置文件中搜索`mail`或定位到L.10) 4. 【[七牛云](https://portal.qiniu.com/signup?code=3l8yx2v0f21ci)】配置(见sys_config表中qiniu_*开头的字段) 注:因为系统存在redis缓存,如果是第一次使用,可以直接修改sys_config表内容,如果不是第一次用,建议使用admin项目中的`系统配置`页面修改相关配置内容 5. 运行项目(三种方式) @@ -176,4 +176,4 @@ ps: 虽然我知道,大部分人都是来了**直接下载源代码**后就潇 # 开源协议 -[![license](https://img.shields.io/badge/license-GPL%20v3-yellow.svg)](https://gitee.com/yadong.zhang/DBlog/blob/master/LICENSE) \ No newline at end of file +[![license](https://img.shields.io/badge/license-GPL%20v3-yellow.svg)](https://gitee.com/yadong.zhang/DBlog/blob/master/LICENSE) diff --git a/blog-admin/src/main/resources/application-dev.yml b/blog-admin/src/main/resources/application-dev.yml index 473c543fb2c024b928347a2a2a5741d101c67b25..2194f9618ca4af874d0b93a66d056ad23e64da79 100644 --- a/blog-admin/src/main/resources/application-dev.yml +++ b/blog-admin/src/main/resources/application-dev.yml @@ -4,14 +4,8 @@ server: basedir: /var/tmp/website-blog-admin # SPRING PROFILES spring: - datasource: - druid: - connection-init-sqls: set names utf8mb4 - driver-class-name: com.mysql.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true - username: root - password: root + profiles: + include: [center-dev] # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 @@ -37,18 +31,8 @@ spring: mail.smtp.connectiontimeout: 50000 mail.smtp.timeout: 30000 mail.smtp.writetimeout: 50000 - # redis缓存服务配置 - session: - store-type: redis # Redis数据库索引(默认为0) redis: - database: 5 - # Redis服务器地址 - host: 127.0.0.1 - # Redis服务器连接端口 - port: 6379 - # Redis服务器连接密码(默认为空) - password: qwe!@#123 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) @@ -76,6 +60,4 @@ app: loginUrl: "/passport/login/" successUrl: "/" unauthorizedUrl: "/error/403" - # 创建网站的时间,用于计算已建站的天数,默认为2018-01-01 - buildWebsiteDate: 2018-01-01 00:00:00 ####################################自定义配置########################################## diff --git a/blog-admin/src/main/resources/application-test.yml b/blog-admin/src/main/resources/application-test.yml index ccd689bb56c5504698f1f18cf0dbff5670d5c43e..d44a8ca48f5766e85a33bcbd750fdc687b43b35f 100644 --- a/blog-admin/src/main/resources/application-test.yml +++ b/blog-admin/src/main/resources/application-test.yml @@ -4,14 +4,8 @@ server: basedir: /var/tmp/website-blog-admin # SPRING PROFILES spring: - datasource: - druid: - connection-init-sqls: set names utf8mb4 - driver-class-name: com.mysql.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true - username: root - password: root + profiles: + include: [center-test] # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 @@ -37,18 +31,8 @@ spring: mail.smtp.connectiontimeout: 50000 mail.smtp.timeout: 30000 mail.smtp.writetimeout: 50000 - # redis缓存服务配置 - session: - store-type: redis # Redis数据库索引(默认为0) redis: - database: 5 - # Redis服务器地址 - host: 127.0.0.1 - # Redis服务器连接端口 - port: 6379 - # Redis服务器连接密码(默认为空) - password: qwe!@#123 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) @@ -70,8 +54,6 @@ logging: app: # 是否启用kaptcha验证码 enableKaptcha: false - # 创建网站的时间,用于计算已建站的天数,默认为2018-01-01 - buildWebsiteDate: 2018-01-01 00:00:00 # shiro配置项 shiro: loginUrl: "/passport/login/" diff --git a/blog-core/src/main/resources/config/application-center-dev.yml b/blog-core/src/main/resources/config/application-center-dev.yml new file mode 100644 index 0000000000000000000000000000000000000000..efd0cfa70514345f23e3538e625cb0913f109c67 --- /dev/null +++ b/blog-core/src/main/resources/config/application-center-dev.yml @@ -0,0 +1,29 @@ +spring: + profiles: + include: [center] +####### database Config ####### + datasource: + druid: + connection-init-sqls: set names utf8mb4 + driver-class-name: com.mysql.jdbc.Driver + type: com.alibaba.druid.pool.DruidDataSource + url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + username: root + password: +####### Redis Config ####### + redis: + database: 5 + # Redis服务器地址 + host: 127.0.0.1 + # Redis服务器连接端口 + port: 6379 + # Redis服务器连接密码(默认为空) + password: + +####### redis缓存服务配置 ####### + session: + store-type: redis + +####### 自定义配置 ####### + +####### 自定义配置 ####### diff --git a/blog-core/src/main/resources/config/application-center-test.yml b/blog-core/src/main/resources/config/application-center-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..d27e5b0637367ab40fcd0cea6ddcace1ff4c849a --- /dev/null +++ b/blog-core/src/main/resources/config/application-center-test.yml @@ -0,0 +1,29 @@ +spring: + profiles: + include: [center] +####### database Config ####### + datasource: + druid: + connection-init-sqls: set names utf8mb4 + driver-class-name: com.mysql.jdbc.Driver + type: com.alibaba.druid.pool.DruidDataSource + url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + username: root + password: root + ####### Redis Config ####### + redis: + database: 5 + # Redis服务器地址 + host: 127.0.0.1 + # Redis服务器连接端口 + port: 6379 + # Redis服务器连接密码(默认为空) + password: qwe!@#123 + + ####### redis缓存服务配置 ####### + session: + store-type: redis + +####### 自定义配置 ####### + +####### 自定义配置 ####### diff --git a/blog-core/src/main/resources/config/application-center.yml b/blog-core/src/main/resources/config/application-center.yml new file mode 100644 index 0000000000000000000000000000000000000000..aa496295ae2bf1c17529605e64ff4ad27aee992f --- /dev/null +++ b/blog-core/src/main/resources/config/application-center.yml @@ -0,0 +1,5 @@ +####### 自定义配置 ####### +app: + # 创建网站的时间,用于计算已建站的天数,默认为2018-01-01 + buildWebsiteDate: 2018-01-01 00:00:00 +####### 自定义配置 ####### diff --git a/blog-web/src/main/resources/application-dev.yml b/blog-web/src/main/resources/application-dev.yml index be1cd0711c392029071d7a3c67687dd89821ae1a..8d05d40ce0a5188028b402631dbc96a4640d43e3 100644 --- a/blog-web/src/main/resources/application-dev.yml +++ b/blog-web/src/main/resources/application-dev.yml @@ -4,14 +4,8 @@ server: basedir: /var/tmp/website-blog-web # SPRING PROFILES spring: - datasource: - druid: - connection-init-sqls: set names utf8mb4 - driver-class-name: com.mysql.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true - username: root - password: root + profiles: + include: [center-dev] # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 @@ -37,18 +31,8 @@ spring: mail.smtp.connectiontimeout: 50000 mail.smtp.timeout: 30000 mail.smtp.writetimeout: 50000 - # redis缓存服务配置 - session: - store-type: redis # Redis数据库索引(默认为0) redis: - database: 5 - # Redis服务器地址 - host: 127.0.0.1 - # Redis服务器连接端口 - port: 6379 - # Redis服务器连接密码(默认为空) - password: qwe!@#123 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) @@ -72,8 +56,6 @@ logging: app: # 是否启用kaptcha验证码 enableKaptcha: false - # 创建网站的时间,用于计算已建站的天数,默认为2018-01-01 - buildWebsiteDate: 2018-01-01 00:00:00 # braum过滤器,用于过滤恶意请求 braum: diff --git a/blog-web/src/main/resources/application-test.yml b/blog-web/src/main/resources/application-test.yml index 2417bc24d914c35af22fe0413a7843c44615d3ab..e4b7a98fd5d8234f6645d12a63d5d33b28a267c8 100644 --- a/blog-web/src/main/resources/application-test.yml +++ b/blog-web/src/main/resources/application-test.yml @@ -4,14 +4,8 @@ server: basedir: /var/tmp/website-blog-web # SPRING PROFILES spring: - datasource: - druid: - connection-init-sqls: set names utf8mb4 - driver-class-name: com.mysql.jdbc.Driver - type: com.alibaba.druid.pool.DruidDataSource - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true - username: root - password: root + profiles: + include: [center-test] # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 @@ -37,18 +31,8 @@ spring: mail.smtp.connectiontimeout: 50000 mail.smtp.timeout: 30000 mail.smtp.writetimeout: 50000 - # redis缓存服务配置 - session: - store-type: redis # Redis数据库索引(默认为0) redis: - database: 5 - # Redis服务器地址 - host: 127.0.0.1 - # Redis服务器连接端口 - port: 6379 - # Redis服务器连接密码(默认为空) - password: qwe!@#123 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) @@ -63,6 +47,7 @@ spring: timeout: 5000ms # 默认的数据过期时间,主要用于shiro权限管理 expire: 2592000 + # logging settings logging: path: /var/tmp/website-blog-web @@ -77,6 +62,4 @@ braum: app: # 是否启用kaptcha验证码 enableKaptcha: false - # 创建网站的时间,用于计算已建站的天数,默认为2018-01-01 - buildWebsiteDate: 2018-01-01 00:00:00 ####################################自定义配置##########################################