NodeCG Configuration
NodeCG is configured via a cfg/nodecg.js, cfg/nodecg.yaml, or cfg/nodecg.json file with the following schema:
Schema
hostString The IP address or hostname that NodeCG should bind to. [DEFAULT:"0.0.0.0"]portInteger The port that NodeCG should listen on. [DEFAULT:9090]baseURLString The URL of this instance. Used for things like cookies. If you use a reverse proxy, you'll likely need to set this value. [DEFAULT:HOST:PORT]exitOnUncaughtBoolean Whether or not to exit on uncaught exceptions. [DEFAULT:true]loggingObject Contains other configuration properties.consoleObject Contains properties for console logging.enabledBoolean Whether to enable console logging. [DEFAULT:true]levelString Lowest importance of messages which should be logged. Must be"verbose","debug","info","warn"or"error"[DEFAULT:"info"]timestampsBoolean Whether to add timestamps to the console logging. [DEFAULT:true]replicantsBoolean Whether to enable logging of the Replicants subsystem. Very spammy. [DEFAULT:false]
replicantsBoolean Whether to enable logging of the Replicants subsystem. Very spammy. [DEFAULT:false]timestampsBoolean Whether to add timestamps to the console logging. [DEFAULT:true]levelString Lowest importance of messages which should be logged. Must be"verbose","debug","info","warn"or"error"[DEFAULT:"info"]
fileObject Contains properties for file logging.enabledBoolean Whether to enable file logging. [DEFAULT:false]replicantsBoolean Whether to enable logging of the Replicants subsystem. Very spammy. [DEFAULT:false]timestampsBoolean Whether to add timestamps to the file logging. [DEFAULT:true]levelString Lowest importance of messages which should be logged. Must be"verbose","debug","info","warn"or"error"[DEFAULT:"info"]pathString The filepath to log to. [DEFAULT:"logs/nodecg.log"]
bundlesObject Contains configuration for bundles.enabledArray of strings A whitelist array of bundle names that will be the only ones loaded at startup. Cannot be used withbundles.disabled. [DEFAULT:null-> this bundle whitelist feature is disabled -> load all bundles]disabledArray of strings A blacklist array of bundle names that will not be loaded at startup. Cannot be used withbundles.enabled. [DEFAULT:null-> no bundle blacklisted from loading / all bundles are loaded]pathsArray of strings An array of additional ABSOLUTE paths where bundles are located. [DEFAULT:[](empty array)]
loginObject Contains other configuration properties.enabledBoolean Whether to enable login security. [DEFAULT:false]sessionSecretString The secret used to salt sessions. This option is required whenlogin.enabled = true! [NO DEFAULT!]forceHttpsReturnBoolean Forces Steam & Twitch login return URLs to use HTTPS instead of HTTP. Useful in reverse proxy setups. [DEFAULT:false]localObject Contains local username & password login configuration properties.enabledBoolean Whether to enable Local authentication. [DEFAULT:false]allowedUsersArray of objects Which usernames and passwords to allow. Example:{"username": "admin", "password": "foo123"}. This option is required whenlogin.local.enabled = true! [NO DEFAULT!]
steamObject Contains steam login configuration properties.enabledBoolean Whether to enable Steam authentication. [DEFAULT:false]apiKeyString A Steam API Key. Obtained from http://steamcommunity.com/dev/apikey. This option is required whenlogin.steam.enabled = true! [NO DEFAULT!]allowedIdsArray of strings Which 64 bit Steam IDs to allow. Can be obtained from https://steamid.io/. This option is required whenlogin.steam.enabled = true! [NO DEFAULT!]
twitchObject Contains twitch login configuration properties.enabledBoolean Whether to enable Twitch authentication. [DEFAULT:false]clientIDString A Twitch application ClientID http://twitch.tv/kraken/oauth2/clients/new. This option is required whenlogin.twitch.enabled = true! [NO DEFAULT!]clientSecretString A Twitch application ClientSecret http://twitch.tv/kraken/oauth2/clients/new. This option is required whenlogin.twitch.enabled = true! [NO DEFAULT!]- Note: Configure your Twitch OAuth credentials with a Redirect URI to
{baseURL}/login/auth/twitch scopeString A space-separated string of Twitch application permissions. [DEFAULT:"user_read"]allowedUsernamesArray of strings Which Twitch usernames to allow. Either this option orallowedIdsis required whenlogin.twitch.enabled = true! [NO DEFAULT!]allowedIdsArray of strings Which Twitch IDs to allow. Can be obtained from https://twitchinsights.net/checkuser. Either this option orallowedUsernamesis required whenlogin.twitch.enabled = true! [NO DEFAULT!]
discordObject Contains discord login configuration properties.enabledBoolean Whether to enable Discord authentication. [DEFAULT:false]clientIDString A Discord application ClientID https://discord.com/developers/applications/. This option is required whenlogin.discord.enabled = true! [NO DEFAULT!]clientSecretString A Discord application ClientSecret https://discord.com/developers/applications/- Note: Configure your Discord OAuth credentials with a Redirect URI to
{baseURL}/login/auth/discord. This option is required whenlogin.discord.enabled = true! [NO DEFAULT!] scopeString A space-separated string of Discord application permissions. [DEFAULT:"identify"]allowedUserIDsArray of strings Which Discord IDs to allow. Either this option orallowedGuildsis required whenlogin.discord.enabled = true! [NO DEFAULT!]allowedGuildsArray of objects Which servers to allow users from. Either this option orallowedUserIDsis required whenlogin.discord.enabled = true! [NO DEFAULT!]- Format for
allowedGuildsobjectsguildIDString Users in this Discord Server are allowed to log inallowedRoleIDsArray of strings Additionally require one of the roles on the server to log inguildBotTokenString Discord bot token, needed if allowedRoleIDs is used https://discord.com/developers/applications/
sslObject Contains HTTPS/SSL configuration properties.enabledBoolean Whether to enable SSL/HTTPS encryption. [DEFAULT:false]allowHTTPBoolean Whether to allow insecure HTTP connections while SSL is active. [DEFAULT:false]keyPathString The path to an SSL key file. This option is required whenssl.enabled = true! [NO DEFAULT!]certificatePathString The path to an SSL certificate file. This option is required whenssl.enabled = true! [NO DEFAULT!]passphraseString The passphrase for the provided key file. [OPTIONAL]
sentryObject Contains Sentry configuration properties.enabledBoolean Whether to enable Sentry error reporting. [DEFAULT:false]dsnString Your Sentry API key for error reporting. This option is required whensentry.enabled = true! [NO DEFAULT!]
Example Config
cfg/nodecg.js
module.exports = {
host: '0.0.0.0',
port: 9090,
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',
},
};