clean up environment settings

This commit is contained in:
Simon Tokumine 2012-05-01 19:00:14 +01:00
parent 97f9f6a5ee
commit d1226992c3
6 changed files with 95 additions and 54 deletions

6
app.js
View File

@ -20,8 +20,6 @@ var _ = require('underscore')
, Step = require('step')
, cartoData = require('./lib/cartodb/carto_data')
, CartodbWindshaft = require('./lib/cartodb/cartodb_windshaft');
// set environment specific variables
global.settings = require(__dirname + '/config/settings');
@ -32,5 +30,5 @@ var Windshaft = require('windshaft');
var serverOptions = require('./lib/cartodb/server_options');
ws = CartodbWindshaft(serverOptions);
ws.listen(global.environment.windshaft_port);
console.log("Windshaft tileserver started on port " + global.environment.windshaft_port);
ws.listen(global.environment.port);
console.log("Windshaft tileserver started on port " + global.environment.port);

View File

@ -23,7 +23,6 @@ var _ = require('underscore')
, CartodbWindshaft = require('./lib/cartodb/cartodb_windshaft');
// set environment specific variables
global.settings = require(__dirname + '/config/settings');
global.environment = require(__dirname + '/config/environments/' + ENV);
@ -38,7 +37,6 @@ cluster(ws)
.use(cluster.stats())
.use(cluster.pidfiles('pids'))
.set('workers', 1)
.listen(global.environment.windshaft_port, global.environment.windshaft_host);
.listen(global.environment.windshaft_port, global.environment.host);
//ws.listen(global.environment.windshaft_port);
console.log("Windshaft tileserver started on port " + global.environment.windshaft_port);
console.log("Windshaft tileserver started on port " + global.environment.port);

View File

@ -1,22 +1,33 @@
module.exports.name = 'development';
module.exports.postgres = {
type: "postgis",
user: "tileuser",
host: '127.0.0.1',
port: 5432,
geometry_field: "the_geom",
extent: "-180,-90,180,90",
srid: 4326,
max_size: 0,
simplify: true
};
module.exports.redis = {host: '127.0.0.1',
port: 6379,
idleTimeoutMillis: 1,
reapIntervalMillis: 1};
module.exports.windshaft_port = 8181;
module.exports.windshaft_host = '127.0.0.1';
module.exports.enable_cors = true;
module.exports.varnish_host = 'localhost';
module.exports.varnish_port = 6082;
module.exports.cache_enabled = false;
var config = {
environment: 'development'
,port: 8181
,host: '127.0.0.1'
,enable_cors: true
,postgres: {
type: "postgis",
user: "tileuser",
host: '127.0.0.1',
port: 5432,
geometry_field: "the_geom",
extent: "-180,-90,180,90",
srid: 4326,
max_size: 0,
simplify: true
}
,redis: {
host: '127.0.0.1',
port: 6379,
idleTimeoutMillis: 1,
reapIntervalMillis: 1
}
,sqlapi: {
host: '127.0.0.1',
port: 8080
}
,varnish: {
host: 'localhost',
port: 6082
}
};
module.exports = config;

View File

@ -1,9 +1,26 @@
module.exports.name = 'production';
module.exports.postgres = {user: 'tileuser', host: '127.0.0.1', port: 6432, simplify: true};
module.exports.redis = {host: '127.0.0.1', port: 6379};
module.exports.windshaft_port = 8181;
module.exports.windshaft_host = '127.0.0.1';
module.exports.ttl_timeout = 600; // 10 minutes
module.exports.varnish_host = 'localhost';
module.exports.varnish_port = 6082
module.exports.cache_enabled = true;
var config = {
environment: 'production'
,port: 8181
,host: '127.0.0.1'
,enable_cors: true
,postgres: {
user: "tileuser",
host: '127.0.0.1',
port: 6432,
simplify: true
}
,redis: {
host: '127.0.0.1',
port: 6379
}
,sqlapi: {
host: '127.0.0.1',
port: 8080
}
,varnish: {
host: 'localhost',
port: 6082
}
};
module.exports = config;

View File

@ -1,12 +1,30 @@
module.exports.name = 'test';
module.exports.postgres = {user: 'tileuser', host: '127.0.0.1', port: 5432, simplify: true};
module.exports.redis = {host: '127.0.0.1',
port: 6379,
idleTimeoutMillis: 1,
reapIntervalMillis: 1};
module.exports.windshaft_port = 8080;
module.exports.windshaft_host = '127.0.0.1';
module.exports.enable_cors = true;
module.exports.varnish_host = '';
module.exports.varnish_port = null;
module.exports.cache_enabled = false;
var config = {
environment: 'test'
,port: 8080
,host: '127.0.0.1'
,enable_cors: true
,postgres: {
user: "tileuser",
host: '127.0.0.1',
port: 5432,
srid: 4326,
max_size: 0,
simplify: true
}
,redis: {
host: '127.0.0.1',
port: 6379,
idleTimeoutMillis: 1,
reapIntervalMillis: 1
}
,sqlapi: {
host: '127.0.0.1',
port: 8080
}
,varnish: {
host: '',
port: null
}
};
module.exports = config;

View File

@ -8,9 +8,8 @@ module.exports = function(){
grainstore: {datasource: global.environment.postgres},
redis: global.environment.redis,
enable_cors: global.environment.enable_cors,
varnish_host: global.environment.varnish_host,
varnish_port: global.environment.varnish_port,
cache_enabled: global.environment.cache_enabled,
varnish_host: global.environment.varnish.host,
varnish_port: global.environment.varnish.port,
log_format: '[:date] :req[X-Real-IP] \033[90m:method\033[0m \033[36m:req[Host]:url\033[0m \033[90m:status :response-time ms -> :res[Content-Type]\033[0m'
};