NodeCG Configuration

NodeCG is configured via a cfg/nodecg.json file with the following schema:

Schema

  • host String The IP address or hostname that NodeCG should bind to.
  • port Integer The port that NodeCG should listen on.
  • baseURL String The URL of this instance. Used for things like cookies. Defaults to HOST:PORT. If you use a reverse proxy, you\'ll likely need to set this value.
  • developer Boolean Whether to enable features that speed up development. Not suitable for production.
  • exitOnUncaught Boolean Whether or not to exit on uncaught exceptions.
  • logging Object Contains other configuration properties.
    • replicants Boolean Whether to enable logging of the Replicants subsystem. Very spammy.
    • console Object Contains properties for console logging.
      • enabled Boolean Whether to enable console logging.
      • level String Lowest importance of messages which should be logged. Must be "trace", "debug", "info", "warn" or "error"
    • file Object Contains properties for file logging.
      • enabled Boolean Whether to enable file logging.
      • path String The filepath to log to.
      • level String Lowest importance of messages which should be logged. Must be "trace", "debug", "info", "warn" or "error"
  • bundles Object Contains configuration for bundles.
    • enabled Array of strings A whitelist array of bundle names that will be the only ones loaded at startup. Cannot be used with bundles.disabled.
    • disabled Array of strings A blacklist array of bundle names that will not be loaded at startup. Cannot be used with bundles.enabled.
  • login Object Contains other configuration properties.
    • enabled Boolean Whether to enable login security.
    • sessionSecret String The secret used to salt sessions.
    • forceHttpsReturn Boolean orces Steam & Twitch login return URLs to use HTTPS instead of HTTP. Useful in reverse proxy setups.
    • steam Object Contains steam login configuration properties.
    • twitch Object Contains twitch login configuration properties.
      • enabled Boolean Whether to enable Twitch authentication.
      • clientID String A Twitch application ClientID http://twitch.tv/kraken/oauth2/clients/new
      • clientSecret String A Twitch application ClientSecret http://twitch.tv/kraken/oauth2/clients/new
      • Note: Configure your Twitch OAuth credentials with a Redirect URI to {baseURL}/login/auth/twitch
      • scope String A space-separated string of Twitch application permissions.
      • allowedUsernames Array of strings Which Twitch usernames to allow.
  • ssl Object Contains HTTPS/SSL configuration properties.
    • enabled Boolean Whether to enable SSL/HTTPS encryption.
    • allowHTTP Boolean Whether to allow insecure HTTP connections while SSL is active.
    • keyPath String The path to an SSL key file.
    • certificatePath String The path to an SSL certificate file.
  • sentry Object Contains Sentry configuration properties.
    • enabled Boolean Whether to enable Sentry error reporting.
    • dsn String Your private DSN, for server-side error reporting.
    • publicDsn String Your public sentry DSN, for browser error reporting.

Example Config

{
    "host": "0.0.0.0",
    "port": 9090,
    "developer": false,
    "bundles": {
        "enabled": [
            "bundle-name"
        ]
    },
    "login": {
        "enabled": true,
        "sessionSecret": "supersecret",
        "steam": {
            "enabled": true,
            "apiKey": "YYYYY",
            "allowedIds": [
                "11111111111111111",
                "22222222222222222"
            ]
        },
        "twitch": {
            "enabled": true,
            "clientID": "your_app_id",
            "clientSecret": "your_app_key",
            "scope": "user_read",
            "allowedUsernames": [
                "some_username"
            ]
        }
    },
    "logging": {
        "replicants": false,
        "console": {
            "enabled": true,
            "level": "trace"
        },
        "file": {
            "enabled": true,
            "path": "logs/server.log",
            "level": "info"
        }
    },
    "ssl": {
        "enabled": false,
        "keyPath": "",
        "certificatePath": ""
    },
    "sentry": {
        "enabled": true,
        "dsn": "https://xxx:yyy@sentry.io/zzz",
        "publicDsn": "https://xxx@sentry.io/zzz"
    }
}