Skip to content

Instantly share code, notes, and snippets.

@Antosik
Last active October 3, 2021 21:21
Show Gist options
  • Save Antosik/db6fe2eeb60f815e3a55939741a1998c to your computer and use it in GitHub Desktop.
Save Antosik/db6fe2eeb60f815e3a55939741a1998c to your computer and use it in GitHub Desktop.
{
"title": "JSON schema for NodeBB configuration file",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Is the full web-accessible address that points to your NodeBB. If you don't have a domain, an IP address will work fine (e.g. http://127.0.0.1:4567 ). Subfolder installations also define their folder here as well (e.g. http://127.0.0.1:4567/forum )"
},
"secret": {
"type": "string",
"description": "Is a text string used to hash cookie sessions. If the secret is changed, all existing sessons will no longer validate and users will need to log in again."
},
"database": {
"enum": ["redis", "mongo", "postgres"],
"description": "Defines the primary database used by NodeBB."
},
"session_store": {
"type": "object",
"description": "Defines a database to use for sessions. For example by setting this to a different redis instance you can separate your data and sessions into two different redis instances.",
"properties": {
"name": {
"enum": ["redis", "mongo", "postgres"],
}
}
},
"redis": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "number"
},
"password": {
"type": "string"
},
"database": {
"type": "string"
}
}
},
"mongo": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "number"
},
"username": {
"type": "string"
},
"password": {
"type": "string"
},
"database": {
"type": "string"
},
"uri": {
"type": "string"
}
}
},
"postgres": {
"type": "object",
"properties": {
"host": {
"type": "string"
},
"port": {
"type": "number"
},
"password": {
"type": "string"
},
"database": {
"type": "string"
}
}
},
"port": {
"type": ["number", "array"],
"items": {
"type": "number"
},
"description": "Specifies the port number that NodeBB will bind to. You can specify an array of ports and NodeBB will spawn port.length processes. If you use multiple ports you need to configure a load balancer to proxy requests to the different ports.",
"default": 4567
},
"bcrypt_rounds": {
"type": "number",
"description": "Specifies the number of rounds to hash a password. Slower machines may elect to reduce the number of rounds to speed up the login process, but you'd more likely want to increase the number of rounds at some point if computer processing power gets so fast that the default # of rounds isn't high enough of a barrier to password cracking.",
"default": 12
},
"upload_path": {
"type": "string",
"description": "Specifies the path, relative to the NodeBB root install, that uploaded files will be saved in.",
"default": "/public/uploads"
},
"jobsDisabled": {
"type": "boolean",
"description": "This can be added to disable jobs that are run on a certain interval."
},
"socket.io": {
"type": "object",
"description": "A hash with socket.io settings",
"properties": {
"transports": {
"type": "array",
"description": "Can be used to configure socket.io transports.",
"items": {
"enum": ["polling", "websocket"]
},
"default": ["polling", "websocket"]
},
"address": {
"type": "string",
"description": "Address of socket.io server can be empty",
"default": ""
},
"origins": {
"type": "string",
"description": "Defined a different url for socket.io connections, in the format domain.tld:port (e.g. example.org:*). If you need to enter enable origins, separate them using commas (e.g. https://example.org:*,https://example.net:*)",
}
}
},
"bind_address": {
"type": "string",
"description": "Specifies the local address that NodeBB should bind to. By default, NodeBB will listen to requests on all interfaces, but when set, NodeBB will only accept connections from that interface.",
"default": "0.0.0.0"
},
"sessionKey": {
"type": "string",
"description": "Specifies the session key to use.",
"default": "express.sid"
},
"isCluster": {
"type": "boolean",
"description": "Set this to true if you have multiple machines each running a single NodeBB process. This setting is not required if you have multiple NodeBB processes running either on a single or multiple machines.",
"default": false
},
"singleHostCluster": {
"type": "boolean"
},
"isPrimary": {
"type": "boolean"
},
"logFile": {
"type": "string",
"description": "Specifies the path, relative to the NodeBB root install, that the log file will be stored. If this doesn't exist it will be created. Log files will be rotated to the same directory when the current log file gets above 1 Megabyte, to a maximum of 3 archived.",
"default": "logs/output.log"
},
"ssl": {
"type": "object",
"properties": {
"key": {
"type": "string",
"description": "Path to the the private key"
},
"cert": {
"type": "string",
"description": "Path to the the certificate"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment