jetlinks-community/jetlinks-standalone/src/main/resources/application.yml

285 lines
9.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
port: 8848
spring:
profiles:
active: dev
application:
name: jetlinks-platform
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Shanghai
serialization:
WRITE_DATES_AS_TIMESTAMPS: true
default-property-inclusion: non_null
codec:
max-in-memory-size: 100MB
web:
resources:
static-locations: file:./static/,/,classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/, classpath:/public/
data:
redis:
host: 127.0.0.1
port: 6379
lettuce:
pool:
max-active: 1024
timeout: 20s
# database: 3
# max-wait: 10s
r2dbc:
# 需要手动创建数据库,启动会自动创建表,修改了配置easyorm相关配置也要修改
url: r2dbc:postgresql://127.0.0.1:5432/jetlinks
# url: r2dbc:mysql://127.0.0.1:3306/jetlinks?ssl=false&serverZoneId=Asia/Shanghai # 修改了配置easyorm相关配置也要修改
username: postgres
password: jetlinks
pool:
max-size: 128
max-idle-time: 2m # 值不能大于mysql server的wait_timeout配置
max-life-time: 10m
max-acquire-time: 30s
reactor:
debug-agent:
enabled: false
# elasticsearch:
# uris: 127.0.0.1:9200
# socket-timeout: 10s
# connection-timeout: 15s
easyorm:
default-schema: public # 数据库默认的schema
dialect: postgres #数据库方言
timescaledb:
enabled: true
shared-spring: true # 默认共享spring的连接
# r2dbc:
# url: r2dbc:postgresql://localhost:15432/jetlinks
# username: postgres
# password: p@ssw0rd
schema: ${easyorm.default-schema}
time-series:
enabled: true
retention-policies:
# 设备会话统计只保留30天
- table: device_session_metric
interval: 30d
# 设备消息统计只保留30天
- table: device_metrics
interval: 30d
things-data:
enabled: true # 开启设备数据存储
# retention-policy: 30d # 保留策略,30天
# chunk-time-interval: 1d # 分区时间间隔,1天
tdengine:
enabled: false # 使用tdengine来存储设备数据
database: jetlinks
restful:
endpoints:
- http://127.0.0.1:6041/
username: root
password: taosdata
elasticsearch:
index:
default-strategy: time-by-month #默认es的索引按月进行分表, direct则为直接操作索引.
settings:
number-of-shards: 1 # es 分片数量
number-of-replicas: 0 # 副本数量
device:
message:
writer:
time-series:
enabled: true #对设备数据进行持久化
captcha:
enabled: false # 开启验证码
ttl: 2m #验证码过期时间,2分钟
hsweb:
cors:
enable: true
configs:
- path: /**
allowed-headers: "*"
allowed-methods: [ "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS" ]
allowed-origins: [ "*" ] ## 生产环境请替换为具体的域名端口如: http://xxxxx
max-age: 1800
dict:
enum-packages: org.jetlinks
webflux:
response-wrapper:
enabled: true #开启响应包装器(将返回值包装为ResponseMessage)
excludes: # 这下包下的接口不包装
- org.springdoc
authorize:
auto-parse: true
# user-token:
# allopatric-login-mode: offlineOther # 设置异地登录模式为 将其他地方登录的相同用户踢下线
# allopatric-login-modes:
# app: offlineOther
permission:
filter:
enabled: true # 设置为true开启权限过滤,赋权时,不能赋予比自己多的权限.
exclude-username: admin # admin用户不受上述限制
un-auth-strategy: ignore # error表示:发生越权时,抛出403错误. ignore表示会忽略越权的赋权.
cache:
type: redis
redis:
local-cache-type: guava
file:
manager:
storage-base-path: ./data/files
api:
# 访问api接口的根地址
base-path: http://127.0.0.1:${server.port}
jetlinks:
server-id: ${spring.application.name}:${server.port} #设备服务网关服务ID,不同服务请设置不同的ID
logging:
system:
context:
server: ${spring.application.name}
device:
storage:
default-policy: timescaledb-row # 默认设备数据存储策略
enable-last-data-in-db: false # 是否将设备最新到数据存储到数据库
authentication:
defaults:
user:
admin:
- "*:*"
user-init:
enabled: true
users: # 系统初始用户密码
- username: admin
password: ${ADMIN_USER_PASSWORD:JetLinks.C0mmVn1ty}
name: Administrator
type: admin
rule:
engine:
server-id: ${jetlinks.server-id}
server-name: ${spring.application.name}
logging:
level:
org.jetlinks: debug
rule.engine: debug
org.hswebframework: debug
org.springframework.transaction: debug
org.springframework.data.r2dbc.connectionfactory: warn
io.micrometer: warn
org.hswebframework.expands: error
system: debug
org.jetlinks.rule.engine: warn
org.jetlinks.supports.event: warn
org.springframework: warn
org.jetlinks.community.device.message.writer: warn
org.jetlinks.community.timeseries.micrometer: warn
org.jetlinks.community.elastic.search.service.reactive: trace
org.jetlinks.community.network: warn
io.vertx.mqtt.impl: warn
org.jetlinks.supports.scalecube.rpc: warn
"org.jetlinks.community.buffer": debug
org.elasticsearch: error
org.elasticsearch.deprecation: off
"io.vertx.core.impl.ContextImpl": off
"org.hswebframework.web.starter.jackson": warn
"org.jetlinks.community.timescaledb.impl.DefaultTimescaleDBDataWriter": warn
config: classpath:logback-spring.xml
vertx:
max-event-loop-execute-time-unit: seconds
max-event-loop-execute-time: 30
max-worker-execute-time-unit: seconds
max-worker-execute-time: 30
prefer-native-transport: true
micrometer:
time-series:
tags:
server: ${spring.application.name}
metrics:
default:
step: 30s
system:
config:
scopes:
- id: front
name: 前端配置
public-access: true
- id: paths
name: 访问路径配置
public-access: true
properties:
- key: base-path
name: 接口根路径
default-value: http://127.0.0.1:9000/api
- id: amap
name: 高德地图配置
public-access: false
properties:
- key: apiKey # 配置id
name: 高德地图ApiKey # 名称
management:
health:
elasticsearch:
enabled: false
elastic:
metrics:
export:
enabled: false
simple:
metrics:
export:
enabled: false
# knife4j的增强配置不需要增强可以不配
knife4j:
enable: true
setting:
language: zh_cn
springdoc:
openapi:
info:
title: "jetlinks"
description: "jetlinks平台API"
version: "2.10"
api-docs:
enabled: true
path: /v3/api-docs
swagger-ui:
path: /swagger-ui.html
use-root-path: false
enabled: true
disable-swagger-default-url: true
# packages-to-scan: org.jetlinks
group-configs:
- group: 设备管理相关接口
packages-to-scan:
- org.jetlinks.community.device
paths-to-exclude:
- /device-instance/**
- /device-product/**
- /protocol/**
- group: 规则引擎相关接口
packages-to-scan: org.jetlinks.community.rule.engine.web
paths-to-exclude: /api/**
- group: 通知管理相关接口
packages-to-scan: org.jetlinks.community.notify.manager.web
- group: 设备接入相关接口
packages-to-scan:
- org.jetlinks.community.network.manager.web
- org.jetlinks.community.device.web
paths-to-match:
- /gateway/**
- /network/**
- /protocol/**
- group: 系统管理相关接口
packages-to-scan:
- org.jetlinks.community.auth
- org.hswebframework.web.system.authorization.defaults.webflux
- org.hswebframework.web.file
- org.jetlinks.community.io.file.web
- org.hswebframework.web.authorization.basic.web
- org.jetlinks.community.logging.controller
cache:
disabled: false
network:
resources:
- 1883-1890
- 8800-8810
- 5060-5061