Advertisement
Guest User

settings.js

a guest
May 18th, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Copyright 2013, 2016 IBM Corp.
  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. // The `https` setting requires the `fs` module. Uncomment the following
  18. // to make it available:
  19. //var fs = require("fs");
  20.  
  21. module.exports = {
  22.     // the tcp port that the Node-RED web server is listening on
  23.     uiPort: process.env.PORT || 1880,
  24.  
  25.     // By default, the Node-RED UI accepts connections on all IPv4 interfaces.
  26.     // The following property can be used to listen on a specific interface. For
  27.     // example, the following would only allow connections from the local machine.
  28.     //uiHost: "127.0.0.1",
  29.  
  30.     // Retry time in milliseconds for MQTT connections
  31.     mqttReconnectTime: 15000,
  32.  
  33.     // Retry time in milliseconds for Serial port connections
  34.     serialReconnectTime: 15000,
  35.  
  36.     // Retry time in milliseconds for TCP socket connections
  37.     //socketReconnectTime: 10000,
  38.  
  39.     // Timeout in milliseconds for TCP server socket connections
  40.     //  defaults to no timeout
  41.     //socketTimeout: 120000,
  42.  
  43.     // Timeout in milliseconds for HTTP request connections
  44.     //  defaults to 120 seconds
  45.     //httpRequestTimeout: 120000,
  46.  
  47.     // The maximum length, in characters, of any message sent to the debug sidebar tab
  48.     debugMaxLength: 1000,
  49.  
  50.     // The file containing the flows. If not set, it defaults to flows_<hostname>.json
  51.     //flowFile: 'flows.json',
  52.  
  53.     // To enabled pretty-printing of the flow within the flow file, set the following
  54.     //  property to true:
  55.     //flowFilePretty: true,
  56.  
  57.     // By default, credentials are encrypted in storage using a generated key. To
  58.     // specify your own secret, set the following property.
  59.     // If you want to disable encryption of credentials, set this property to false.
  60.     // Note: once you set this property, do not change it - doing so will prevent
  61.     // node-red from being able to decrypt your existing credentials and they will be
  62.     // lost.
  63.     //credentialSecret: "a-secret-key",
  64.  
  65.     // By default, all user data is stored in the Node-RED install directory. To
  66.     // use a different location, the following property can be used
  67.     //userDir: '/home/nol/.node-red/',
  68.  
  69.     // Node-RED scans the `nodes` directory in the install directory to find nodes.
  70.     // The following property can be used to specify an additional directory to scan.
  71.     //nodesDir: '/home/nol/.node-red/nodes',
  72.  
  73.     // By default, the Node-RED UI is available at http://localhost:1880/
  74.     // The following property can be used to specifiy a different root path.
  75.     // If set to false, this is disabled.
  76.     //httpAdminRoot: '/admin',
  77.  
  78.     // Some nodes, such as HTTP In, can be used to listen for incoming http requests.
  79.     // By default, these are served relative to '/'. The following property
  80.     // can be used to specifiy a different root path. If set to false, this is
  81.     // disabled.
  82.     //httpNodeRoot: '/red-nodes',
  83.  
  84.     // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
  85.     // to apply the same root to both parts.
  86.     //httpRoot: '/red',
  87.  
  88.     // When httpAdminRoot is used to move the UI to a different root path, the
  89.     // following property can be used to identify a directory of static content
  90.     // that should be served at http://localhost:1880/.
  91.     //httpStatic: '/home/nol/node-red-static/',
  92.  
  93.     // The maximum size of HTTP request that will be accepted by the runtime api.
  94.     // Default: 5mb
  95.     //apiMaxLength: '5mb',
  96.  
  97.     // If you installed the optional node-red-dashboard you can set it's path
  98.     // relative to httpRoot
  99.     //ui: { path: "ui" },
  100.  
  101.     // Securing Node-RED
  102.     // -----------------
  103.     // To password protect the Node-RED editor and admin API, the following
  104.     // property can be used. See http://nodered.org/docs/security.html for details.
  105.     //adminAuth: {
  106.     //    type: "credentials",
  107.     //    users: [{
  108.     //        username: “claudio”,
  109.     //        password: “hashmypass”,
  110.     //        permissions: "*"
  111.     //    }]
  112.     //},
  113.  
  114.     adminAuth: {
  115.         type: "credentials",
  116.         users: [{
  117.             username: "claudio",
  118.             password: "$2a$08$9qqwpsufp.urHgnIFaZZoe4LehOM7D79LYkng/4ENzwzUcmUmlNoS",
  119.             permissions: "*"
  120.         }]
  121.     },
  122.  
  123.     // To password protect the node-defined HTTP endpoints (httpNodeRoot), or
  124.     // the static content (httpStatic), the following properties can be used.
  125.     // The pass field is a bcrypt hash of the password.
  126.     // See http://nodered.org/docs/security.html#generating-the-password-hash
  127.     //httpNodeAuth: {user:"myUser",pass:"myhashpass"},
  128.     //httpStaticAuth: {user:"myUser",pass:”myhashpass”},
  129.  
  130.     // The following property can be used to enable HTTPS
  131.     // See http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
  132.     // for details on its contents.
  133.     // See the comment at the top of this file on how to load the `fs` module used by
  134.     // this setting.
  135.     //
  136.     //https: {
  137.     //    key: fs.readFileSync('privatekey.pem'),
  138.     //    cert: fs.readFileSync('certificate.pem')
  139.     //},
  140.  
  141.     // The following property can be used to cause insecure HTTP connections to
  142.     // be redirected to HTTPS.
  143.     //requireHttps: true
  144.  
  145.     // The following property can be used to disable the editor. The admin API
  146.     // is not affected by this option. To disable both the editor and the admin
  147.     // API, use either the httpRoot or httpAdminRoot properties
  148.     //disableEditor: false,
  149.  
  150.     // The following property can be used to configure cross-origin resource sharing
  151.     // in the HTTP nodes.
  152.     // See https://github.com/troygoode/node-cors#configuration-options for
  153.     // details on its contents. The following is a basic permissive set of options:
  154.     //httpNodeCors: {
  155.     //    origin: "*",
  156.     //    methods: "GET,PUT,POST,DELETE"
  157.     //},
  158.  
  159.     // If you need to set an http proxy please set an environment variable
  160.     // called http_proxy (or HTTP_PROXY) outside of Node-RED in the operating system.
  161.     // For example - http_proxy=http://myproxy.com:8080
  162.     // (Setting it here will have no effect)
  163.     // You may also specify no_proxy (or NO_PROXY) to supply a comma separated
  164.     // list of domains to not proxy, eg - no_proxy=.acme.co,.acme.co.uk
  165.  
  166.     // The following property can be used to add a custom middleware function
  167.     // in front of all http in nodes. This allows custom authentication to be
  168.     // applied to all http in nodes, or any other sort of common request processing.
  169.     //httpNodeMiddleware: function(req,res,next) {
  170.     //    // Handle/reject the request, or pass it on to the http in node by calling next();
  171.     //    // Optionally skip our rawBodyParser by setting this to true;
  172.     //    //req.skipRawBodyParser = true;
  173.     //    next();
  174.     //},
  175.  
  176.     // Anything in this hash is globally available to all functions.
  177.     // It is accessed as context.global.
  178.     // eg:
  179.     //    functionGlobalContext: { os:require('os') }
  180.     // can be accessed in a function block as:
  181.     //    context.global.os
  182.  
  183.     functionGlobalContext: {
  184.         // os:require('os'),
  185.         // octalbonescript:require('octalbonescript'),
  186.         // jfive:require("johnny-five"),
  187.         // j5board:require("johnny-five").Board({repl:false})
  188.     },
  189.  
  190.     // The following property can be used to order the categories in the editor
  191.     // palette. If a node's category is not in the list, the category will get
  192.     // added to the end of the palette.
  193.     // If not set, the following default order is used:
  194.     //paletteCategories: ['subflows', 'input', 'output', 'function', 'social', 'mobile', 'storage', 'analysis', 'advanced'],
  195.  
  196.     // Configure the logging output
  197.     logging: {
  198.         // Only console logging is currently supported
  199.         console: {
  200.             // Level of logging to be recorded. Options are:
  201.             // fatal - only those errors which make the application unusable should be recorded
  202.             // error - record errors which are deemed fatal for a particular request + fatal errors
  203.             // warn - record problems which are non fatal + errors + fatal errors
  204.             // info - record information about the general running of the application + warn + error + fatal errors
  205.             // debug - record information which is more verbose than info + info + warn + error + fatal errors
  206.             // trace - record very detailed logging + debug + info + warn + error + fatal errors
  207.             level: "info",
  208.             // Whether or not to include metric events in the log output
  209.             metrics: false,
  210.             // Whether or not to include audit events in the log output
  211.             audit: false
  212.         }
  213.     }
  214. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement