From 633e8d164b74419ddd9f20d7da50d2ec30911388 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 21 Aug 2013 10:11:30 +0200 Subject: [PATCH] Rename sqlapi.host configuration to sqlapi.domain. Closes #79. Support for "host" is retained for backward compatibility. --- NEWS.md | 4 ++++ config/environments/development.js.example | 2 +- config/environments/production.js.example | 2 +- config/environments/staging.js.example | 2 +- config/environments/test.js.example | 2 +- lib/cartodb/server_options.js | 5 ++++- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index 60c3858f..00c883b9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ 1.3.4 ------ + +NOTE: configuration sqlapi.host renamed to sqlapi.domain + (support for "sqlapi.host" is retained for backward compatibility) + * Improve empty CartoCSS error message * Improve invalid mapnik-geometry-type CSS error message diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 795ab70b..32bbcde7 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -55,7 +55,7 @@ var config = { } ,sqlapi: { protocol: 'http', - host: 'localhost.lan', + domain: 'localhost.lan', port: 8080, version: 'v1' } diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 8a07f3b4..1cc96b8b 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -49,7 +49,7 @@ var config = { } ,sqlapi: { protocol: 'https', - host: 'cartodb.com', + domain: 'cartodb.com', port: 8080, version: 'v2' } diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index fad74159..39cd1ebb 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -49,7 +49,7 @@ var config = { } ,sqlapi: { protocol: 'https', - host: 'cartodb.com', + domain: 'cartodb.com', port: 8080, version: 'v2' } diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 7cc84c13..69452e0a 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -49,7 +49,7 @@ var config = { } ,sqlapi: { protocol: 'http', - host: '', + domain: '', // This port will be used by "make check" for testing purposes // It must be available port: 1080, diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 9957bf8a..14a06cc7 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -8,6 +8,9 @@ var _ = require('underscore') , LZMA = require('lzma/lzma_worker.js').LZMA ; +// This is for backward compatibility with 1.3.3 +if ( ! global.environment.sqlapi.domain ) global.environment.sqlapi.host; + module.exports = function(){ var rendererConfig = _.defaults(global.environment.renderer || {}, { @@ -62,7 +65,7 @@ module.exports = function(){ var api = global.environment.sqlapi; // build up api string - var sqlapi = api.protocol + '://' + username + '.' + api.host + ':' + api.port + '/api/' + api.version + '/sql' + var sqlapi = api.protocol + '://' + username + '.' + api.domain + ':' + api.port + '/api/' + api.version + '/sql' var qs = { q: sql }