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