/**
* Module for user provided dashboard configurations
* @module frontend/express/config
*/
/** @lends module:frontend/express/config */
var countlyConfig = {
/**
* MongoDB connection definition and options
* @type {object}
* @property {string} [host=localhost] - host where to connect to mongodb, default localhost
* @property {array=} replSetServers - array with multiple hosts, if you are connecting to replica set, provide this instead of host
* @property {string=} replicaName - replica name, must provide for replica set connection to work
* @property {string} [db=countly] - main countly database name, default countly, databases.countly overrides it
* @property {number} [port=27017] - port to use for mongodb connection, default 27017
* @property {number} [max_pool_size=500] - how large pool size connection per process to create, default 500 per process, not recommended to be more than 1000 per server
* @property {string=} username - username for authenticating user, if mongodb supports authentication
* @property {string=} password - password for authenticating user, if mongodb supports authentication
* @property {object=} dbOptions - provide raw driver database options
* @property {object=} serverOptions - provide raw driver server options, used for all, single, mongos and replica set servers
*/
mongodb: {
host: "localhost",
db: "countly",
port: 27017,
max_pool_size: 10,
//username: test,
//password: test,
/*
dbOptions:{
//db options
}
*/
},
/* or for a replica set
mongodb: {
replSetServers : [
'192.168.3.1:27017',
'192.168.3.2:27017'
],
db: "countly",
replicaName: "test",
username: test,
password: test,
max_pool_size: 10,
dbOptions:{
//db options
}
},
*/
/* or define as a url
//mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/?options]
//database names are not taken from the url, see databases below
//with username and password also set authSource, e.g. mongodb://user:pass@localhost:27017/?authSource=admin
mongodb: "mongodb://localhost:27017",
*/
/**
* Optional explicit database names. By default Countly databases are named countly, countly_drill,
* countly_out and countly_fs. Set a name here to use a different database, it is used as is.
* These override db set in mongodb config (countly) or in database own config file, e.g. drill/config.js
* (countly_drill), env vars override these. Must be same in api and frontend configs.
* Env vars: COUNTLY_CONFIG__DATABASES_COUNTLY, COUNTLY_CONFIG__DATABASES_COUNTLY_DRILL,
* COUNTLY_CONFIG__DATABASES_COUNTLY_OUT, COUNTLY_CONFIG__DATABASES_COUNTLY_FS
* @type {object=}
* @property {string=} countly - main database name
* @property {string=} countly_drill - drill database name
* @property {string=} countly_out - out database name
* @property {string=} countly_fs - file storage database name
*/
/*
databases: {
countly: "countly",
countly_drill: "countly_drill",
countly_out: "countly_out",
countly_fs: "countly_fs"
},
*/
/**
* Default dashboard configuration
* @type {object}
* @property {number} [port=6001] - dashboard port number to use, default 6001
* @property {string} [host=localhost] - host to which to bind connection
* @property {boolean} use_intercom - true, to use internal communication in dashboard for communication with Countly
* @property {boolean} secure_cookies - true, to use secure cookies, enable only if you have https enabled
* @property {string} session_secret - secret used to sign the session ID cookie.
* @property {string} [session_name=connect.sid] - name of the session cookie
* @property {string} [theme=] - the name/folder of the theme
* @property {string} track - allow Countly to collect stats about amount of apps and datapoints as well as feature usage.
* Possible values are:
* "all" - track all,
* "GA" - track only Global admins,
* "noneGA" - track only users who are not Global admins,
* "none" - not to track anything or anyone
*/
web: {
port: 6001,
host: "localhost",
use_intercom: true,
secure_cookies: false,
track: "all",
theme: "",
session_secret: "countlyss",
session_name: "connect.sid",
ssl: {
enabled: false,
key: "/path/to/ssl/private.key",
cert: "/path/to/ssl/certificate.crt",
// ca: "/path/to/ssl/ca_bundle.crt" // Optional: for client certificate verification, uncomment to activate
// minVersion: "TLSv1.2", // Optional: pin the lowest allowed TLS protocol (e.g. "TLSv1.2"). Unset = Node defaults
// maxVersion: "TLSv1.3", // Optional: pin the highest allowed TLS protocol. Unset = Node defaults
}
},
/**
* Cookie configuration
* @type {object}
* @property {string} [path=/] - path where cookie is accessible
* @property {boolean} [httpOnly=true] - should cookies be http only
* @property {boolean} [secure=false] - true, to use secure cookies, enable only if you have https enabled
* @property {number} [maxAge=1day] - miliseconds for how long cookie should last
* @property {number} [maxAgeLogin=1year] - miliseconds for how long cookie should last for authenticated users
* @property {string} domain - domain name on which cookie is valide, by default current domain
* @property {Date} expires - alternative to maxAge, specifies the Date object to be the value for the Expires Set-Cookie attribute
* @property {boolean|string} sameSite - specifies the boolean or string to be the value for the SameSite Set-Cookie attribute.
*/
cookie: {
path: '/',
httpOnly: true,
secure: false,
maxAge: 1000 * 60 * 60 * 24,
maxAgeLogin: 1000 * 60 * 60 * 24 * 365
},
/**
* Legacy value, not supported
* @type {string}
*/
path: "",
/**
* Legacy value, not supported
* @type {string}
*/
cdn: "",
/**
* Additional password secret for safer autentification. This secret will be added on changing and creating password. Changing value in configs will result in invalid passwords for existing users.
* Default value is "".
*/
passwordSecret: ""
};
module.exports = require('../../api/configextender')('FRONTEND', countlyConfig, process.env);