Advertisement
nrdmtt

Untitled

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