Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always uses https for requesting tiles, even in development mode #48

Closed
tjwebb opened this issue Dec 6, 2012 · 18 comments
Closed

Always uses https for requesting tiles, even in development mode #48

tjwebb opened this issue Dec 6, 2012 · 18 comments

Comments

@tjwebb
Copy link

tjwebb commented Dec 6, 2012

CartoDB uses https when making requests to the Windshaft tile server, even though I have http set in my app_config.yml:

tile_protocol: 'http'

@tjwebb
Copy link
Author

tjwebb commented Dec 6, 2012

This problem is extremely infuriating. No matter what I do, I cannot make carto use http instead of https.

@tjwebb
Copy link
Author

tjwebb commented Dec 7, 2012

Can't figure it out. I resorted to a global s/https/http search-replace but that obviously broke just about everything. Help! I'd love to start work on Carto but this is a huge blocker right now... Thanks

@tjwebb
Copy link
Author

tjwebb commented Dec 7, 2012

Set up on CartoDB on another machine (Ubuntu 12.04 fresh install) and having the same issue. Does anyone have any ideas for a fix?

@jmwenda
Copy link

jmwenda commented Dec 7, 2012

i had to change some of the map.js functions to force them to use http

@tjwebb
Copy link
Author

tjwebb commented Dec 7, 2012

I tried messing in there as well but I always ended up breaking other things. Do you know specifically what you changed?

And I'm just as interested as to why the tile_protocol property as no effect. Seems like a bug.

@jmwenda
Copy link

jmwenda commented Dec 7, 2012

i know, it a pain in the ass, but i changed lib/assets/javascripts/cdb/src/geo/common.js and added
opts.tiler_protocol= "http"; after line55
https://github.com/CartoDB/cartodb.js/blob/develop/src/geo/common.js#L55 and also changed line 128 to return http

@tjwebb
Copy link
Author

tjwebb commented Dec 7, 2012

Ok thanks, I'll try that. Do you know where opts.tiler_protocol is set initially?

@tjwebb
Copy link
Author

tjwebb commented Dec 7, 2012

Ok I was able to make it work by hacking common.js. Thanks for the tip.

Now of course, I ran into another ignoring-my-configuration issue...

CartoDB/Windshaft-cartodb#60

@zqshen
Copy link

zqshen commented Dec 13, 2012

This also worked for me. Thanks!

@javisantana
Copy link
Contributor

we internally work with http for development is as easy as change the configuration in config/app_config.yml

@tjwebb
Copy link
Author

tjwebb commented Dec 17, 2012

Look at the other comments! Changing app_config does NOT work!

@javisantana
Copy link
Contributor

