2017-04-25 00:28:10 +08:00
|
|
|
// Time in milliseconds to force GC cycle.
|
|
|
|
// Disable by using <=0 value.
|
|
|
|
module.exports.gc_interval = 10000;
|
2019-10-01 23:27:46 +08:00
|
|
|
module.exports.routes = {
|
2019-10-02 23:35:34 +08:00
|
|
|
// Each entry corresponds with an express' router.
|
|
|
|
// You must define at least one path. However, middlewares are optional.
|
2019-10-02 22:02:13 +08:00
|
|
|
api: [{
|
2019-10-02 23:35:34 +08:00
|
|
|
// Required: path where other "routers" or "controllers" will be attached to.
|
2019-10-01 23:45:12 +08:00
|
|
|
paths: [
|
2019-10-01 23:54:09 +08:00
|
|
|
// In case the path has a :user param the username will be the one specified in the URL,
|
2019-10-01 23:45:12 +08:00
|
|
|
// otherwise it will fallback to extract the username from the host header.
|
|
|
|
'/api/:version',
|
|
|
|
'/user/:user/api/:version',
|
|
|
|
],
|
2019-10-02 23:35:34 +08:00
|
|
|
// Optional: attach middlewares at the begining of the router
|
2019-10-01 23:45:12 +08:00
|
|
|
// to perform custom operations.
|
2021-03-22 20:39:33 +08:00
|
|
|
// This must be a **comma-separated string** with the list of paths to the middlewares. Pe:
|
|
|
|
// CARTO_SQL_PREROUTING_MIDDLEWARES=/usr/src/lib/mw1.js,/usr/src/lib/mw2.js
|
|
|
|
// Note: The list order is kept when loading the middlewares!
|
|
|
|
middlewares: process.env.CARTO_SQL_PREROUTING_MIDDLEWARES || '',
|
2019-10-02 22:02:13 +08:00
|
|
|
sql: [{
|
2019-10-02 23:35:34 +08:00
|
|
|
// Required
|
2019-10-02 22:02:13 +08:00
|
|
|
paths: [
|
|
|
|
'/sql'
|
2019-10-02 23:35:34 +08:00
|
|
|
],
|
|
|
|
// Optional
|
2021-03-22 20:39:33 +08:00
|
|
|
middlewares: process.env.CARTO_SQL_SQLROUTING_MIDDLEWARES || ''
|
2019-10-02 22:02:13 +08:00
|
|
|
}]
|
|
|
|
}]
|
2019-10-01 23:27:46 +08:00
|
|
|
};
|
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;
|
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-07-01 19:00:39 +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-06-13 11:23:02 +08:00
|
|
|
module.exports.environment = 'production';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Supported labels: 'user_id' (read from redis)
|
2011-06-13 11:23:02 +08:00
|
|
|
module.exports.db_base_name = 'cartodb_user_<%= user_id %>_db';
|
2013-11-18 20:31:11 +08:00
|
|
|
// Supported labels: 'user_id' (read from redis)
|
2011-06-13 11:23:02 +08:00
|
|
|
module.exports.db_user = 'cartodb_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-06-13 11:23:02 +08:00
|
|
|
module.exports.db_host = 'localhost';
|
2011-06-17 00:29:51 +08:00
|
|
|
module.exports.db_port = '6432';
|
2016-01-21 22:33:42 +08:00
|
|
|
module.exports.db_batch_port = '5432';
|
2016-08-30 16:11:49 +08:00
|
|
|
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
|
2016-10-10 17:10:28 +08:00
|
|
|
module.exports.batch_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds
|
2018-07-20 21:32:32 +08:00
|
|
|
module.exports.copy_timeout = "'5h'";
|
2018-07-26 18:52:18 +08:00
|
|
|
module.exports.copy_from_max_post_size = 2 * 1024 * 1024 * 1024 // 2 GB;
|
2018-07-23 22:59:27 +08:00
|
|
|
module.exports.copy_from_max_post_size_pretty = '2 GB';
|
2019-05-29 17:21:22 +08:00
|
|
|
module.exports.copy_from_minimum_input_speed = 0; // 1 byte per second
|
2019-05-29 01:24:29 +08:00
|
|
|
module.exports.copy_from_maximum_slow_input_speed_interval = 15 // 15 seconds
|
2016-10-13 04:40:09 +08:00
|
|
|
// Max number of queued jobs a user can have at a given time
|
2016-10-17 21:23:53 +08:00
|
|
|
module.exports.batch_max_queued_jobs = 64;
|
2016-10-20 00:42:53 +08:00
|
|
|
// Capacity strategy to use.
|
|
|
|
// It allows to tune how many queries run at a db host at the same time.
|
2016-10-20 17:12:08 +08:00
|
|
|
// Options: 'fixed', 'http-simple', 'http-load'
|
2016-10-20 00:42:53 +08:00
|
|
|
module.exports.batch_capacity_strategy = 'fixed';
|
|
|
|
// Applies when strategy='fixed'.
|
|
|
|
// Number of simultaneous users running queries in the same host.
|
|
|
|
// It will use 1 as min.
|
2016-10-21 02:16:34 +08:00
|
|
|
// Default 4.
|
|
|
|
module.exports.batch_capacity_fixed_amount = 4;
|
2016-10-20 17:12:08 +08:00
|
|
|
// Applies when strategy='http-simple' or strategy='http-load'.
|
2016-10-20 00:42:53 +08:00
|
|
|
// HTTP endpoint to check db host load.
|
|
|
|
// Helps to decide the number of simultaneous users running queries in that host.
|
2016-10-20 17:12:08 +08:00
|
|
|
// 'http-simple' will use 'available_cores' to decide the number.
|
|
|
|
// 'http-load' will use 'cores' and 'relative_load' to decide the number.
|
2016-10-20 00:42:53 +08:00
|
|
|
// It will use 1 as min.
|
|
|
|
// If no template is provided it will default to 'fixed' strategy.
|
|
|
|
module.exports.batch_capacity_http_url_template = 'http://<%= dbhost %>:9999/load';
|
2021-04-08 01:03:09 +08:00
|
|
|
// Default database number in redis for batch queries
|
|
|
|
module.exports.batch_db = 5;
|
2013-05-24 18:06:14 +08:00
|
|
|
// Max database connections in the pool
|
2015-12-25 00:42:49 +08:00
|
|
|
// Subsequent connections will wait for a free slot.i
|
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
|
2019-05-07 00:51:00 +08:00
|
|
|
module.exports.db_use_config_object = true;
|
2015-02-20 00:27:41 +08:00
|
|
|
// requires enabling db_use_config_object=true
|
|
|
|
// allows to enable/disable keep alive for database connections
|
|
|
|
// by default is not enabled
|
2019-05-07 00:51:00 +08:00
|
|
|
module.exports.db_keep_alive = {
|
|
|
|
enabled: true,
|
|
|
|
initialDelay: 5000 // Not used yet
|
|
|
|
};
|
2011-06-13 11:23:02 +08:00
|
|
|
module.exports.redis_host = '127.0.0.1';
|
|
|
|
module.exports.redis_port = 6379;
|
2011-06-17 00:29:51 +08:00
|
|
|
module.exports.redisPool = 50;
|
|
|
|
module.exports.redisIdleTimeoutMillis = 10000;
|
|
|
|
module.exports.redisReapIntervalMillis = 1000;
|
2012-02-09 23:52:53 +08:00
|
|
|
module.exports.redisLog = false;
|
2017-06-27 19:14:13 +08:00
|
|
|
|
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';
|
2017-04-06 00:47:44 +08:00
|
|
|
// change zip command or path
|
|
|
|
module.exports.zipCommand = 'zip';
|
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'
|
|
|
|
};
|
2016-07-07 20:20:36 +08:00
|
|
|
module.exports.oauth = {
|
|
|
|
allowedHosts: ['carto.com', 'cartodb.com']
|
|
|
|
};
|
2015-03-26 01:28:45 +08:00
|
|
|
module.exports.disabled_file = 'pids/disabled';
|
2018-03-01 18:30:58 +08:00
|
|
|
|
|
|
|
module.exports.ratelimits = {
|
|
|
|
// whether it should rate limit endpoints (global configuration)
|
|
|
|
rateLimitsEnabled: false,
|
|
|
|
// whether it should rate limit one or more endpoints (only if rateLimitsEnabled = true)
|
|
|
|
endpoints: {
|
|
|
|
query: false,
|
|
|
|
job_create: false,
|
|
|
|
job_get: false,
|
2019-02-27 20:00:52 +08:00
|
|
|
job_delete: false,
|
|
|
|
copy_from: false,
|
|
|
|
copy_to: false
|
2018-03-01 18:30:58 +08:00
|
|
|
}
|
|
|
|
}
|
2018-04-24 21:54:48 +08:00
|
|
|
|
|
|
|
module.exports.validatePGEntitiesAccess = false;
|
2019-02-27 19:49:55 +08:00
|
|
|
module.exports.logQueries = true;
|
|
|
|
module.exports.maxQueriesLogLength = 1024;
|
2019-07-04 16:45:35 +08:00
|
|
|
|
|
|
|
module.exports.cache = {
|
|
|
|
ttl: 60 * 60 * 24 * 365, // one year in seconds
|
|
|
|
fallbackTtl: 60 * 5 // five minutes in seconds
|
|
|
|
};
|
2020-02-27 00:19:07 +08:00
|
|
|
|
|
|
|
module.exports.pubSubMetrics = {
|
|
|
|
enabled: true,
|
|
|
|
project_id: 'avid-wavelet-844',
|
|
|
|
credentials: '',
|
|
|
|
topic: 'raw-metric-events'
|
|
|
|
};
|