Skip to main content

NodeCG Configuration

NodeCG is configured via a cfg/nodecg.js, cfg/nodecg.yaml, or 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.
    • console Object Contains properties for console logging.
      • enabled Boolean Whether to enable console logging.
      • replicants Boolean Whether to enable logging of the Replicants subsystem. Very spammy.
      • timestamps Boolean Whether to add timestamps to the 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.
      • replicants Boolean Whether to enable logging of the Replicants subsystem. Very spammy.
      • timestamps Boolean Whether to add timestamps to the 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.
    • paths Array of strings An array of additional paths where bundles are located.
  • 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.
    • local Object Contains local username & password login configuration properties.
      • enabled Boolean Whether to enable Local authentication.
      • allowedUsers Array of objects Which usernames and passwords to allow. Example: {"username": "admin", "password": "foo123"}
    • steam Object Contains steam login configuration properties.
    • twitch Object Contains twitch login configuration properties.
    • discord Object Contains discord login configuration properties.
      • enabled Boolean Whether to enable Discord authentication.
      • clientID String A Discord application ClientID https://discord.com/developers/applications/
      • clientSecret String A Discord application ClientSecret https://discord.com/developers/applications/
      • Note: Configure your Discord OAuth credentials with a Redirect URI to {baseURL}/login/auth/discord
      • scope String A space-separated string of Discord application permissions.
      • allowedUserIDs Array of strings Which Discord IDs to allow
      • allowedGuilds Array of objects Which servers to allow users from
      • Format for allowedGuilds objects
        • guildID String Users in this Discord Server are allowed to log in
        • allowedRoleIDs Array of strings Additionally require one of the roles on the server to log in
        • guildBotToken String Discord bot token, needed if allowedRoleIDs is used https://discord.com/developers/applications/
  • 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.
    • passphrase String The passphrase for the provided key 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 {#example}

// cfg/nodecg.js
module.exports = {
host: '0.0.0.0',
port: 9090,
developer: false,
bundles: {
enabled: ['bundle-name'],
paths: ['C:\\nodecg\\experimental-bundles'],
},
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'],
allowedIds: ['11111111111111111', '22222222222222222'],
},
discord: {
enabled: true,
clientID: 'your_discord_app_client_id',
clientSecret: 'your_discord_app_client_secret',
scope: 'identify guilds',
allowedUserIDs: ['159600065017675778', '54561421005950976'],
allowedGuilds: [
{
guildID: '754749209722486814',
allowedRoleIDs: ['754751725457637546', '755012946400378910'],
guildBotToken: 'your_bot_token',
},
{
guildID: '754749209722486814',
},
],
},
logging: {
console: {
enabled: true,
timestamps: false,
level: 'verbose',
replicants: false,
},
file: {
enabled: true,
timestamps: true,
path: 'logs/server.log',
level: 'info',
replicants: false,
},
},
ssl: {
enabled: false,
keyPath: '',
certificatePath: '',
},
sentry: {
enabled: true,
dsn: 'https://xxx:yyy@sentry.io/zzz',
},
},
};