@tkwebb this is my app_config.yml, to develop I use a checkout of cartodb code without any modification (i've removed some keys). Once you have it in config folder, restart the app (the rails app and the importer) and create/import a new table

defaults: &defaults
  debug_assets: true
  mandatory_keys:     [layer_opts, tile_host, tile_port, sql_api_domain, sql_api_endpoint, sql_api_port, varnish_management, redis]
  session_domain:     '.localhost.lan'
  secret_token:       'XXXXXXXXXX'
  account_host:       'localhost:3000'
  account_path:       '/account'
  tile_protocol:      'http'
  tile_host:          'localhost.lan'
  tile_port:          '8181'
  sql_api_protocol:   'http'
  sql_api_domain:     'localhost.lan'
  sql_api_endpoint:   '/api/v1/sql'
  sql_api_port:       8080
  api_requests_service_url: ''
  developers_host:    'http://developers.localhost.lan:3000'

  varnish_management:
    critical: true
    host: '127.0.0.1'
    port: 6082
    purge_command: 'url.purge'
    retries: 5
    timeout: 5
  redis:
    host: '127.0.0.1'
    port: 6379
  superadmin:
    username: "superadmin"
    password: "asdasd"













  layer_opts:
    public_opts: ["type", "active", "query", "opacity", "auto_bound", 
                  "interactivity", "debug", "visible", "tiler_domain", 
                  "tiler_port", "tiler_protocol", "sql_domain", "sql_port", 
                  "sql_protocol", "extra_params", "cdn_url", "table_name", 
                  "user_name", "style_version"]
    default_tile_styles:
      point: "{\n  marker-fill: #FF6600;\n  marker-opacity: 0.9;\n  marker-width: 12;\n  marker-line-color: white;\n  marker-line-width: 3;\n  marker-line-opacity: 0.9;\n  marker-placement: point;\n  marker-type: ellipse;\n  marker-allow-overlap: true;\n}"
      geometry: "{\n // points\n [mapnik-geometry-type=1] {\n    marker-fill: #FF6600;\n    marker-opacity: 1;\n    marker-width: 16;\n    marker-line-color: white;\n    marker-line-width: 3;\n    marker-line-opacity: 0.9;\n    marker-placement: point;\n    marker-type: ellipse;marker-allow-overlap: true;\n  }\n\n //lines\n [mapnik-geometry-type=2] {\n    line-color:#FF6600; \n    line-width:1; \n    line-opacity: 0.7;\n  }\n\n //polygons\n [mapnik-geometry-type=3] {\n    polygon-fill:#FF6600;\n    polygon-opacity: 0.7;\n    line-opacity:1;\n    line-color: #FFFFFF;\n   }\n }"
      polygon: "{\n  polygon-fill:#FF6600;\n  polygon-opacity: 0.7;\n  line-opacity:1;\n  line-color: #FFFFFF;\n}"
      multipolygon: "{\n  polygon-fill:#FF6600;\n  polygon-opacity: 0.7;\n  line-opacity:1;\n  line-color: #FFFFFF;\n}"
      multilinestring: "{\n  line-color:#FF6600;\n  line-width:1;\n  line-opacity: 0.7;\n}"
    data:
      kind: "carto"
      options:
        query:              ""
        opacity:            0.99
        auto_bound:         false
        interactivity:      "cartodb_id"
        debug:              false
        visible:            true
        tiler_protocol:      'http'
        tiler_domain:          'localhost.lan'
        tiler_port:          '8181'
        sql_domain:         "localhost.lan"
        sql_port:           "8080"
        sql_protocol:       "http"
        extra_params:       { cache_policy: 'persist' }
        cdn_url:            ""
        tile_style_history: []
        style_version:      "2.1.1"
      infowindow:
        template_name:      "table/views/infowindow_light"
    background:
      kind: "background"
      options: { color: '#ffffff' }
    base:
      kind: "tiled"
      options:
        visible:      true
        type:         "Tiled"
        urlTemplate:  "http://a.tiles.mapbox.com/v3/mapbox.mapbox-streets/{z}/{x}/{y}.png"
        name:         'Streets (Mapbox)'
        className:    "mapbox_streets"
        attribution:  "Mapbox <a href='http://mapbox.com/about/maps' target='_blank'>Terms &amp; Feedback</a>"
    gmaps:
      kind: "gmapsbase"
      options:
        base_type: "roadmap"
        style: ""
  cartodb_com_hosted: true
  cartodb_central_domain_name: 'cartodb.com'
  aws:
    s3:
      access_key_id: "test"
      secret_access_key: "test"
  assets:
    s3_bucket_name: "tests"
    max_file_size: 10485760 # 10.megabytes

development:
  <<: *defaults
  varnish_management:
    critical: false
    host: '127.0.0.1'
    port: 6082
    purge_command: 'url.purge'
    retries: 5
    timeout: 5

test:
  <<: *defaults


@tjwebb
Copy link
Author

tjwebb commented Dec 17, 2012

I wouldn't have filed this bug if it were that easy. I've already tried that. Changing the setting it to http has no effect, thus my filing of this bug. Why doesn't it work for the other two posters in this thread either?

The only way to make it use http is to follow the instructions in this comment: #48 (comment)

@javisantana
Copy link
Contributor

have you tried exactly the steps i described?

be careful because there are two places where http should be set and also you need to restart and create new tables. If you change the config file but you try to open tables already imported that is NOT going to work.

And believe me, we do NOT do any hack in cartodb.js to develop and I do develop using http

@tjwebb
Copy link
Author

tjwebb commented Dec 17, 2012

Yes. I've also tried re-installing the entire database, clearing the cache,
clearing redis, and even clearing out my entire installation several times.
It does not work. For the third time: Look at the comments in this issue!
I'm not the only one with this problem. I'm glad it works for you, but it doesn't work for any of us.

On Mon, Dec 17, 2012 at 10:24 AM, javi santana notifications@github.comwrote:

have you tried exactly the steps i described?

be careful because there are two places where http should be set and also
you need to restart and create new tables. If you change the config file
but you try to open tables already imported that is NOT going to work.

And believe me, we do NOT do any hack in cartodb.js to develop and I do
develop using http


Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-11445767.

@javisantana
Copy link
Contributor

i already read the comments and the solution is there.

Do the following:

could you please paste me the json returned

this is what I get

{
total_entries: 2,
layers: [
{
options: {
style: null,
base_type: "roadmap"
},
kind: "gmapsbase",
infowindow: null,
id: 404,
order: 0
},
{
options: {
attribution: "CartoDB <a href='http://cartodb.com/attributions' target='_blank'>attribution</a>",
type: "CartoDB",
active: true,
query: null,
opacity: 0.99,
auto_bound: false,
interactivity: "cartodb_id",
interaction: true,
debug: false,
tiler_domain: "localhost.lan",
tiler_port: "8181",
tiler_protocol: "http",
sql_domain: "cartodb.com",
sql_port: "80",
sql_protocol: "http",
extra_params: {
cache_policy: "persist",
cache_buster: 1355741577109
},
cdn_url: "",
visible: true,
tile_style_history: [
....

@zqshen
Copy link

zqshen commented Jan 14, 2013

@javisantana I noticed that in the app_config.yml you not only have tiler_protocol in the top section, but also in the data section as:

data:
  kind: "carto"
  options:
    query:              ""
    opacity:            0.99
    auto_bound:         false
    interactivity:      "cartodb_id"
    debug:              false
    visible:            true
    tiler_protocol:      'http'
    tiler_domain:          'localhost.lan'
    tiler_port:          '8181'
    sql_domain:         "localhost.lan"
    sql_port:           "8080"
    sql_protocol:       "http"
    extra_params:       { cache_policy: 'persist' }
    cdn_url:            ""
    tile_style_history: []
    style_version:      "2.1.1"
  infowindow:
    template_name:      "table/views/infowindow_light"

How do these work together with the tiler_protocol in the default section? Should we change all of them? What about tiler_domain? It is "cartodb.com" in the original app_config.yml.

@javisantana
Copy link
Contributor

@zqshen you should change in all the places and all the variables you need to fit your system config (tiler_protocol, tiler_domain, tiler_port and sql variables if you need). The variables should be the same in the top section and in the data section

We are working to remove those duplicities

javisantana pushed a commit that referenced this issue Jun 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants