Node-Red configuration
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

settings.js 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. /**
  2. * This is the default settings file provided by Node-RED.
  3. *
  4. * It can contain any valid JavaScript code that will get run when Node-RED
  5. * is started.
  6. *
  7. * Lines that start with // are commented out.
  8. * Each entry should be separated from the entries above and below by a comma ','
  9. *
  10. * For more information about individual settings, refer to the documentation:
  11. * https://nodered.org/docs/user-guide/runtime/configuration
  12. *
  13. * The settings are split into the following sections:
  14. * - Flow File and User Directory Settings
  15. * - Security
  16. * - Server Settings
  17. * - Runtime Settings
  18. * - Editor Settings
  19. * - Node Settings
  20. *
  21. **/
  22. module.exports = {
  23. /*******************************************************************************
  24. * Flow File and User Directory Settings
  25. * - flowFile
  26. * - credentialSecret
  27. * - flowFilePretty
  28. * - userDir
  29. * - nodesDir
  30. ******************************************************************************/
  31. /** The file containing the flows. If not set, defaults to flows_<hostname>.json **/
  32. flowFile: 'flows.json',
  33. /** By default, credentials are encrypted in storage using a generated key. To
  34. * specify your own secret, set the following property.
  35. * If you want to disable encryption of credentials, set this property to false.
  36. * Note: once you set this property, do not change it - doing so will prevent
  37. * node-red from being able to decrypt your existing credentials and they will be
  38. * lost.
  39. */
  40. //credentialSecret: "a-secret-key",
  41. /** By default, the flow JSON will be formatted over multiple lines making
  42. * it easier to compare changes when using version control.
  43. * To disable pretty-printing of the JSON set the following property to false.
  44. */
  45. flowFilePretty: true,
  46. /** By default, all user data is stored in a directory called `.node-red` under
  47. * the user's home directory. To use a different location, the following
  48. * property can be used
  49. */
  50. //userDir: '/home/nol/.node-red/',
  51. /** Node-RED scans the `nodes` directory in the userDir to find local node files.
  52. * The following property can be used to specify an additional directory to scan.
  53. */
  54. //nodesDir: '/home/nol/.node-red/nodes',
  55. /*******************************************************************************
  56. * Security
  57. * - adminAuth
  58. * - https
  59. * - httpsRefreshInterval
  60. * - requireHttps
  61. * - httpNodeAuth
  62. * - httpStaticAuth
  63. ******************************************************************************/
  64. /** To password protect the Node-RED editor and admin API, the following
  65. * property can be used. See http://nodered.org/docs/security.html for details.
  66. */
  67. //adminAuth: {
  68. // type: "credentials",
  69. // users: [{
  70. // username: "admin",
  71. // password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
  72. // permissions: "*"
  73. // }]
  74. //},
  75. /** The following property can be used to enable HTTPS
  76. * This property can be either an object, containing both a (private) key
  77. * and a (public) certificate, or a function that returns such an object.
  78. * See http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
  79. * for details of its contents.
  80. */
  81. /** Option 1: static object */
  82. //https: {
  83. // key: require("fs").readFileSync('privkey.pem'),
  84. // cert: require("fs").readFileSync('cert.pem')
  85. //},
  86. /** Option 2: function that returns the HTTP configuration object */
  87. // https: function() {
  88. // // This function should return the options object, or a Promise
  89. // // that resolves to the options object
  90. // return {
  91. // key: require("fs").readFileSync('privkey.pem'),
  92. // cert: require("fs").readFileSync('cert.pem')
  93. // }
  94. // },
  95. /** If the `https` setting is a function, the following setting can be used
  96. * to set how often, in hours, the function will be called. That can be used
  97. * to refresh any certificates.
  98. */
  99. //httpsRefreshInterval : 12,
  100. /** The following property can be used to cause insecure HTTP connections to
  101. * be redirected to HTTPS.
  102. */
  103. //requireHttps: true,
  104. /** To password protect the node-defined HTTP endpoints (httpNodeRoot),
  105. * including node-red-dashboard, or the static content (httpStatic), the
  106. * following properties can be used.
  107. * The `pass` field is a bcrypt hash of the password.
  108. * See http://nodered.org/docs/security.html#generating-the-password-hash
  109. */
  110. //httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
  111. //httpStaticAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
  112. /*******************************************************************************
  113. * Server Settings
  114. * - uiPort
  115. * - uiHost
  116. * - apiMaxLength
  117. * - httpServerOptions
  118. * - httpAdminRoot
  119. * - httpAdminMiddleware
  120. * - httpNodeRoot
  121. * - httpNodeCors
  122. * - httpNodeMiddleware
  123. * - httpStatic
  124. ******************************************************************************/
  125. /** the tcp port that the Node-RED web server is listening on */
  126. uiPort: process.env.PORT || 1880,
  127. /** By default, the Node-RED UI accepts connections on all IPv4 interfaces.
  128. * To listen on all IPv6 addresses, set uiHost to "::",
  129. * The following property can be used to listen on a specific interface. For
  130. * example, the following would only allow connections from the local machine.
  131. */
  132. //uiHost: "127.0.0.1",
  133. /** The maximum size of HTTP request that will be accepted by the runtime api.
  134. * Default: 5mb
  135. */
  136. //apiMaxLength: '5mb',
  137. /** The following property can be used to pass custom options to the Express.js
  138. * server used by Node-RED. For a full list of available options, refer
  139. * to http://expressjs.com/en/api.html#app.settings.table
  140. */
  141. //httpServerOptions: { },
  142. /** By default, the Node-RED UI is available at http://localhost:1880/
  143. * The following property can be used to specify a different root path.
  144. * If set to false, this is disabled.
  145. */
  146. //httpAdminRoot: '/admin',
  147. /** The following property can be used to add a custom middleware function
  148. * in front of all admin http routes. For example, to set custom http
  149. * headers. It can be a single function or an array of middleware functions.
  150. */
  151. // httpAdminMiddleware: function(req,res,next) {
  152. // // Set the X-Frame-Options header to limit where the editor
  153. // // can be embedded
  154. // //res.set('X-Frame-Options', 'sameorigin');
  155. // next();
  156. // },
  157. /** Some nodes, such as HTTP In, can be used to listen for incoming http requests.
  158. * By default, these are served relative to '/'. The following property
  159. * can be used to specifiy a different root path. If set to false, this is
  160. * disabled.
  161. */
  162. //httpNodeRoot: '/red-nodes',
  163. /** The following property can be used to configure cross-origin resource sharing
  164. * in the HTTP nodes.
  165. * See https://github.com/troygoode/node-cors#configuration-options for
  166. * details on its contents. The following is a basic permissive set of options:
  167. */
  168. //httpNodeCors: {
  169. // origin: "*",
  170. // methods: "GET,PUT,POST,DELETE"
  171. //},
  172. /** If you need to set an http proxy please set an environment variable
  173. * called http_proxy (or HTTP_PROXY) outside of Node-RED in the operating system.
  174. * For example - http_proxy=http://myproxy.com:8080
  175. * (Setting it here will have no effect)
  176. * You may also specify no_proxy (or NO_PROXY) to supply a comma separated
  177. * list of domains to not proxy, eg - no_proxy=.acme.co,.acme.co.uk
  178. */
  179. /** The following property can be used to add a custom middleware function
  180. * in front of all http in nodes. This allows custom authentication to be
  181. * applied to all http in nodes, or any other sort of common request processing.
  182. * It can be a single function or an array of middleware functions.
  183. */
  184. //httpNodeMiddleware: function(req,res,next) {
  185. // // Handle/reject the request, or pass it on to the http in node by calling next();
  186. // // Optionally skip our rawBodyParser by setting this to true;
  187. // //req.skipRawBodyParser = true;
  188. // next();
  189. //},
  190. /** When httpAdminRoot is used to move the UI to a different root path, the
  191. * following property can be used to identify a directory of static content
  192. * that should be served at http://localhost:1880/.
  193. */
  194. //httpStatic: '/home/nol/node-red-static/',
  195. /*******************************************************************************
  196. * Runtime Settings
  197. * - lang
  198. * - logging
  199. * - contextStorage
  200. * - exportGlobalContextKeys
  201. * - externalModules
  202. ******************************************************************************/
  203. /** Uncomment the following to run node-red in your preferred language.
  204. * Available languages include: en-US (default), ja, de, zh-CN, zh-TW, ru, ko
  205. * Some languages are more complete than others.
  206. */
  207. // lang: "de",
  208. /** Configure the logging output */
  209. logging: {
  210. /** Only console logging is currently supported */
  211. console: {
  212. /** Level of logging to be recorded. Options are:
  213. * fatal - only those errors which make the application unusable should be recorded
  214. * error - record errors which are deemed fatal for a particular request + fatal errors
  215. * warn - record problems which are non fatal + errors + fatal errors
  216. * info - record information about the general running of the application + warn + error + fatal errors
  217. * debug - record information which is more verbose than info + info + warn + error + fatal errors
  218. * trace - record very detailed logging + debug + info + warn + error + fatal errors
  219. * off - turn off all logging (doesn't affect metrics or audit)
  220. */
  221. level: "info",
  222. /** Whether or not to include metric events in the log output */
  223. metrics: false,
  224. /** Whether or not to include audit events in the log output */
  225. audit: false
  226. }
  227. },
  228. /** Context Storage
  229. * The following property can be used to enable context storage. The configuration
  230. * provided here will enable file-based context that flushes to disk every 30 seconds.
  231. * Refer to the documentation for further options: https://nodered.org/docs/api/context/
  232. */
  233. //contextStorage: {
  234. // default: {
  235. // module:"localfilesystem"
  236. // },
  237. //},
  238. /** `global.keys()` returns a list of all properties set in global context.
  239. * This allows them to be displayed in the Context Sidebar within the editor.
  240. * In some circumstances it is not desirable to expose them to the editor. The
  241. * following property can be used to hide any property set in `functionGlobalContext`
  242. * from being list by `global.keys()`.
  243. * By default, the property is set to false to avoid accidental exposure of
  244. * their values. Setting this to true will cause the keys to be listed.
  245. */
  246. exportGlobalContextKeys: false,
  247. /** Configure how the runtime will handle external npm modules.
  248. * This covers:
  249. * - whether the editor will allow new node modules to be installed
  250. * - whether nodes, such as the Function node are allowed to have their
  251. * own dynamically configured dependencies.
  252. * The allow/denyList options can be used to limit what modules the runtime
  253. * will install/load. It can use '*' as a wildcard that matches anything.
  254. */
  255. externalModules: {
  256. // autoInstall: false, /** Whether the runtime will attempt to automatically install missing modules */
  257. // autoInstallRetry: 30, /** Interval, in seconds, between reinstall attempts */
  258. // palette: { /** Configuration for the Palette Manager */
  259. // allowInstall: true, /** Enable the Palette Manager in the editor */
  260. // allowUpdate: true, /** Allow modules to be updated in the Palette Manager */
  261. // allowUpload: true, /** Allow module tgz files to be uploaded and installed */
  262. // allowList: ['*'],
  263. // denyList: [],
  264. // allowUpdateList: ['*'],
  265. // denyUpdateList: []
  266. // },
  267. // modules: { /** Configuration for node-specified modules */
  268. // allowInstall: true,
  269. // allowList: [],
  270. // denyList: []
  271. // }
  272. },
  273. /*******************************************************************************
  274. * Editor Settings
  275. * - disableEditor
  276. * - editorTheme
  277. ******************************************************************************/
  278. /** The following property can be used to disable the editor. The admin API
  279. * is not affected by this option. To disable both the editor and the admin
  280. * API, use either the httpRoot or httpAdminRoot properties
  281. */
  282. //disableEditor: false,
  283. /** Customising the editor
  284. * See https://nodered.org/docs/user-guide/runtime/configuration#editor-themes
  285. * for all available options.
  286. */
  287. editorTheme: {
  288. menu: { "menu-item-help": {
  289. label: "Node-RED Pi Website",
  290. url: "http://nodered.org/docs/hardware/raspberrypi.html"
  291. } },
  292. /** The following property can be used to set a custom theme for the editor.
  293. * See https://github.com/node-red-contrib-themes/theme-collection for
  294. * a collection of themes to chose from.
  295. */
  296. //theme: "",
  297. palette: {
  298. /** The following property can be used to order the categories in the editor
  299. * palette. If a node's category is not in the list, the category will get
  300. * added to the end of the palette.
  301. * If not set, the following default order is used:
  302. */
  303. //categories: ['subflows', 'common', 'function', 'network', 'sequence', 'parser', 'storage'],
  304. },
  305. projects: {
  306. /** To enable the Projects feature, set this value to true */
  307. enabled: false,
  308. workflow: {
  309. /** Set the default projects workflow mode.
  310. * - manual - you must manually commit changes
  311. * - auto - changes are automatically committed
  312. * This can be overridden per-user from the 'Git config'
  313. * section of 'User Settings' within the editor
  314. */
  315. mode: "manual"
  316. }
  317. },
  318. codeEditor: {
  319. /** Select the text editor component used by the editor.
  320. * Defaults to "ace", but can be set to "ace" or "monaco"
  321. */
  322. lib: "ace",
  323. options: {
  324. /** The follow options only apply if the editor is set to "monaco"
  325. *
  326. * theme - must match the file name of a theme in
  327. * packages/node_modules/@node-red/editor-client/src/vendor/monaco/dist/theme
  328. * e.g. "tomorrow-night", "upstream-sunburst", "github", "my-theme"
  329. */
  330. theme: "vs",
  331. /** other overrides can be set e.g. fontSize, fontFamily, fontLigatures etc.
  332. * for the full list, see https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.istandaloneeditorconstructionoptions.html
  333. */
  334. //fontSize: 14,
  335. //fontFamily: "Cascadia Code, Fira Code, Consolas, 'Courier New', monospace",
  336. //fontLigatures: true,
  337. }
  338. }
  339. },
  340. /*******************************************************************************
  341. * Node Settings
  342. * - fileWorkingDirectory
  343. * - functionGlobalContext
  344. * - functionExternalModules
  345. * - nodeMessageBufferMaxLength
  346. * - ui (for use with Node-RED Dashboard)
  347. * - debugUseColors
  348. * - debugMaxLength
  349. * - execMaxBufferSize
  350. * - httpRequestTimeout
  351. * - mqttReconnectTime
  352. * - serialReconnectTime
  353. * - socketReconnectTime
  354. * - socketTimeout
  355. * - tcpMsgQueueSize
  356. * - inboundWebSocketTimeout
  357. * - tlsConfigDisableLocalFiles
  358. * - webSocketNodeVerifyClient
  359. ******************************************************************************/
  360. /** The working directory to handle relative file paths from within the File nodes
  361. * defaults to the working directory of the Node-RED process.
  362. */
  363. //fileWorkingDirectory: "",
  364. /** Allow the Function node to load additional npm modules directly */
  365. functionExternalModules: true,
  366. /** The following property can be used to set predefined values in Global Context.
  367. * This allows extra node modules to be made available with in Function node.
  368. * For example, the following:
  369. * functionGlobalContext: { os:require('os') }
  370. * will allow the `os` module to be accessed in a Function node using:
  371. * global.get("os")
  372. */
  373. functionGlobalContext: {
  374. // os:require('os'),
  375. },
  376. /** The maximum number of messages nodes will buffer internally as part of their
  377. * operation. This applies across a range of nodes that operate on message sequences.
  378. * defaults to no limit. A value of 0 also means no limit is applied.
  379. */
  380. //nodeMessageBufferMaxLength: 0,
  381. /** If you installed the optional node-red-dashboard you can set it's path
  382. * relative to httpNodeRoot
  383. * Other optional properties include
  384. * readOnly:{boolean},
  385. * middleware:{function or array}, (req,res,next) - http middleware
  386. * ioMiddleware:{function or array}, (socket,next) - socket.io middleware
  387. */
  388. //ui: { path: "ui" },
  389. /** Colourise the console output of the debug node */
  390. //debugUseColors: true,
  391. /** The maximum length, in characters, of any message sent to the debug sidebar tab */
  392. debugMaxLength: 1000,
  393. /** Maximum buffer size for the exec node. Defaults to 10Mb */
  394. //execMaxBufferSize: 10000000,
  395. /** Timeout in milliseconds for HTTP request connections. Defaults to 120s */
  396. //httpRequestTimeout: 120000,
  397. /** Retry time in milliseconds for MQTT connections */
  398. mqttReconnectTime: 15000,
  399. /** Retry time in milliseconds for Serial port connections */
  400. serialReconnectTime: 15000,
  401. /** Retry time in milliseconds for TCP socket connections */
  402. //socketReconnectTime: 10000,
  403. /** Timeout in milliseconds for TCP server socket connections. Defaults to no timeout */
  404. //socketTimeout: 120000,
  405. /** Maximum number of messages to wait in queue while attempting to connect to TCP socket
  406. * defaults to 1000
  407. */
  408. //tcpMsgQueueSize: 2000,
  409. /** Timeout in milliseconds for inbound WebSocket connections that do not
  410. * match any configured node. Defaults to 5000
  411. */
  412. //inboundWebSocketTimeout: 5000,
  413. /** To disable the option for using local files for storing keys and
  414. * certificates in the TLS configuration node, set this to true.
  415. */
  416. //tlsConfigDisableLocalFiles: true,
  417. /** The following property can be used to verify websocket connection attempts.
  418. * This allows, for example, the HTTP request headers to be checked to ensure
  419. * they include valid authentication information.
  420. */
  421. //webSocketNodeVerifyClient: function(info) {
  422. // /** 'info' has three properties:
  423. // * - origin : the value in the Origin header
  424. // * - req : the HTTP request
  425. // * - secure : true if req.connection.authorized or req.connection.encrypted is set
  426. // *
  427. // * The function should return true if the connection should be accepted, false otherwise.
  428. // *
  429. // * Alternatively, if this function is defined to accept a second argument, callback,
  430. // * it can be used to verify the client asynchronously.
  431. // * The callback takes three arguments:
  432. // * - result : boolean, whether to accept the connection or not
  433. // * - code : if result is false, the HTTP error status to return
  434. // * - reason: if result is false, the HTTP reason string to return
  435. // */
  436. //},
  437. }