#
# Copyright (C) 2017 优客服-多渠道客服系统
# Modifications copyright (C) 2018-2020 Chatopera Inc, <https://www.chatopera.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# 如何加载配置文件
# https://docs.spring.io/spring-boot/docs/1.5.6.RELEASE/reference/htmlsingle/
# https://stackoverflow.com/questions/35531661/using-env-variable-in-spring-boots-application-properties

# 在集群状态下，每个Node都有自己唯一的ID
application.node.id=localhost
application.build.datestr=PLACEHOLDER
application.customer.entity=Trial

##############################################
# 安全设置
##############################################
# cookie加密
application.security.password=cskefu

# security
management.security.enabled=false
server.session-timeout=86400
server.threads.max=2000
server.connection.max=2000


##############################################
# 服务端口
##############################################
# server
server.port=8035
server.context-path=/

# IM Server
uk.im.server.port=8036
uk.im.server.host=localhost
uk.im.server.threads=1000
cs.im.server.ssl.port=

# 文件上传限制
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=15MB
spring.servlet.multipart.max-request-size=15MB

server.tomcat.remote-ip-header=x-forwarded-for
server.tomcat.protocol-header=x-forwarded-proto
# Setting max size of post requests to 100MB
server.tomcat.max-http-post-size=1000000000
server.tomcat.max-swallow-size=1000000000
# The maximum number of request processing threads to be created by this Connector
server.tomcat.max-threads=400

##############################################
# 日志及临时文件存储
##############################################
server.log.path=../logs
server.log.level=INFO
web.upload-path=../data

##############################################
# Pug4j
##############################################
spring.pug4j.cache=true
spring.pug4j.template-loader-path=classpath:/templates/

##############################################
# Spring Data
##############################################
spring.data.jpa.repositories.enabled=true
spring.data.redis.repositories.enabled=false

# Elasticsearch
spring.data.elasticsearch.properties.path.data=../data

spring.data.elasticsearch.cluster-name=elasticsearch
spring.data.elasticsearch.cluster-nodes=127.0.0.1:9300
spring.data.elasticsearch.local=false
spring.data.elasticsearch.repositories.enabled=true

spring.data.elasticsearch.properties.index.max_result_window=100000

spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/cosinee?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=123456

# MySQL Blob
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=true

##Druid
# \u521D\u59CB\u5316\u5927\u5C0F\uFF0C\u6700\u5C0F\uFF0C\u6700\u5927
spring.datasource.druid.initial-size=5
spring.datasource.druid.max-active=100
spring.datasource.druid.min-idle=5
# \u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
spring.datasource.druid.max-wait=60000
# \u6253\u5F00PSCache\uFF0C\u5E76\u4E14\u6307\u5B9A\u6BCF\u4E2A\u8FDE\u63A5\u4E0APSCache\u7684\u5927\u5C0F
spring.datasource.druid.pool-prepared-statements=true
spring.datasource.druid.max-pool-prepared-statement-per-connection-size=20
#spring.datasource.druid.max-open-prepared-statements= #\u548C\u4E0A\u9762\u7684\u7B49\u4EF7
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
spring.datasource.druid.validation-query-timeout=60000
spring.datasource.druid.test-on-borrow=false
spring.datasource.druid.test-on-return=false
spring.datasource.druid.test-while-idle=true
# \u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
spring.datasource.druid.time-between-eviction-runs-millis=60000
# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
spring.datasource.druid.min-evictable-idle-time-millis=100000
# \u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5927\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
#spring.datasource.druid.max-evictable-idle-time-millis=
spring.datasource.druid.filters=stat,wall,log4j
# WebStatFilter\u914D\u7F6E\uFF0C\u8BF4\u660E\u8BF7\u53C2\u8003Druid Wiki\uFF0C\u914D\u7F6E_\u914D\u7F6EWebStatFilter
spring.datasource.druid.web-stat-filter.enabled=true
spring.datasource.druid.web-stat-filter.url-pattern=/*

##############################################
# Cache
##############################################
## Available create_by_force, skip
cache.setup.strategy=create_by_force

##############################################
# Redis Connection
##############################################
# Redis数据库索引（默认为0）
spring.redis.database=2
spring.redis.session.db=1
spring.redis.token.db=3
# Redis服务器地址
spring.redis.host=localhost
# Redis服务器连接端口
spring.redis.port=6379
# Redis服务器连接密码（默认为空）
spring.redis.password=
# 连接池最大连接数（使用负值表示没有限制）
spring.redis.pool.max-active=-1
# 连接池最大阻塞等待时间（使用负值表示没有限制）
spring.redis.pool.max-wait=-1
# 连接池中的最大空闲连接
spring.redis.pool.max-idle=20
# 连接池中的最小空闲连接
spring.redis.pool.min-idle=10
# 连接超时时间（毫秒），因为春松客服启动时
# 占用比较大的时间，此处timeout值必须设置为0才能正常启动
spring.redis.timeout=0


##############################################
# ActiveMQ消息服务
##############################################
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.user=admin
spring.activemq.password=admin
spring.activemq.pool.enabled=true
spring.activemq.pool.max-connections=50


##############################################
# Actuator 监控数据采集
# https://docs.spring.io/spring-boot/docs/1.5.9.RELEASE/reference/html/production-ready-endpoints.html
##############################################
management.context-path=/actuator
endpoints.sensitive=true
endpoints.hypermedia.enabled=true
endpoints.prometheus.enabled=true
endpoints.metrics.enabled=true
endpoints.health.enabled=true
endpoints.info.enabled=true
endpoints.actuator.enabled=true
endpoints.beans.enabled=false
endpoints.auditevents.enabled=false
endpoints.autoconfig.enabled=false
endpoints.env.enabled=false
endpoints.loggers.enabled=false
endpoints.configprops.enabled=false
endpoints.mappings.enabled=false
endpoints.shutdown.enabled=false
endpoints.trace.enabled=false

##############################################
# 百度统计 Key
# https://tongji.baidu.com/
# 汇总使用情况：登录，打开页面，etc.
# 登录 -> 管理 -> 新增网站 -> 代码获取 -> 拷贝SiteKey
# hm.src = "https://hm.baidu.com/hm.js?YOUR_SITE_KEY";
# 加入后在百度统计内点击：代码安装检查，代码检查成功表示安装成功；注意网站域名等一致，数据收集有延迟。
##############################################
tongji.baidu.sitekey=

##############################################
# Callout Settings
##############################################
# Loop Interval
cskefu.callout.watch.interval=60000

##############################################
# 业务功能相关设置
##############################################
# 系统模块
cskefu.modules.contacts=true
cskefu.modules.cca=true
cskefu.modules.entim=true
cskefu.modules.report=true

# 是否开启渠道访客独立 https://gitlab.chatopera.com/chatopera/cosinee/issues/838
cskefu.settings.webim.visitor-separate=false

##############################################
# Skype渠道集成配置
##############################################
# 从外部系统获得 SkypeID对应的联系人信息
channel.skype.crm=

##############################################
# Miscs
##############################################
# 登陆页面公告
ads.login.banner=placeholder