2015-02-02 19:09:34 +08:00
|
|
|
// In case the base_url has a :user param the username will be the one specified in the URL,
|
|
|
|
// otherwise it will fallback to extract the username from the host header.
|
2015-04-08 22:13:04 +08:00
|
|
|
module.exports.base_url = '(?:/api/:version|/user/:user/api/:version)';
|
2014-03-20 17:48:23 +08:00
|
|
|
// If useProfiler is true every response will be served with an
|
|
|
|
// X-SQLAPI-Profile header containing elapsed timing for various
|
|
|
|
// steps taken for producing the response.
|
2014-03-20 01:34:21 +08:00
|
|
|
module.exports.useProfiler = true;
|
|
|
|
module.exports.log_format = '[:date] :req[X-Real-IP] :method :req[Host]:url :status :response-time ms -> :res[Content-Type] (:res[X-SQLAPI-Profiler])';
|
2014-05-27 17:51:44 +08:00
|
|
|
// If log_filename is given logs will be written there, in append mode. Otherwise stdout is used (default).
|
|
|
|
// Log file will be re-opened on receiving the HUP signal
|
|
|
|
module.exports.log_filename = 'logs/cartodb-sql-api.log';
|
2013-12-18 18:57:46 +08:00
|
|
|
// Regular expression pattern to extract username
|
|
|
|
// from hostname. Must have a single grabbing block.
|
|
|
|
module.exports.user_from_host = '^(.*)\\.cartodb\\.com$';
|
2011-09-16 19:43:10 +08:00
|
|
|
module.exports.node_port = 8080;
|
2012-02-09 23:52:53 +08:00
|
|
|
module.exports.node_host = '127.0.0.1';
|
2012-12-05 21:02:10 +08:00
|
|
|
// idle socket timeout, in miliseconds
|
|
|
|
module.exports.node_socket_timeout = 600000;
|
2011-09-16 19:43:10 +08:00
|
|
|
module.exports.environment = 'staging';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Supported labels: 'user_id' (read from redis)
|
2012-09-04 17:16:11 +08:00
|
|
|
module.exports.db_base_name = 'cartodb_staging_user_<%= user_id %>_db';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Supported labels: 'user_id' (read from redis)
|
2012-09-04 17:16:11 +08:00
|
|
|
module.exports.db_user = 'cartodb_staging_user_<%= user_id %>';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Supported labels: 'user_id', 'user_password' (both read from redis)
|
2013-11-18 20:42:52 +08:00
|
|
|
module.exports.db_user_pass = '<%= user_password %>'
|
2013-11-06 00:49:10 +08:00
|
|
|
// Name of the anonymous PostgreSQL user
|
|
|
|
module.exports.db_pubuser = 'publicuser';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Password for the anonymous PostgreSQL user
|
|
|
|
module.exports.db_pubuser_pass = 'public';
|
2011-09-16 19:43:10 +08:00
|
|
|
module.exports.db_host = 'localhost';
|
|
|
|
module.exports.db_port = '6432';
|
2015-12-22 22:43:00 +08:00
|
|
|
module.exports.db_batch_port = '6432';
|
2013-05-24 18:06:14 +08:00
|
|
|
// Max database connections in the pool
|
|
|
|
// Subsequent connections will wait for a free slot.
|
2015-12-22 22:43:00 +08:00
|
|
|
// NOTE: not used by OGR-mediated accesses
|
2013-05-24 18:06:14 +08:00
|
|
|
module.exports.db_pool_size = 500;
|
|
|
|
// Milliseconds before a connection is removed from pool
|
|
|
|
module.exports.db_pool_idleTimeout = 30000;
|
|
|
|
// Milliseconds between idle client checking
|
|
|
|
module.exports.db_pool_reapInterval = 1000;
|
2015-02-26 23:18:37 +08:00
|
|
|
// max number of bytes for a row, when exceeded the query will throw an error
|
|
|
|
//module.exports.db_max_row_size = 10 * 1024 * 1024;
|
2015-02-20 00:27:41 +08:00
|
|
|
// allows to use an object to connect with node-postgres instead of a connection string
|
|
|
|
//module.exports.db_use_config_object = true;
|
|
|
|
// requires enabling db_use_config_object=true
|
|
|
|
// allows to enable/disable keep alive for database connections
|
|
|
|
// by default is not enabled
|
|
|
|
//module.exports.db_keep_alive = {
|
|
|
|
// enabled: true,
|
|
|
|
// initialDelay: 5000
|
|
|
|
//};
|
2015-02-26 23:18:37 +08:00
|
|
|
module.exports.redis_host = '127.0.0.1';
|
|
|
|
module.exports.redis_port = 6379;
|
|
|
|
module.exports.redisPool = 50;
|
|
|
|
module.exports.redisIdleTimeoutMillis = 10000;
|
|
|
|
module.exports.redisReapIntervalMillis = 1000;
|
2011-09-16 19:43:10 +08:00
|
|
|
module.exports.redisLog = false;
|
2013-02-14 01:57:14 +08:00
|
|
|
// Max number of entries in the query tables cache
|
|
|
|
module.exports.tableCacheMax = 8192;
|
|
|
|
// Max age of query table cache items, in milliseconds
|
|
|
|
module.exports.tableCacheMaxAge = 1000*60*10;
|
2013-08-21 16:03:12 +08:00
|
|
|
// Temporary directory, make sure it is writable by server user
|
2013-03-26 23:01:42 +08:00
|
|
|
module.exports.tmpDir = '/tmp';
|
2015-06-16 21:53:33 +08:00
|
|
|
// change ogr2ogr command or path
|
|
|
|
module.exports.ogr2ogrCommand = 'ogr2ogr';
|
2014-03-13 19:09:39 +08:00
|
|
|
// Optional rollbar support
|
|
|
|
module.exports.rollbar = {
|
|
|
|
token: 'secret',
|
|
|
|
// See http://github.com/rollbar/node_rollbar#configuration-reference
|
|
|
|
options: {
|
|
|
|
handler: 'inline'
|
|
|
|
}
|
|
|
|
}
|
2014-03-20 18:22:13 +08:00
|
|
|
// Optional statsd support
|
|
|
|
module.exports.statsd = {
|
|
|
|
host: 'localhost',
|
|
|
|
port: 8125,
|
|
|
|
prefix: 'dev.:host.',
|
|
|
|
cacheDns: true
|
|
|
|
// support all allowed node-statsd options
|
2014-08-27 00:40:58 +08:00
|
|
|
};
|
|
|
|
module.exports.health = {
|
|
|
|
enabled: true,
|
|
|
|
username: 'development',
|
|
|
|
query: 'select 1'
|
|
|
|
};
|
2015-03-26 01:28:45 +08:00
|
|
|
module.exports.disabled_file = 'pids/disabled';
|