Advertisement
nrdmtt

Untitled

Nov 13th, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.79 KB | None | 0 0
  1. #
  2. # Copyright © 2016-2018 The Thingsboard Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16.  
  17. server:
  18. # Server bind address
  19. address: "${HTTP_BIND_ADDRESS:0.0.0.0}"
  20. # Server bind port
  21. port: "${HTTP_BIND_PORT:8080}"
  22. # Server SSL configuration
  23. ssl:
  24. # Enable/disable SSL support
  25. enabled: "${SSL_ENABLED:false}"
  26. # Path to the key store that holds the SSL certificate
  27. key-store: "${SSL_KEY_STORE:classpath:keystore/keystore.p12}"
  28. # Password used to access the key store
  29. key-store-password: "${SSL_KEY_STORE_PASSWORD:thingsboard}"
  30. # Type of the key store
  31. key-store-type: "${SSL_KEY_STORE_TYPE:PKCS12}"
  32. # Alias that identifies the key in the key store
  33. key-alias: "${SSL_KEY_ALIAS:tomcat}"
  34.  
  35. # Zookeeper connection parameters. Used for service discovery.
  36. zk:
  37. # Enable/disable zookeeper discovery service.
  38. enabled: "${ZOOKEEPER_ENABLED:false}"
  39. # Zookeeper connect string
  40. url: "${ZOOKEEPER_URL:localhost:2181}"
  41. # Zookeeper retry interval in milliseconds
  42. retry_interval_ms: "${ZOOKEEPER_RETRY_INTERVAL_MS:3000}"
  43. # Zookeeper connection timeout in milliseconds
  44. connection_timeout_ms: "${ZOOKEEPER_CONNECTION_TIMEOUT_MS:3000}"
  45. # Zookeeper session timeout in milliseconds
  46. session_timeout_ms: "${ZOOKEEPER_SESSION_TIMEOUT_MS:3000}"
  47. # Name of the directory in zookeeper 'filesystem'
  48. zk_dir: "${ZOOKEEPER_NODES_DIR:/thingsboard}"
  49.  
  50. # RPC connection parameters. Used only in cluster mode only.
  51. rpc:
  52. bind_host: "${RPC_HOST:localhost}"
  53. bind_port: "${RPC_PORT:9001}"
  54.  
  55. # Clustering properties related to consistent-hashing. See architecture docs for more details.
  56. cluster:
  57. # Name of hash function used for consistent hash ring.
  58. hash_function_name: "${CLUSTER_HASH_FUNCTION_NAME:murmur3_128}"
  59. # Amount of virtual nodes in consistent hash ring.
  60. vitrual_nodes_size: "${CLUSTER_VIRTUAL_NODES_SIZE:16}"
  61. # Queue partition id for current node
  62. partition_id: "${QUEUE_PARTITION_ID:0}"
  63.  
  64. # Plugins configuration parameters
  65. plugins:
  66. # Comma seperated package list used during classpath scanning for plugins
  67. scan_packages: "${PLUGINS_SCAN_PACKAGES:org.thingsboard.server.extensions,org.thingsboard.rule.engine}"
  68.  
  69. # JWT Token parameters
  70. security.jwt:
  71. tokenExpirationTime: "${JWT_TOKEN_EXPIRATION_TIME:900}" # Number of seconds (15 mins)
  72. refreshTokenExpTime: "${JWT_REFRESH_TOKEN_EXPIRATION_TIME:3600}" # Seconds (1 hour)
  73. tokenIssuer: "${JWT_TOKEN_ISSUER:thingsboard.io}"
  74. tokenSigningKey: "${JWT_TOKEN_SIGNING_KEY:thingsboardDefaultSigningKey}"
  75.  
  76. # Device communication protocol parameters
  77. http:
  78. request_timeout: "${HTTP_REQUEST_TIMEOUT:60000}"
  79.  
  80. # MQTT server parameters
  81. mqtt:
  82. # Enable/disable mqtt transport protocol.
  83. enabled: "${MQTT_ENABLED:true}"
  84. bind_address: "${MQTT_BIND_ADDRESS:0.0.0.0}"
  85. bind_port: "${MQTT_BIND_PORT:1888}"
  86. adaptor: "${MQTT_ADAPTOR_NAME:JsonMqttAdaptor}"
  87. timeout: "${MQTT_TIMEOUT:10000}"
  88. netty:
  89. leak_detector_level: "${NETTY_LEASK_DETECTOR_LVL:DISABLED}"
  90. boss_group_thread_count: "${NETTY_BOSS_GROUP_THREADS:1}"
  91. worker_group_thread_count: "${NETTY_WORKER_GROUP_THREADS:12}"
  92. max_payload_size: "${NETTY_MAX_PAYLOAD_SIZE:65536}"
  93. # MQTT SSL configuration
  94. ssl:
  95. # Enable/disable SSL support
  96. enabled: "${MQTT_SSL_ENABLED:false}"
  97. # SSL protocol: See http://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html#SSLContext
  98. protocol: "${MQTT_SSL_PROTOCOL:TLSv1.2}"
  99. # Path to the key store that holds the SSL certificate
  100. key_store: "${MQTT_SSL_KEY_STORE:mqttserver.jks}"
  101. # Password used to access the key store
  102. key_store_password: "${MQTT_SSL_KEY_STORE_PASSWORD:server_ks_password}"
  103. # Password used to access the key
  104. key_password: "${MQTT_SSL_KEY_PASSWORD:server_key_password}"
  105. # Type of the key store
  106. key_store_type: "${MQTT_SSL_KEY_STORE_TYPE:JKS}"
  107.  
  108. # CoAP server parameters
  109. coap:
  110. # Enable/disable coap transport protocol.
  111. enabled: "${COAP_ENABLED:false}"
  112. bind_address: "${COAP_BIND_ADDRESS:0.0.0.0}"
  113. bind_port: "${COAP_BIND_PORT:5683}"
  114. adaptor: "${COAP_ADAPTOR_NAME:JsonCoapAdaptor}"
  115. timeout: "${COAP_TIMEOUT:10000}"
  116.  
  117. #Quota parameters
  118. quota:
  119. host:
  120. # Max allowed number of API requests in interval for single host
  121. limit: "${QUOTA_HOST_LIMIT:10000}"
  122. # Interval duration
  123. intervalMs: "${QUOTA_HOST_INTERVAL_MS:60000}"
  124. # Maximum silence duration for host after which Host removed from QuotaService. Must be bigger than intervalMs
  125. ttlMs: "${QUOTA_HOST_TTL_MS:60000}"
  126. # Interval for scheduled task that cleans expired records. TTL is used for expiring
  127. cleanPeriodMs: "${QUOTA_HOST_CLEAN_PERIOD_MS:300000}"
  128. # Enable Host API Limits
  129. enabled: "${QUOTA_HOST_ENABLED:false}"
  130. # Array of whitelist hosts
  131. whitelist: "${QUOTA_HOST_WHITELIST:localhost,127.0.0.1}"
  132. # Array of blacklist hosts
  133. blacklist: "${QUOTA_HOST_BLACKLIST:}"
  134. log:
  135. topSize: 10
  136. intervalMin: 2
  137. rule:
  138. tenant:
  139. # Max allowed number of API requests in interval for single tenant
  140. limit: "${QUOTA_TENANT_LIMIT:100000}"
  141. # Interval duration
  142. intervalMs: "${QUOTA_TENANT_INTERVAL_MS:60000}"
  143. # Maximum silence duration for tenant after which Tenant removed from QuotaService. Must be bigger than intervalMs
  144. ttlMs: "${QUOTA_TENANT_TTL_MS:60000}"
  145. # Interval for scheduled task that cleans expired records. TTL is used for expiring
  146. cleanPeriodMs: "${QUOTA_TENANT_CLEAN_PERIOD_MS:300000}"
  147. # Enable Host API Limits
  148. enabled: "${QUOTA_TENANT_ENABLED:false}"
  149. # Array of whitelist tenants
  150. whitelist: "${QUOTA_TENANT_WHITELIST:}"
  151. # Array of blacklist tenants
  152. blacklist: "${QUOTA_HOST_BLACKLIST:}"
  153. log:
  154. topSize: 10
  155. intervalMin: 2
  156.  
  157. database:
  158. type: "${DATABASE_TYPE:sql}" # cassandra OR sql
  159.  
  160. # Cassandra driver configuration parameters
  161. cassandra:
  162. # Thingsboard cluster name
  163. cluster_name: "${CASSANDRA_CLUSTER_NAME:Thingsboard Cluster}"
  164. # Thingsboard keyspace name
  165. keyspace_name: "${CASSANDRA_KEYSPACE_NAME:thingsboard}"
  166. # Specify node list
  167. url: "${CASSANDRA_URL:127.0.0.1:9042}"
  168. # Enable/disable secure connection
  169. ssl: "${CASSANDRA_USE_SSL:false}"
  170. # Enable/disable JMX
  171. jmx: "${CASSANDRA_USE_JMX:true}"
  172. # Enable/disable metrics collection.
  173. metrics: "${CASSANDRA_DISABLE_METRICS:true}"
  174. # NONE SNAPPY LZ4
  175. compression: "${CASSANDRA_COMPRESSION:none}"
  176. # Specify cassandra claster initialization timeout (if no hosts available during startup)
  177. init_timeout_ms: "${CASSANDRA_CLUSTER_INIT_TIMEOUT_MS:300000}"
  178. # Specify cassandra claster initialization retry interval (if no hosts available during startup)
  179. init_retry_interval_ms: "${CASSANDRA_CLUSTER_INIT_RETRY_INTERVAL_MS:3000}"
  180.  
  181. # Credential parameters #
  182. credentials: "${CASSANDRA_USE_CREDENTIALS:false}"
  183. # Specify your username
  184. username: "${CASSANDRA_USERNAME:}"
  185. # Specify your password
  186. password: "${CASSANDRA_PASSWORD:}"
  187.  
  188. # Cassandra cluster connection socket parameters #
  189. socket:
  190. connect_timeout: "${CASSANDRA_SOCKET_TIMEOUT:5000}"
  191. read_timeout: "${CASSANDRA_SOCKET_READ_TIMEOUT:20000}"
  192. keep_alive: "${CASSANDRA_SOCKET_KEEP_ALIVE:true}"
  193. reuse_address: "${CASSANDRA_SOCKET_REUSE_ADDRESS:true}"
  194. so_linger: "${CASSANDRA_SOCKET_SO_LINGER:}"
  195. tcp_no_delay: "${CASSANDRA_SOCKET_TCP_NO_DELAY:false}"
  196. receive_buffer_size: "${CASSANDRA_SOCKET_RECEIVE_BUFFER_SIZE:}"
  197. send_buffer_size: "${CASSANDRA_SOCKET_SEND_BUFFER_SIZE:}"
  198.  
  199. # Cassandra cluster connection query parameters #
  200. query:
  201. read_consistency_level: "${CASSANDRA_READ_CONSISTENCY_LEVEL:ONE}"
  202. write_consistency_level: "${CASSANDRA_WRITE_CONSISTENCY_LEVEL:ONE}"
  203. default_fetch_size: "${CASSANDRA_DEFAULT_FETCH_SIZE:2000}"
  204. # Specify partitioning size for timestamp key-value storage. Example MINUTES, HOURS, DAYS, MONTHS
  205. ts_key_value_partitioning: "${TS_KV_PARTITIONING:MONTHS}"
  206. ts_key_value_ttl: "${TS_KV_TTL:0}"
  207. buffer_size: "${CASSANDRA_QUERY_BUFFER_SIZE:200000}"
  208. concurrent_limit: "${CASSANDRA_QUERY_CONCURRENT_LIMIT:1000}"
  209. permit_max_wait_time: "${PERMIT_MAX_WAIT_TIME:120000}"
  210. rate_limit_print_interval_ms: "${CASSANDRA_QUERY_RATE_LIMIT_PRINT_MS:30000}"
  211.  
  212. queue:
  213. msg.ttl: 604800 # 7 days
  214. ack.ttl: 604800 # 7 days
  215. partitions.ttl: 604800 # 7 days
  216. partitioning: "HOURS"
  217.  
  218. # SQL configuration parameters
  219. sql:
  220. # Specify executor service type used to perform timeseries insert tasks: SINGLE FIXED CACHED
  221. ts_inserts_executor_type: "${SQL_TS_INSERTS_EXECUTOR_TYPE:fixed}"
  222. # Specify thread pool size for FIXED executor service type
  223. ts_inserts_fixed_thread_pool_size: "${SQL_TS_INSERTS_FIXED_THREAD_POOL_SIZE:10}"
  224.  
  225. # Actor system parameters
  226. actors:
  227. tenant:
  228. create_components_on_init: "${ACTORS_TENANT_CREATE_COMPONENTS_ON_INIT:true}"
  229. session:
  230. max_concurrent_sessions_per_device: "${ACTORS_MAX_CONCURRENT_SESSION_PER_DEVICE:1}"
  231. sync:
  232. # Default timeout for processing request using synchronous session (HTTP, CoAP) in milliseconds
  233. timeout: "${ACTORS_SESSION_SYNC_TIMEOUT:10000}"
  234. rule:
  235. # Specify thread pool size for database request callbacks executor service
  236. db_callback_thread_pool_size: "${ACTORS_RULE_DB_CALLBACK_THREAD_POOL_SIZE:1}"
  237. # Specify thread pool size for javascript executor service
  238. js_thread_pool_size: "${ACTORS_RULE_JS_THREAD_POOL_SIZE:10}"
  239. # Specify thread pool size for mail sender executor service
  240. mail_thread_pool_size: "${ACTORS_RULE_MAIL_THREAD_POOL_SIZE:10}"
  241. # Whether to allow usage of system mail service for rules
  242. allow_system_mail_service: "${ACTORS_RULE_ALLOW_SYSTEM_MAIL_SERVICE:true}"
  243. # Specify thread pool size for external call service
  244. external_call_thread_pool_size: "${ACTORS_RULE_EXTERNAL_CALL_THREAD_POOL_SIZE:10}"
  245. js_sandbox:
  246. # Use Sandboxed (secured) JavaScript environment
  247. use_js_sandbox: "${ACTORS_RULE_JS_SANDBOX_USE_JS_SANDBOX:true}"
  248. # Specify thread pool size for JavaScript sandbox resource monitor
  249. monitor_thread_pool_size: "${ACTORS_RULE_JS_SANDBOX_MONITOR_THREAD_POOL_SIZE:4}"
  250. # Maximum CPU time in milliseconds allowed for script execution
  251. max_cpu_time: "${ACTORS_RULE_JS_SANDBOX_MAX_CPU_TIME:100}"
  252. # Maximum allowed JavaScript execution errors before JavaScript will be blacklisted
  253. max_errors: "${ACTORS_RULE_JS_SANDBOX_MAX_ERRORS:3}"
  254. chain:
  255. # Errors for particular actor are persisted once per specified amount of milliseconds
  256. error_persist_frequency: "${ACTORS_RULE_CHAIN_ERROR_FREQUENCY:3000}"
  257. node:
  258. # Errors for particular actor are persisted once per specified amount of milliseconds
  259. error_persist_frequency: "${ACTORS_RULE_NODE_ERROR_FREQUENCY:3000}"
  260. queue:
  261. # Message queue type
  262. type: "${ACTORS_RULE_QUEUE_TYPE:memory}"
  263. # Message queue maximum size (per tenant)
  264. max_size: "${ACTORS_RULE_QUEUE_MAX_SIZE:100}"
  265. # Message queue cleanup period in seconds
  266. cleanup_period: "${ACTORS_RULE_QUEUE_CLEANUP_PERIOD:3600}"
  267. statistics:
  268. # Enable/disable actor statistics
  269. enabled: "${ACTORS_STATISTICS_ENABLED:true}"
  270. persist_frequency: "${ACTORS_STATISTICS_PERSIST_FREQUENCY:3600000}"
  271. queue:
  272. # Enable/disable persistence of un-processed messages to the queue
  273. enabled: "${ACTORS_QUEUE_ENABLED:true}"
  274. # Maximum allowed timeout for persistence into the queue
  275. timeout: "${ACTORS_QUEUE_PERSISTENCE_TIMEOUT:30000}"
  276. client_side_rpc:
  277. timeout: "${CLIENT_SIDE_RPC_TIMEOUT:60000}"
  278.  
  279. cache:
  280. # caffeine or redis
  281. type: "${CACHE_TYPE:caffeine}"
  282.  
  283. caffeine:
  284. specs:
  285. relations:
  286. timeToLiveInMinutes: 1440
  287. maxSize: 100000
  288. deviceCredentials:
  289. timeToLiveInMinutes: 1440
  290. maxSize: 100000
  291. devices:
  292. timeToLiveInMinutes: 1440
  293. maxSize: 100000
  294.  
  295. redis:
  296. # standalone or cluster
  297. connection:
  298. type: standalone
  299. host: "${REDIS_HOST:localhost}"
  300. port: "${REDIS_PORT:6379}"
  301. db: "${REDIS_DB:0}"
  302. password: "${REDIS_PASSWORD:}"
  303.  
  304. # Check new version updates parameters
  305. updates:
  306. # Enable/disable updates checking.
  307. enabled: "${UPDATES_ENABLED:true}"
  308.  
  309. # spring CORS configuration
  310. spring.mvc.cors:
  311. mappings:
  312. # Intercept path
  313. "/api/auth/**":
  314. #Comma-separated list of origins to allow. '*' allows all origins. When not set,CORS support is disabled.
  315. allowed-origins: "*"
  316. #Comma-separated list of methods to allow. '*' allows all methods.
  317. allowed-methods: "POST,GET,OPTIONS"
  318. #Comma-separated list of headers to allow in a request. '*' allows all headers.
  319. allowed-headers: "*"
  320. #How long, in seconds, the response from a pre-flight request can be cached by clients.
  321. max-age: "1800"
  322. #Set whether credentials are supported. When not set, credentials are not supported.
  323. allow-credentials: "true"
  324. "/api/v1/**":
  325. allowed-origins: "*"
  326. allowed-methods: "*"
  327. allowed-headers: "*"
  328. max-age: "1800"
  329. allow-credentials: "true"
  330.  
  331. # spring serve gzip compressed static resources
  332. spring.resources.chain:
  333. gzipped: "true"
  334. strategy:
  335. content:
  336. enabled: "true"
  337.  
  338. # HSQLDB DAO Configuration
  339. #spring:
  340. # data:
  341. # jpa:
  342. # repositories:
  343. # enabled: "true"
  344. # jpa:
  345. # hibernate:
  346. # ddl-auto: "validate"
  347. # database-platform: "${SPRING_JPA_DATABASE_PLATFORM:org.hibernate.dialect.HSQLDialect}"
  348. # datasource:
  349. # driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.hsqldb.jdbc.JDBCDriver}"
  350. # url: "${SPRING_DATASOURCE_URL:jdbc:hsqldb:file:${SQL_DATA_FOLDER:/tmp}/thingsboardDb;sql.enforce_size=false;hsqldb.log_size=5}"
  351. # username: "${SPRING_DATASOURCE_USERNAME:sa}"
  352. # password: "${SPRING_DATASOURCE_PASSWORD:}"
  353.  
  354. # PostgreSQL DAO Configuration
  355. spring:
  356. data:
  357. sql:
  358. repositories:
  359. enabled: "true"
  360. sql:
  361. hibernate:
  362. ddl-auto: "validate"
  363. database-platform: "${SPRING_JPA_DATABASE_PLATFORM:org.hibernate.dialect.PostgreSQLDialect}"
  364. datasource:
  365. driverClassName: "${SPRING_DRIVER_CLASS_NAME:org.postgresql.Driver}"
  366. url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard}"
  367. username: "${SPRING_DATASOURCE_USERNAME:postgres}"
  368. password: "${SPRING_DATASOURCE_PASSWORD:######################}"
  369.  
  370. # Audit log parameters
  371. audit_log:
  372. # Enable/disable audit log functionality.
  373. enabled: "${AUDIT_LOG_ENABLED:true}"
  374. # Specify partitioning size for audit log by tenant id storage. Example MINUTES, HOURS, DAYS, MONTHS
  375. by_tenant_partitioning: "${AUDIT_LOG_BY_TENANT_PARTITIONING:MONTHS}"
  376. # Number of days as history period if startTime and endTime are not specified
  377. default_query_period: "${AUDIT_LOG_DEFAULT_QUERY_PERIOD:30}"
  378. # Logging levels per each entity type.
  379. # Allowed values: OFF (disable), W (log write operations), RW (log read and write operations)
  380. logging_level:
  381. mask:
  382. "device": "${AUDIT_LOG_MASK_DEVICE:W}"
  383. "asset": "${AUDIT_LOG_MASK_ASSET:W}"
  384. "dashboard": "${AUDIT_LOG_MASK_DASHBOARD:W}"
  385. "customer": "${AUDIT_LOG_MASK_CUSTOMER:W}"
  386. "user": "${AUDIT_LOG_MASK_USER:W}"
  387. "rule_chain": "${AUDIT_LOG_MASK_RULE_CHAIN:W}"
  388. "alarm": "${AUDIT_LOG_MASK_ALARM:W}"
  389. sink:
  390. # Type of external sink. possible options: none, elasticsearch
  391. type: "${AUDIT_LOG_SINK_TYPE:none}"
  392. # Name of the index where audit logs stored
  393. # Index name could contain next placeholders (not mandatory):
  394. # @{TENANT} - substituted by tenant ID
  395. # @{DATE} - substituted by current date in format provided in audit_log.sink.date_format
  396. index_pattern: "${AUDIT_LOG_SINK_INDEX_PATTERN:@{TENANT}_AUDIT_LOG_@{DATE}}"
  397. # Date format. Details of the pattern could be found here:
  398. # https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
  399. date_format: "${AUDIT_LOG_SINK_DATE_FORMAT:YYYY.MM.DD}"
  400. scheme_name: "${AUDIT_LOG_SINK_SCHEME_NAME:http}" # http or https
  401. host: "${AUDIT_LOG_SINK_HOST:localhost}"
  402. port: "${AUDIT_LOG_SINK_POST:9200}"
  403. user_name: "${AUDIT_LOG_SINK_USER_NAME:}"
  404. password: "${AUDIT_LOG_SINK_PASSWORD:}"
  405.  
  406. state:
  407. defaultInactivityTimeoutInSec: 10
  408. defaultStateCheckIntervalInSec: 10
  409. # TODO in v2.1
  410. # defaultStatePersistenceIntervalInSec: 60
  411. # defaultStatePersistencePack: 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement