<commit_before>extends ../../templates/layout/base

include ../../templates/mixins/docsnav

block intro
	.page-header
		.container
			h1 Configuration
			p.lead How to roll KeystoneJS the way you want it.

block content
	.container: .row
		
		.col-sm-3
			+docsnav(docssection)
		
		.col-sm-9: .docs-content
			
			h2 Keystone Options
			
			a(name='options-concepts')
			h3 Setting Options
			
			p The options for KeystoneJS cover a range of behaviours, from how the express app is configured to enabling features and authentication options for integrated services.
			
			p There are three ways to set options:
			
			ul.options
				li Passing a <code>{ key: 'value' }</code> configuration <code class="data-type">Object</code> to the <code>keystone.init(options)</code> method
				li Calling <code>keystone.set('key', 'value')</code>
				li Setting environment variables in <code>process.env</code>. Only some options support this (noted below).
			
			p If you want to keep secret keys and configuration out of your codebase (especially important for open source projects, or projects where not all developers should have access to production config settings) the <a href="https://npmjs.org/package/dotenv" target="_blank">dotenv</a> module makes this very easy to manage.
			
			a(name='options-project')
			h3 Project Options
			
			p The following options control the branding, navigation and default export settings of the KeystoneJS application in the Admin UI:
			
			table.table
				col(width=210)
				col
				tr
					td <code>name</code> <code class="data-type">String</code>
					td The name of the KeystoneJS application
				tr
					td <code>brand</code> <code class="data-type">String</code>
					td Displayed in the top left hand corner of the Admin UI
				tr
					td <code>nav</code> <code class="data-type">Object</code>
					td
						p An object that specifies the navigation structure for the Admin UI. Create a key for each section that should be visible in the primary navigation. Each key's value can be a single list path (as is seen in the URL when you view a list) or an array of list paths. When an array is used, secondary navigation is rendered in the Admin UI.
						p The nav is also used to generate the links on the Admin UI home page; any lists that are registered but not included in the <code>nav</code> will be grouped at the bottom of the screen under the 'Other' heading.
				tr
					td <code>csv field delimiter</code> <code class="data-type">String</code>
					td Allow you to choose a custom field delimiter to be used for CSV export instead of the default comma.
			
			.code-header
				h4 Custom Navigation Example
				p If you had <code>User</code>, <code>Post</code> and <code>PostCategory</code> models, you could group the posts and post categories into a <strong>Content</strong> navigation item like this:
			pre: code.language-javascript
				| keystone.set('nav', {
				|     'users': 'users',
				|     'content': ['posts', 'post-categories']
				| });
		
			a(name='options-server')
			h3 Web Server Options
			
			p The following options control the configuration of your web server and the express app:
			
			table.table
				col(width=210)
				col
				tr
					td <code>env</code> <code class="data-type">String</code>
					td
						p The environment setting to use. The keys <strong>development</strong> and <strong>production</strong> are supported, and this will have an impact on things like caching compiled templates. Defaults to <code class="default-value">process.env.NODE_ENV || "development"</code>.
						p You should really <strong>set this to <code class="default-value">production</code> for your production servers</strong> using the <code>NODE_ENV</code> environment variable. Several other modules expect this convention also.
				tr
					td <code>port</code> <code class="data-type">Number</code>
					td
						p The port to listen for request on. Defaults to <code class="default-value">process.env.PORT || 3000</code>
				tr
					td <code>host</code> <code class="data-type">String</code>
					td
						p The ip address to listen for request on. Defaults to <code class="default-value">process.env.IP || '127.0.0.1'</code>
						p <code>port</code> must be set (either by option or env variable) or the <code>host</code> option will be ignored.
				tr
					td <code>views</code> <code class="data-type">String</code>
					td
						p The path to your application's <strong>view templates</strong>. This is required for using the <code>keystone.View</code> Class, and will also be set on the express app.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">"/templates/views"</code>.
				tr
					td <code>view engine</code> <code class="data-type">String</code>
					td
						p The template engine to use by default. Any engine with express support should work. <strong>Jade</strong> is included with Keystone, but you will have to add any alternate engine to your project's dependencies in your <code>package.json</code>.
						p This option is set on the express app (<a href="http://expressjs.com/api.html#app.engine" target="_blank">see docs here</a>).
				tr
					td <code>custom engine</code> <code class="data-type">Function</code>
					td
						p If you want to use a custom template engine, set this option to the function that should be used to process your templates.
						p See below for an example of how to use the <a href="http://paularmstrong.github.io/swig/" target="_blank">Swig</a> template engine.
				tr
					td <code>locals</code> <code class="data-type">Object</code>
					td
						p The default local variables to pass to your view templates.
						p Routes can extend or change local variables by modifying <code>res.locals</code>.
				tr
					td <code>static</code> <code class="data-type">String</code> or <code class="data-type">Array</code>
					td
						p One or more paths to your application's static files. Setting this will include the <code>express.static</code> middleware.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">'public'</code>.
				tr
					td <code>less</code> <code class="data-type">String</code>
					td
						p If you want Keystone to automatically compile <strong>.less</strong> files into <strong>.css</strong> files, set this value to the same path as the <code>static</code> option.
						p When this option is set, any requests to a <strong>.css</strong> or <strong>.min.css</strong> file will first check for a <strong>.less</strong> file with the same name, and if one is found, the css file will be regenerated.
				tr
					td <code>favicon</code> <code class="data-type">String</code>
					td
						p The path to your application's <strong>favicon</strong>. Setting this will include the <code>express.favicon</code> middleware. Should be relative to your project's root.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">"/public/favicon.ico"</code>.
				tr
					td <code>compress</code> <code class="data-type">Boolean</code>
					td Set this to <code class="default-value">true</code> to enable HTTP compression. This will include the <code>express.compress</code> middleware (<a href="http://expressjs.com/api.html#compress" target="_blank">see docs here</a>).
				tr
					td <code>logger</code> <code class="data-type">String</code>
					td Set this to include the <code>express.logger</code> middleware. The value will be passed to the middleware initialisation (<a href="http://www.senchalabs.org/connect/logger.html" target="_blank">see docs here</a>).

				tr
					td <code>trust proxy</code> <code class="data-type">Boolean</code>
					td Set this to enable processing of the HTTP request <code>X-Forwarded-For</code> header. Extracted IP addresses will be available as the array <code>req.ips</code> (<a href="http://expressjs.com/api.html#req.ips">see docs here</a>).
			
			
			.code-header
				h4 Alternate View Engines
				p By default, Keystone uses the <strong>Jade</strong> template engine for your views. Here's how you would set up a different engine, e.g. <strong>Swig</strong>.
			pre: code.language-javascript
				| var swig = require('swig');
				| keystone.set('view engine', 'swig');
				| keystone.set('custom engine', swig.renderFile);
		
			a(name='options-ssl')
			h3 HTTPS Web Server Options
			
			p There are two ways to implement HTTPS for your KeystoneJS application: either use a web server (e.g. <a href="http://nginx.com" target="_blank">NGINX</a>) or PAAS (e.g. <a href="https://www.heroku.com" target="_blank">Heroku</a>) that handles it for you, or set the following options to use the <a href="http://nodejs.org/api/https.html" target="_blank">https server provided by node.js</a>.
			
			table.table
				col(width=210)
				col
				tr
					td <code>ssl</code> <code class="data-type">Boolean</code> or <code class="data-type">String</code>
					td
						p Whether to start the SSL Server. Defaults to <code class="default-value">false</code>.
						p When set to <code class="default-value">true</code>, both https and https servers will be started. If <code>ssl key</code> or <code>ssl cert</code> are invalid, just the http server will be started.
						p When set to <code class="default-value">"only"</code>, only the https server will be started. If <code>ssl key</code> or <code>ssl cert</code> are invalid, KeystoneJS will not start.
				tr
					td <code>ssl key</code> <code class="data-type">Path</code>
					td
						p The path to your SSL Key. Should be either absolute or relative to <code class="default-value">process.cwd()</code> (which is usually your project root).
				tr
					td <code>ssl cert</code> <code class="data-type">Path</code>
					td
						p The path to your SSL Certificate. Should be either absolute or relative to <code class="default-value">process.cwd()</code> (which is usually your project root).
				tr
					td <code>ssl port</code> <code class="data-type">Number</code>
					td
						p The port to start the SSL Server on. Defaults to <code class="default-value">3001</code>.
				tr
					td <code>ssl host</code> <code class="data-type">String</code>
					td
						p The ip address to listen for request on. Defaults to <code class="default-value">process.env.SSL_IP</code> or the value of the <code>host</code> option.
			
			
			a(name='options-database')
			h3 Database and User Auth Options
			
			p The following options control your database configuration and user models / authentication:
			
			table.table
				col(width=210)
				col
				tr
					td <code>mongo</code> <code class="data-type">String</code>
					td
						p The url for your MongoDB connection.
						p You should typically set this to <code class="default-value">"mongodb://localhost/your-db" || process.env.MONGO_URI</code>
				tr
					td <code>model prefix</code> <code class="data-type">String</code>
					td
						p A prefix to apply to all the mongodb collections used by the models.
				tr
					td <code>auth</code> <code class="data-type">Mixed</code>
					td
						p Whether to enable built-in auth for Keystone's Admin UI, or a custom function to use to authenticate users.
						p When this is set to <code class="default-value">false</code> (or not defined), Keystone's Admin UI will be open to the public (so set it!)
						p If using a custom function, it should follow the standard for express middleware of <code>function(req, res, next)</code>. If a user is not logged in or should not access Keystone's Admin UI, use <code>res.redirect()</code> to redirect them - otherwise call the <code>next</code> callback to enable access.
				tr
					td <code>user model</code> <code class="data-type">String</code>
					td
						p The key of the Keystone List for users, <strong>required</strong> if <code>auth</code> is set to <code class="default-value">true</code>
						p Typically this would be set to <code class="default-value">User</code>.
				tr
					td <code>cookie secret</code> <code class="data-type">String</code>
					td
						p The encryption key to use for your cookies. Passed to Express's cookie parser.
						p It's a really good idea to set this to a long, random string.
				tr
					td <code>session store</code> <code class="data-type">String</code>
					td
						p Set this to <code class="default-value">mongo</code> to use your MongoDB database to persist session data.
						p By default, Keystone will use the in-memory session store provided by Express, which should only be used in development because it does not scale past a single process, and leaks memory over time.
						p Valid options are:
						ul
							li <code class="default-value">mongo</code> (or <code class="default-value">connect-mongo</code>)
							li <code class="default-value">connect-mongostore</code> (supports replica sets, but requires explicit configuration - see below)
							li <code class="default-value">connect-redis</code>
						p.note Session store packages are not bundled with Keystone, so make sure you explicitly add the selected session store to your project's <code>package.json</code>.
				tr
					td <code>session store options</code> <code class="data-type">Object</code>
					td
						p This option allows you to override the default session store configuration, and is passed to the session store package.
						p It is required when using the <code class="default-value">connect-mongostore</code> store.
						
						.code-header
							h4 Example for connect-mongostore
						pre: code.language-javascript
							| "sessionStore": {
							|   "db": {
							|     "name": "myDb",
							|     "servers": [
							|       { "host": "192.168.1.100", "port": 28001 },
							|       { "host": "192.168.1.100", "port": 28002 },
							|       { "host": "192.168.1.101", "port": 27017 }
							|     ]
							|   }
							| }
							
						.code-header
							h4 Example for connect-redis
						pre: code.language-javascript
							| "sessionStore": {
							|   "host": "", // Redis server hostname
							|   "port": "", // Redis server port
							|   "ttl": "", // Redis session TTL in seconds
							|   "db": "", // Database index to use
							|   "pass": "", // Password for Redis authentication
							|   "prefix": "", // Key prefix defaulting to "sess:"
							|   "url": "", // e.g. redis://user:pass@host:port/db
							| }
				tr
					td <code>back url</code> <code class="data-type">String</code>
					td
						p <code>href</code> to use for the 'back to (site name)' link in the header of the Admin UI
						p Defaults to <code class="default-value">/</code>
				tr
					td <code>signin url</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to when they fail the default auth check (e.g. not signed in)
						p Defaults to <code class="default-value">/keystone/signin</code>, only used when <code>auth</code> is set to <code class="default-value">true</code>
				tr
					td <code>signin redirect</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to after they successfully sign in via the built-in signin route
						p Defaults to <code class="default-value">/keystone</code>
				tr
					td <code>signout url</code> <code class="data-type">String</code>
					td
						p <code>href</code> for the signout link in the top right of the UI
						p Defaults to <code class="default-value">/keystone/signout</code> if <code>auth</code> is set to <code class="default-value">true</code>
				tr
					td <code>signout redirect</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to after they successfully sign out via the built-in signin route
						p Defaults to <code class="default-value">/keystone</code>
			
			p For more information about setting up and using database models with Keystone, see the <a href="/docs/database">database guide</a>.


			a(name='options-ui')
			h3 Admin UI Options
			
			p The following options control some ui options for the Admin backend:

			table.table
				col(width=210)
				col
				tr
					td <code>wysiwyg images</code> <code class="data-type">Boolean</code>
					td
						p Adds an image button which enables including images from other URLS in your WYSIWYG Editor.
				tr
					td <code>wysiwyg cloudinary images</code> <code class="data-type">Boolean</code>
					td
						p Adds an image upload button and enables cloudinary image uploads directly in your WYSIWYG Editor.
				tr
					td <code>wysiwyg additional buttons</code> <code class="data-type">String</code>
					td
						p Allows to add additional extra functionality buttons such as <code>blockquote</code>.
						p A complete list of available buttons can be found at: <a href="http://www.tinymce.com/wiki.php/Controls">http://www.tinymce.com/wiki.php/Controls</a>
				tr
					td <code>wysiwyg additional plugins</code> <code class="data-type">String</code>
					td
						p Allows for additional plugins to be activated which can be found at: <a href="http://www.tinymce.com/wiki.php/Plugins">http://www.tinymce.com/wiki.php/Plugins</a>
				tr
					td <code>wysiwyg additional options</code> <code class="data-type">Object</code>
					td
						p Allows for additional TinyMCE options, such as <code>{ menubar: true }</code> to be modified.
			
			
			//- a(name='emails')
			//- h2 Emails<commit_msg>moved wysiwyg to configuration.jade<commit_after>extends ../../templates/layout/base

