diff --git a/.gitignore b/.gitignore index 4ca3a46..73e8959 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,4 @@ target/ # 本地项目的私有文件 back-end/blog-dev.sql -src/main/resources/application-prod.properties src/main/resources/application-dev.properties diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties new file mode 100644 index 0000000..78b0784 --- /dev/null +++ b/src/main/resources/application-prod.properties @@ -0,0 +1,83 @@ +server.port=8081 + +# ţԿ +qiniu.accessKey=${QINIU_ACCESSKEY} +qiniu.secretKey=${QINIU_SECRETKEY} +qiniu.bucket=xiaohai +# sitemap ŵַ +sitemap.path=/www/wwwroot/celess.cn/sitemap.xml +# JWTʱԿ +jwt.secret=${JWT_SECRETKEY} + +#mybatis.type-handlers-package=cn.celess.blog.mapper.typehandler + + +spring.jpa.show-sql=false +spring.jpa.hibernate.ddl-auto=update +# ϴļĴС +spring.servlet.multipart.max-file-size=10MB +# ϴļܴС +spring.servlet.multipart.max-request-size=10MB + +spring.jackson.default-property-inclusion=non_null + +################# ݿ ################## +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.url=${MYSQL_URL_PROD} +spring.datasource.username=${MYSQL_USERNAME_PROD} +spring.datasource.password=${MYSQL_PASSWORD_PROD} +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver + + +################## mybatis ################## +mybatis.mapper-locations=classpath:mapper/*.xml +mybatis.type-aliases-package=cn.celess.blog.entity + + +pagehelper.helper-dialect=mysql +pagehelper.reasonable=true +pagehelper.support-methods-arguments=true +pagehelper.params=count=countSql + + +#### nginxĴ ȡʵip +server.use-forward-headers = true +server.tomcat.remote-ip-header = X-Real-IP +server.tomcat.protocol-header = X-Forwarded-Proto + + +############### email ############## +spring.mail.host=${MAIL_HOST_PROD} +spring.mail.username=${MAIL_USERNAME_PROD} +spring.mail.password=${MAIL_PWD_PROD} +spring.mail.properties.mail.smtp.auth=true +spring.mail.properties.mail.smtp.starttls.enable=true +spring.mail.properties.mail.smtp.starttls.required=true +spring.mail.default-encoding=UTF-8 +spring.mail.port=465 +spring.mail.properties.mail.smtp.socketFactory.port=465 +spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory +spring.mail.properties.mail.smtp.socketFactory.fallback=false + + + +############### redis ############## +# REDIS (RedisProperties) +# RedisݿĬΪ0 +spring.redis.database=0 +# Redisַ +spring.redis.host=127.0.0.1 +# RedisӶ˿ +spring.redis.port=6379 +# Redis루ĬΪգ +spring.redis.password=${REDIS_PROD} +# ӳʹøֵʾûƣ +spring.redis.jedis.pool.max-active=-1 +# ӳȴʱ䣨ʹøֵʾûƣ +spring.redis.jedis.pool.max-wait=-1 +# ӳе +spring.redis.jedis.pool.max-idle=8 +# ӳеС +spring.redis.jedis.pool.min-idle=0 +# ӳʱʱ䣨룩 +spring.redis.timeout=5000 \ No newline at end of file diff --git a/src/main/resources/application-test.properties b/src/main/resources/application-test.properties index 0864ee2..8dc731a 100644 --- a/src/main/resources/application-test.properties +++ b/src/main/resources/application-test.properties @@ -1,32 +1,32 @@ server.port=8081 -## 七牛的密钥配置 -qiniu.accessKey= -qiniu.secretKey= -qiniu.bucket= -## sitemap 存放地址 -sitemap.path= -## 生成JWT时候的密钥 -jwt.secret= +# ţԿ +qiniu.accessKey=${QINIU_ACCESSKEY} +qiniu.secretKey=${QINIU_SECRETKEY} +qiniu.bucket=xiaohai +# sitemap ŵַ +sitemap.path=classpath + # JWTʱԿ +jwt.secret=${JWT_SECRETKEY_TEST} ##spring.jpa.show-sql=false ##spring.jpa.hibernate.ddl-auto=update mybatis.type-handlers-package=cn.celess.blog.mapper.typehandler -# 上传单个文件的大小 +# ϴļĴС spring.servlet.multipart.max-file-size=10MB -# 上传文件的总大小 +# ϴļܴС spring.servlet.multipart.max-request-size=10MB spring.jackson.default-property-inclusion=non_null -################# 数据库 ################## +################# ݿ ################## spring.datasource.type=com.alibaba.druid.pool.DruidDataSource -spring.datasource.url= -spring.datasource.username= -spring.datasource.password= +spring.datasource.url=${MYSQL_URL_TEST} +spring.datasource.username=${MYSQL_USERNAME_TEST} +spring.datasource.password=${MYSQL_PASSWORD_TEST} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver @@ -42,16 +42,16 @@ pagehelper.params=count=countSql -#### 用于nginx的代理 获取真实ip +#### nginxĴ ȡʵip server.use-forward-headers = true server.tomcat.remote-ip-header = X-Real-IP server.tomcat.protocol-header = X-Forwarded-Proto ############### email ############## -spring.mail.host= -spring.mail.username= -spring.mail.password= +spring.mail.host=${MAIL_HOST_PROD} +spring.mail.username=${MAIL_USERNAME_PROD} +spring.mail.password=${MAIL_PWD_PROD} spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true spring.mail.properties.mail.smtp.starttls.required=true @@ -66,22 +66,22 @@ spring.mail.properties.mail.smtp.socketFactory.fallback=false ############### redis ############## # REDIS (RedisProperties) -# Redis数据库索引(默认为0) +# RedisݿĬΪ0 spring.redis.database=1 -# Redis服务器地址 -spring.redis.host=127.0.0.1 -# Redis服务器连接端口 +# Redisַ +spring.redis.host=celess.cn +# RedisӶ˿ spring.redis.port=6379 -# Redis服务器连接密码(默认为空) -spring.redis.password= -# 连接池最大连接数(使用负值表示没有限制) +# Redis루ĬΪգ +spring.redis.password=${REDIS_PROD} +# ӳʹøֵʾûƣ spring.redis.jedis.pool.max-active=-1 -# 连接池最大阻塞等待时间(使用负值表示没有限制) +# ӳȴʱ䣨ʹøֵʾûƣ spring.redis.jedis.pool.max-wait=-1 -# 连接池中的最大空闲连接 +# ӳе spring.redis.jedis.pool.max-idle=8 -# 连接池中的最小空闲连接 +# ӳеС spring.redis.jedis.pool.min-idle=0 -# 连接超时时间(毫秒) +# ӳʱʱ䣨룩 spring.redis.timeout=5000