diff --git a/NEWS.md b/NEWS.md index a603b02c..c4ba2af5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,41 @@ # Changelog -## 2.16.1 +## 2.19.2 Released 2015-mm-dd +## 2.19.1 + +Released 2015-11-23 + +Announcements: + - Upgrades windshaft to [1.6.1](https://github.com/CartoDB/Windshaft/releases/tag/1.6.1) + + +## 2.19.0 + +Released 2015-11-12 + +Announcements: + - Upgrades windshaft to [1.6.0](https://github.com/CartoDB/Windshaft/releases/tag/1.6.0) + +## 2.18.0 + +Released 2015-11-02 + +Announcements: + - Upgrades windshaft to [1.5.0](https://github.com/CartoDB/Windshaft/releases/tag/1.5.0) + + +## 2.17.0 + +Released 2015-10-28 + +Announcements: + - Upgrades windshaft to [1.4.0](https://github.com/CartoDB/Windshaft/releases/tag/1.4.0) + + ## 2.16.0 Released 2015-10-22 diff --git a/README.md b/README.md index 9a953c02..891050db 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Requirements ------------ - Core - Node.js >=0.8 - - npm >=1.2.1 + - npm >=1.2.1 <2.0.0 - PostgreSQL >8.3.x, PostGIS >1.5.x - Redis >2.4.0 (http://www.redis.io) - - Mapnik 2.0.1, 2.0.2, 2.1.0, 2.2.0, 2.3.0. See Installing Mapnik. + - Mapnik 2.0.1, 2.0.2, 2.1.0, 2.2.0, 2.3.0. See [Installing Mapnik](https://github.com/CartoDB/Windshaft#installing-mapnik). - Windshaft: check [Windshaft dependencies and installation notes](https://github.com/CartoDB/Windshaft#dependencies) - libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support @@ -31,6 +31,15 @@ Requirements - For running the testsuite - ImageMagick (http://www.imagemagick.org) +Dependencies installation example: + +```shell +sudo add-apt-repository -y ppa:cartodb/cairo +sudo apt-get update +sudo apt-get install -y build-essential checkinstall pkg-config libcairo2-dev libjpeg8-dev libgif-dev +``` + + Configure --------- @@ -46,7 +55,6 @@ Build/install To fetch and build all node-based dependencies, run: ``` -git clone npm install ``` @@ -93,7 +101,6 @@ Examples [CartoDB's Map Gallery](http://cartodb.com/gallery/) showcases several examples of visualisations built on top of this. - Contributing --- diff --git a/docs/named_maps.md b/docs/named_maps.md index 29303cbc..62dd44bd 100644 --- a/docs/named_maps.md +++ b/docs/named_maps.md @@ -12,6 +12,8 @@ The main two differences compared to anonymous maps are: Template maps are persistent with no preset expiration. They can only be created or deleted by a CartoDB user with a valid API_KEY (see auth section). +**Note:** There is a limit of 4,096 named maps allowed per account. If you need to create more Named Maps, it is recommended to use templates. + ## Create #### Definition diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 89c5e1ad..a28c0269 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "windshaft-cartodb", - "version": "2.16.1", + "version": "2.19.2", "dependencies": { "body-parser": { "version": "1.14.1", @@ -321,9 +321,9 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz" }, "range-parser": { - "version": "1.0.2", + "version": "1.0.3", "from": "range-parser@~1.0.2", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.2.tgz" + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.3.tgz" }, "send": { "version": "0.13.0", @@ -425,9 +425,9 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", "dependencies": { "core-util-is": { - "version": "1.0.1", + "version": "1.0.2", "from": "core-util-is@~1.0.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, "isarray": { "version": "0.0.1", @@ -441,7 +441,7 @@ }, "inherits": { "version": "2.0.1", - "from": "inherits@2", + "from": "inherits@~2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" } } @@ -522,18 +522,18 @@ "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz", "dependencies": { "readable-stream": { - "version": "2.0.2", + "version": "2.0.4", "from": "readable-stream@~2.0.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz", "dependencies": { "core-util-is": { - "version": "1.0.1", + "version": "1.0.2", "from": "core-util-is@~1.0.0", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, "inherits": { "version": "2.0.1", - "from": "inherits@~2.0.1", + "from": "inherits@2", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "isarray": { @@ -581,9 +581,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz", "dependencies": { "async": { - "version": "1.4.2", + "version": "1.5.0", "from": "async@^1.4.0", - "resolved": "https://registry.npmjs.org/async/-/async-1.4.2.tgz" + "resolved": "https://registry.npmjs.org/async/-/async-1.5.0.tgz" } } }, @@ -594,7 +594,7 @@ }, "mime-types": { "version": "2.1.7", - "from": "mime-types@~2.1.6", + "from": "mime-types@~2.1.2", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.7.tgz", "dependencies": { "mime-db": { @@ -605,9 +605,9 @@ } }, "node-uuid": { - "version": "1.4.3", + "version": "1.4.7", "from": "node-uuid@~1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, "qs": { "version": "5.1.0", @@ -620,9 +620,9 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" }, "tough-cookie": { - "version": "2.2.0", + "version": "2.2.1", "from": "tough-cookie@>=0.12.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.0.tgz" + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" }, "http-signature": { "version": "0.11.0", @@ -652,9 +652,9 @@ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" }, "hawk": { - "version": "3.1.0", + "version": "3.1.2", "from": "hawk@~3.1.0", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.2.tgz", "dependencies": { "hoek": { "version": "2.16.3", @@ -662,9 +662,9 @@ "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" }, "boom": { - "version": "2.9.0", - "from": "boom@^2.8.x", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.9.0.tgz" + "version": "2.10.1", + "from": "boom@2.x.x", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" }, "cryptiles": { "version": "2.0.5", @@ -684,9 +684,9 @@ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" }, "stringstream": { - "version": "0.0.4", + "version": "0.0.5", "from": "stringstream@~0.0.4", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" }, "combined-stream": { "version": "1.0.5", @@ -774,9 +774,9 @@ } }, "is-my-json-valid": { - "version": "2.12.2", + "version": "2.12.3", "from": "is-my-json-valid@^2.12.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.2.tgz", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.3.tgz", "dependencies": { "generate-function": { "version": "2.0.0", @@ -801,9 +801,9 @@ "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, "xtend": { - "version": "4.0.0", + "version": "4.0.1", "from": "xtend@^4.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz" + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" } } } @@ -827,13 +827,14 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" }, "windshaft": { - "version": "1.2.0", - "from": "windshaft@~1.2.0", + "version": "1.6.1", + "from": "windshaft@1.6.1", + "resolved": "https://registry.npmjs.org/windshaft/-/windshaft-1.6.1.tgz", "dependencies": { "mapnik": { - "version": "1.4.15-cdb2", - "from": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb2", - "resolved": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb2", + "version": "1.4.15-cdb6", + "from": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", + "resolved": "https://github.com/CartoDB/node-mapnik/tarball/1.4.15-cdb6", "dependencies": { "nan": { "version": "1.2.0", @@ -1296,14 +1297,14 @@ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" }, "node-uuid": { - "version": "1.4.3", + "version": "1.4.7", "from": "node-uuid@~1.4.0", - "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, "tough-cookie": { - "version": "2.2.0", + "version": "2.2.1", "from": "tough-cookie@>=0.12.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.0.tgz" + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" }, "form-data": { "version": "0.1.4", @@ -2999,9 +3000,9 @@ } }, "tilelive-mapnik": { - "version": "0.6.15", - "from": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.x-cdb1", - "resolved": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.x-cdb1", + "version": "0.6.15-cdb5", + "from": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", + "resolved": "https://github.com/CartoDB/tilelive-mapnik/tarball/0.6.15-cdb5", "dependencies": { "generic-pool": { "version": "2.1.1", @@ -3016,14 +3017,14 @@ } }, "tilelive-bridge": { - "version": "1.3.0", - "from": "https://github.com/CartoDB/tilelive-bridge/tarball/gzip-option", - "resolved": "https://github.com/CartoDB/tilelive-bridge/tarball/gzip-option", + "version": "1.3.0-cdb4", + "from": "https://github.com/CartoDB/tilelive-bridge/tarball/1.3.0-cdb4", + "resolved": "https://github.com/CartoDB/tilelive-bridge/tarball/1.3.0-cdb4", "dependencies": { "mapnik-pool": { - "version": "0.1.1", - "from": "https://github.com/CartoDB/mapnik-pool/tarball/cdb", - "resolved": "https://github.com/CartoDB/mapnik-pool/tarball/cdb", + "version": "0.1.1-cdb4", + "from": "https://github.com/CartoDB/mapnik-pool/tarball/0.1.1-cdb4", + "resolved": "https://github.com/CartoDB/mapnik-pool/tarball/0.1.1-cdb4", "dependencies": { "generic-pool": { "version": "2.1.1", @@ -3104,14 +3105,13 @@ } }, "torque.js": { - "version": "2.11.0", - "from": "torque.js@~2.11.0", - "resolved": "https://registry.npmjs.org/torque.js/-/torque.js-2.11.0.tgz" + "version": "2.11.4", + "from": "torque.js@~2.11.0" }, "abaculus": { - "version": "1.1.0", - "from": "https://github.com/CartoDB/abaculus/tarball/cdb", - "resolved": "https://github.com/CartoDB/abaculus/tarball/cdb" + "version": "1.1.0-cdb4", + "from": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4", + "resolved": "https://github.com/CartoDB/abaculus/tarball/1.1.0-cdb4" }, "sphericalmercator": { "version": "1.0.3", diff --git a/package.json b/package.json index e74669b4..27972e43 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "2.16.1", + "version": "2.19.2", "description": "A map tile server for CartoDB", "keywords": [ "cartodb" @@ -29,7 +29,7 @@ "node-statsd": "~0.0.7", "underscore" : "~1.6.0", "dot": "~1.0.2", - "windshaft": "~1.2.0", + "windshaft": "1.6.1", "step": "~0.0.6", "queue-async": "~1.0.7", "request": "~2.62.0", diff --git a/test/acceptance/ported/blend_http_fallback.js b/test/acceptance/ported/blend_http_fallback.js index 7d0d89c2..3c35c5fc 100644 --- a/test/acceptance/ported/blend_http_fallback.js +++ b/test/acceptance/ported/blend_http_fallback.js @@ -86,7 +86,7 @@ describe('blend http fallback', function() { }; var filteredLayersSuite = [ - ['all'], // layers displayed: 2 + 4, skipping 3 as it fails + //['all'], // layers displayed: 2 + 4, skipping 3 as it fails [0, 4], [0, 3], // skips layer 3 as it fails [1, 2], diff --git a/test/acceptance/templates.js b/test/acceptance/templates.js index d71ac01c..54fa70d8 100644 --- a/test/acceptance/templates.js +++ b/test/acceptance/templates.js @@ -1947,4 +1947,140 @@ describe('template_api', function() { }); + var torqueParamsScenarios = [ + { + templateParams: {}, + expectedTile: [{"x__uint8":125,"y__uint8":159,"vals__uint8":[2],"dates__uint16":[0]}] + }, + { + templateParams: { namesFilter: "'Hawai'" }, + expectedTile: [{"x__uint8":125,"y__uint8":159,"vals__uint8":[1],"dates__uint16":[0]}] + } + ]; + torqueParamsScenarios.forEach(function(scenario) { + it("can instantiate with torque layer and params=" + JSON.stringify(scenario.templateParams), function(done) { + + var torqueParamsTemplate = { + version: '0.0.1', + name: 'acceptance_torque_params', + auth: { + method: 'open' + }, + placeholders: { + namesFilter: { + "type": "sql_ident", + "default": "'Hawai', 'El Estocolmo'" + } + }, + layergroup: { + version: '1.4.0', + layers: [ + { + type: 'torque', + options: { + sql: "select * from test_table_private_1 where name in (<%= namesFilter %>)", + cartocss: "Map { -torque-frame-count:1; -torque-resolution:1; " + + "-torque-aggregation-function:'count(*)'; -torque-time-attribute:'cartodb_id'; }", + cartocss_version: '2.0.2' + } + } + ] + } + }; + + var layergroupIdToDelete; + step( + function createTemplate() { + var next = this; + var createTemplateRequest = { + url: '/api/v1/map/named?api_key=1234', + method: 'POST', + headers: { + host: 'localhost', + 'Content-Type': 'application/json' + }, + data: JSON.stringify(torqueParamsTemplate) + }; + assert.response( + server, + createTemplateRequest, + { + status: 200 + }, + function(res, err) { + next(err, res); + } + ); + }, + function instantiateTemplate(err, res) { + assert.ifError(err); + var parsed = JSON.parse(res.body); + assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response: " + res.body); + var templateId = parsed.template_id; + var instantiatePostRequest = { + url: '/api/v1/map/named/' + templateId, + method: 'POST', + headers: { + host: 'localhost', + 'Content-Type': 'application/json' + }, + data: JSON.stringify(scenario.templateParams) + }; + var next = this; + assert.response( + server, + instantiatePostRequest, + { + status: 200 + }, + function(res, err) { + return next(err, res); + } + ); + }, + function requestTile(err, res) { + assert.ifError(err); + + var layergroupId = JSON.parse(res.body).layergroupid; + layergroupIdToDelete = LayergroupToken.parse(layergroupId).token; + + var torqueTileRequest = { + url: '/api/v1/map/' + layergroupId + '/0/0/0/0.torque.json', + method: 'GET', + headers: { + host: 'localhost' + } + }; + var next = this; + assert.response( + server, + torqueTileRequest, + { + status: 200 + }, + function(res, err) { + return next(err, res); + } + ); + }, + function validateTileAndFinish(err, res) { + if (err) { + return done(err); + } + + keysToDelete['map_cfg|' + layergroupIdToDelete] = 0; + keysToDelete['map_tpl|localhost'] = 0; + keysToDelete['user:localhost:mapviews:global'] = 5; + + assert.deepEqual( + JSON.parse(res.body), + scenario.expectedTile + ); + + done(); + } + ); + }); + }); + });