include ../../templates/mixins/docsnav

block intro
	.page-header
		.container
			h1 Configuration
			p.lead How to roll KeystoneJS the way you want it.

block content
	.container: .row
		
		.col-sm-3
			+docsnav(docssection)
		
		.col-sm-9: .docs-content
			
			h2 Keystone Options
			
			a(name='options-concepts')
			h3 Setting Options
			
			p The options for KeystoneJS cover a range of behaviours, from how the express app is configured to enabling features and authentication options for integrated services.
			
			p There are three ways to set options:
			
			ul.options
				li Passing a <code>{ key: 'value' }</code> configuration <code class="data-type">Object</code> to the <code>keystone.init(options)</code> method
				li Calling <code>keystone.set('key', 'value')</code>
				li Setting environment variables in <code>process.env</code>. Only some options support this (noted below).
			
			p If you want to keep secret keys and configuration out of your codebase (especially important for open source projects, or projects where not all developers should have access to production config settings) the <a href="https://npmjs.org/package/dotenv" target="_blank">dotenv</a> module makes this very easy to manage.
			
			a(name='options-project')
			h3 Project Options
			
			p The following options control the branding, navigation and default export settings of the KeystoneJS application in the Admin UI:
			
			table.table
				col(width=210)
				col
				tr
					td <code>name</code> <code class="data-type">String</code>
					td The name of the KeystoneJS application
				tr
					td <code>brand</code> <code class="data-type">String</code>
					td Displayed in the top left hand corner of the Admin UI
				tr
					td <code>nav</code> <code class="data-type">Object</code>
					td
						p An object that specifies the navigation structure for the Admin UI. Create a key for each section that should be visible in the primary navigation. Each key's value can be a single list path (as is seen in the URL when you view a list) or an array of list paths. When an array is used, secondary navigation is rendered in the Admin UI.
						p The nav is also used to generate the links on the Admin UI home page; any lists that are registered but not included in the <code>nav</code> will be grouped at the bottom of the screen under the 'Other' heading.
				tr
					td <code>csv field delimiter</code> <code class="data-type">String</code>
					td Allow you to choose a custom field delimiter to be used for CSV export instead of the default comma.
			
			.code-header
				h4 Custom Navigation Example
				p If you had <code>User</code>, <code>Post</code> and <code>PostCategory</code> models, you could group the posts and post categories into a <strong>Content</strong> navigation item like this:
			pre: code.language-javascript
				| keystone.set('nav', {
				|     'users': 'users',
				|     'content': ['posts', 'post-categories']
				| });
		
			a(name='options-server')
			h3 Web Server Options
			
			p The following options control the configuration of your web server and the express app:
			
			table.table
				col(width=210)
				col
				tr
					td <code>env</code> <code class="data-type">String</code>
					td
						p The environment setting to use. The keys <strong>development</strong> and <strong>production</strong> are supported, and this will have an impact on things like caching compiled templates. Defaults to <code class="default-value">process.env.NODE_ENV || "development"</code>.
						p You should really <strong>set this to <code class="default-value">production</code> for your production servers</strong> using the <code>NODE_ENV</code> environment variable. Several other modules expect this convention also.
				tr
					td <code>port</code> <code class="data-type">Number</code>
					td
						p The port to listen for request on. Defaults to <code class="default-value">process.env.PORT || 3000</code>
				tr
					td <code>host</code> <code class="data-type">String</code>
					td
						p The ip address to listen for request on. Defaults to <code class="default-value">process.env.IP || '127.0.0.1'</code>
						p <code>port</code> must be set (either by option or env variable) or the <code>host</code> option will be ignored.
				tr
					td <code>views</code> <code class="data-type">String</code>
					td
						p The path to your application's <strong>view templates</strong>. This is required for using the <code>keystone.View</code> Class, and will also be set on the express app.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">"/templates/views"</code>.
				tr
					td <code>view engine</code> <code class="data-type">String</code>
					td
						p The template engine to use by default. Any engine with express support should work. <strong>Jade</strong> is included with Keystone, but you will have to add any alternate engine to your project's dependencies in your <code>package.json</code>.
						p This option is set on the express app (<a href="http://expressjs.com/api.html#app.engine" target="_blank">see docs here</a>).
				tr
					td <code>custom engine</code> <code class="data-type">Function</code>
					td
						p If you want to use a custom template engine, set this option to the function that should be used to process your templates.
						p See below for an example of how to use the <a href="http://paularmstrong.github.io/swig/" target="_blank">Swig</a> template engine.
				tr
					td <code>locals</code> <code class="data-type">Object</code>
					td
						p The default local variables to pass to your view templates.
						p Routes can extend or change local variables by modifying <code>res.locals</code>.
				tr
					td <code>static</code> <code class="data-type">String</code> or <code class="data-type">Array</code>
					td
						p One or more paths to your application's static files. Setting this will include the <code>express.static</code> middleware.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">'public'</code>.
				tr
					td <code>less</code> <code class="data-type">String</code>
					td
						p If you want Keystone to automatically compile <strong>.less</strong> files into <strong>.css</strong> files, set this value to the same path as the <code>static</code> option.
						p When this option is set, any requests to a <strong>.css</strong> or <strong>.min.css</strong> file will first check for a <strong>.less</strong> file with the same name, and if one is found, the css file will be regenerated.
				tr
					td <code>favicon</code> <code class="data-type">String</code>
					td
						p The path to your application's <strong>favicon</strong>. Setting this will include the <code>express.favicon</code> middleware. Should be relative to your project's root.
						p If you're following the <a href="/guide#start_structure">recommended project structure</a>, this should be set to <code class="default-value">"/public/favicon.ico"</code>.
				tr
					td <code>compress</code> <code class="data-type">Boolean</code>
					td Set this to <code class="default-value">true</code> to enable HTTP compression. This will include the <code>express.compress</code> middleware (<a href="http://expressjs.com/api.html#compress" target="_blank">see docs here</a>).
				tr
					td <code>logger</code> <code class="data-type">String</code>
					td Set this to include the <code>express.logger</code> middleware. The value will be passed to the middleware initialisation (<a href="http://www.senchalabs.org/connect/logger.html" target="_blank">see docs here</a>).

				tr
					td <code>trust proxy</code> <code class="data-type">Boolean</code>
					td Set this to enable processing of the HTTP request <code>X-Forwarded-For</code> header. Extracted IP addresses will be available as the array <code>req.ips</code> (<a href="http://expressjs.com/api.html#req.ips">see docs here</a>).
			
			
			.code-header
				h4 Alternate View Engines
				p By default, Keystone uses the <strong>Jade</strong> template engine for your views. Here's how you would set up a different engine, e.g. <strong>Swig</strong>.
			pre: code.language-javascript
				| var swig = require('swig');
				| keystone.set('view engine', 'swig');
				| keystone.set('custom engine', swig.renderFile);
		
			a(name='options-ssl')
			h3 HTTPS Web Server Options
			
			p There are two ways to implement HTTPS for your KeystoneJS application: either use a web server (e.g. <a href="http://nginx.com" target="_blank">NGINX</a>) or PAAS (e.g. <a href="https://www.heroku.com" target="_blank">Heroku</a>) that handles it for you, or set the following options to use the <a href="http://nodejs.org/api/https.html" target="_blank">https server provided by node.js</a>.
			
			table.table
				col(width=210)
				col
				tr
					td <code>ssl</code> <code class="data-type">Boolean</code> or <code class="data-type">String</code>
					td
						p Whether to start the SSL Server. Defaults to <code class="default-value">false</code>.
						p When set to <code class="default-value">true</code>, both https and https servers will be started. If <code>ssl key</code> or <code>ssl cert</code> are invalid, just the http server will be started.
						p When set to <code class="default-value">"only"</code>, only the https server will be started. If <code>ssl key</code> or <code>ssl cert</code> are invalid, KeystoneJS will not start.
				tr
					td <code>ssl key</code> <code class="data-type">Path</code>
					td
						p The path to your SSL Key. Should be either absolute or relative to <code class="default-value">process.cwd()</code> (which is usually your project root).
				tr
					td <code>ssl cert</code> <code class="data-type">Path</code>
					td
						p The path to your SSL Certificate. Should be either absolute or relative to <code class="default-value">process.cwd()</code> (which is usually your project root).
				tr
					td <code>ssl port</code> <code class="data-type">Number</code>
					td
						p The port to start the SSL Server on. Defaults to <code class="default-value">3001</code>.
				tr
					td <code>ssl host</code> <code class="data-type">String</code>
					td
						p The ip address to listen for request on. Defaults to <code class="default-value">process.env.SSL_IP</code> or the value of the <code>host</code> option.
			
			
			a(name='options-database')
			h3 Database and User Auth Options
			
			p The following options control your database configuration and user models / authentication:
			
			table.table
				col(width=210)
				col
				tr
					td <code>mongo</code> <code class="data-type">String</code>
					td
						p The url for your MongoDB connection.
						p You should typically set this to <code class="default-value">"mongodb://localhost/your-db" || process.env.MONGO_URI</code>
				tr
					td <code>model prefix</code> <code class="data-type">String</code>
					td
						p A prefix to apply to all the mongodb collections used by the models.
				tr
					td <code>auth</code> <code class="data-type">Mixed</code>
					td
						p Whether to enable built-in auth for Keystone's Admin UI, or a custom function to use to authenticate users.
						p When this is set to <code class="default-value">false</code> (or not defined), Keystone's Admin UI will be open to the public (so set it!)
						p If using a custom function, it should follow the standard for express middleware of <code>function(req, res, next)</code>. If a user is not logged in or should not access Keystone's Admin UI, use <code>res.redirect()</code> to redirect them - otherwise call the <code>next</code> callback to enable access.
				tr
					td <code>user model</code> <code class="data-type">String</code>
					td
						p The key of the Keystone List for users, <strong>required</strong> if <code>auth</code> is set to <code class="default-value">true</code>
						p Typically this would be set to <code class="default-value">User</code>.
				tr
					td <code>cookie secret</code> <code class="data-type">String</code>
					td
						p The encryption key to use for your cookies. Passed to Express's cookie parser.
						p It's a really good idea to set this to a long, random string.
				tr
					td <code>session store</code> <code class="data-type">String</code>
					td
						p Set this to <code class="default-value">mongo</code> to use your MongoDB database to persist session data.
						p By default, Keystone will use the in-memory session store provided by Express, which should only be used in development because it does not scale past a single process, and leaks memory over time.
						p Valid options are:
						ul
							li <code class="default-value">mongo</code> (or <code class="default-value">connect-mongo</code>)
							li <code class="default-value">connect-mongostore</code> (supports replica sets, but requires explicit configuration - see below)
							li <code class="default-value">connect-redis</code>
						p.note Session store packages are not bundled with Keystone, so make sure you explicitly add the selected session store to your project's <code>package.json</code>.
				tr
					td <code>session store options</code> <code class="data-type">Object</code>
					td
						p This option allows you to override the default session store configuration, and is passed to the session store package.
						p It is required when using the <code class="default-value">connect-mongostore</code> store.
						
						.code-header
							h4 Example for connect-mongostore
						pre: code.language-javascript
							| "sessionStore": {
							|   "db": {
							|     "name": "myDb",
							|     "servers": [
							|       { "host": "192.168.1.100", "port": 28001 },
							|       { "host": "192.168.1.100", "port": 28002 },
							|       { "host": "192.168.1.101", "port": 27017 }
							|     ]
							|   }
							| }
							
						.code-header
							h4 Example for connect-redis
						pre: code.language-javascript
							| "sessionStore": {
							|   "host": "", // Redis server hostname
							|   "port": "", // Redis server port
							|   "ttl": "", // Redis session TTL in seconds
							|   "db": "", // Database index to use
							|   "pass": "", // Password for Redis authentication
							|   "prefix": "", // Key prefix defaulting to "sess:"
							|   "url": "", // e.g. redis://user:pass@host:port/db
							| }
				tr
					td <code>back url</code> <code class="data-type">String</code>
					td
						p <code>href</code> to use for the 'back to (site name)' link in the header of the Admin UI
						p Defaults to <code class="default-value">/</code>
				tr
					td <code>signin url</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to when they fail the default auth check (e.g. not signed in)
						p Defaults to <code class="default-value">/keystone/signin</code>, only used when <code>auth</code> is set to <code class="default-value">true</code>
				tr
					td <code>signin redirect</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to after they successfully sign in via the built-in signin route
						p Defaults to <code class="default-value">/keystone</code>
				tr
					td <code>signout url</code> <code class="data-type">String</code>
					td
						p <code>href</code> for the signout link in the top right of the UI
						p Defaults to <code class="default-value">/keystone/signout</code> if <code>auth</code> is set to <code class="default-value">true</code>
				tr
					td <code>signout redirect</code> <code class="data-type">String</code>
					td
						p <code>href</code> to bounce visitors to after they successfully sign out via the built-in signin route
						p Defaults to <code class="default-value">/keystone</code>
			
			p For more information about setting up and using database models with Keystone, see the <a href="/docs/database">database guide</a>.


			a(name='options-ui')
			h3 Admin UI Options
			
			p The following options control some ui options for the Admin backend:

			table.table
				col(width=210)
				col
				tr
					td <code>wysiwyg images</code> <code class="data-type">Boolean</code>
					td
						p Adds an image button which enables including images from other URLS in your WYSIWYG Editor.
				tr
					td <code>wysiwyg cloudinary images</code> <code class="data-type">Boolean</code>
					td
						p Adds an image upload button and enables cloudinary image uploads directly in your WYSIWYG Editor.
				tr
					td <code>wysiwyg additional buttons</code> <code class="data-type">String</code>
					td
						p Allows to add additional extra functionality buttons such as <code>blockquote</code>.
						p A complete list of available buttons can be found at: <a href="http://www.tinymce.com/wiki.php/Controls">http://www.tinymce.com/wiki.php/Controls</a>
				tr
					td <code>wysiwyg additional plugins</code> <code class="data-type">String</code>
					td
						p Allows for additional plugins to be activated which can be found at: <a href="http://www.tinymce.com/wiki.php/Plugins">http://www.tinymce.com/wiki.php/Plugins</a>
				tr
					td <code>wysiwyg additional options</code> <code class="data-type">Object</code>
					td
						p Allows for additional TinyMCE options, such as <code>{ menubar: true }</code> to be modified.
				tr
					td <code>wysiwyg override toolbar</code> <code class="data-type">Booelan</code>
					td
						p This will remove the default set of buttons for wysiwyg mode. Use this with <code>wysiwyg additional buttons</code> and <code>wysiwyg additional plugins</code>. Defaults to <code class="data-type">false</code>.
				tr
					td <code>wysiwyg menubar</code> <code class="data-type">Boolean</code>
					td
						p Show the menubar for wysiwyg editor. Defaults to <code class="data-type">false</code>.
						p See <a href="http://www.tinymce.com/wiki.php/Configuration:menubar">http://www.tinymce.com/wiki.php/Configuration:menubar</a> for more details
				tr
					td <code>wysiwyg skin</code> <code class="data-type">String</code>
					td
						p Allow to change skin. Defaults to <code class="data-type">keystone</code>.
						p See <a href="http://www.tinymce.com/wiki.php/Configuration:skin">http://www.tinymce.com/wiki.php/Configuration:skin</a> for more details

							.code-header
								h4 Example using wysiwyg options
							pre: code.language-javascript
								| keystone.init({
								| 'wysiwyg override toolbar': false,
								| 'wysiwyg menubar': true,
								| 'wysiwyg skin': 'lightgray',
								| 'wysiwyg additional buttons': 'searchreplace visualchars,'
								|  + ' charmap ltr rtl pagebreak paste, forecolor backcolor,'
								|  +' emoticons media, preview print ',
								| 'wysiwyg additional plugins': 'example, table, advlist, anchor,'
								|  + ' autolink, autosave, bbcode, charmap, contextmenu, '
								|  + ' directionality, emoticons, fullpage, hr, media, pagebreak,'
								|  + ' paste, preview, print, searchreplace, textcolor,'
								|  + ' visualblocks, visualchars, wordcount',
								| });

			//- a(name='emails')
			//- h2 Emails
{'fraction_non_alphanumeric': 0.11638993472195888, 'fraction_numerical': 0.004848452016576831, 'mean_word_length': 3.2534562211981566, 'pattern_counts': {'":': 36, '<': 761, '<?xml version=': 0, '>': 761, 'https://': 4, 'lorem ipsum': 0, 'www.': 16, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5205413', 'n_tokens_mistral': 13363, 'n_tokens_neox': 10568, 'n_words': 4071}