From b71f0ea0d7389f01f2fed4d90a565a6cf5658eb9 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Wed, 8 Jul 2015 16:48:20 +0200 Subject: [PATCH] Switched to subdomainless urls. - Allow avatar to be uploaded to local fs. - Renamed star avatar - Allow uploads up to 100Mb file size --- README.md | 26 ++++++++++++-------------- config/app_config.yml | 13 +++++++------ config/cartodb.nginx.proxy.conf | 8 +++++--- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 837feca..0cc0f66 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ docker-cartodb That container provides a fully working cartodb development solution without the installation hassle. -Just run and connect to http://dev.cartodb.localhost:3000/login into you browser. +Just run and connect to http://cartodb.localhost into you browser. -The default login is dev/pass. You may want to change it when you'll run +The default login is dev/pass1234. You may want to change it when you'll run it for the outside. -It also creates an 'example' organization with owner login admin4example/pass. -Organization members can be created on http://example.cartodb.localhost:3000/u/admin4example/organization +It also creates an 'example' organization with owner login admin4example/pass1234. +Organization members can be created on http://cartodb.localhost/user/admin4example/organization How to build the container: --------------- +--------------------------- ``` git clone https://github.com/fleu42/docker-cartodb.git @@ -21,18 +21,16 @@ docker build -t="fleu42/docker-cartodb" docker-cartodb/ ``` How to run the container: --------------- +------------------------- ``` -docker run -t -i -p 3000:3000 -p 8080:8080 -p 8181:8181 fleu42/docker-cartodb +docker run -d -p 3000:3000 -p 8080:8080 -p 8181:8181 fleu42/docker-cartodb ``` -You need to add `config/cartodb.nginx.proxy.conf` to /etc/nginx/conf.d/. +You need to add `config/cartodb.nginx.proxy.conf` to /etc/nginx/conf.d/. This will setup a reverse proxy for the CartoDB/imports (3000), SQL Api (8080) and Map api (8181). -You need to add cartodb.localhost, dev.cartodb.localhost and example.cartodb.localhost to your hosts file. - -Visit http://dev.cartodb.localhost or http://example.cartodb.localhost - -Any organization member you create should also be added to your hosts file. - +You also need to add cartodb.localhost alias to your hosts file. For example +``` +sudo sh -c 'echo 127.0.1.1 cartodb.localhost >> /etc/hosts' +``` diff --git a/config/app_config.yml b/config/app_config.yml index fbfd35f..fda21e6 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -4,9 +4,9 @@ defaults: &defaults csv_guessing: false debug_assets: true mandatory_keys: [layer_opts, sql_api, varnish_management, redis, session_domain] - session_domain: '.cartodb.localhost' + session_domain: 'cartodb.localhost' # If activated, urls will use usernames in format //SESSION_DOMAIN/user/USERNAME and ignore subdomains if present - subdomainless_urls: false + subdomainless_urls: true http_port: # 3000 # nil|integer. HTTP port to use when building urls. Leave empty to use default (80) https_port: # nil|integer. HTTPS port to use when building urls. Leave empty to use default (443) secret_token: '71c2b25921b84a1cb21c71503ab8fb23' @@ -63,7 +63,7 @@ defaults: &defaults common_data: protocol: 'https' username: 'common-data' - host: 'cartodb.localhost' + host: 'cartodb.com' format: 'shp' generate_every: 86400 explore-api: @@ -184,13 +184,14 @@ defaults: &defaults access_key_id: "test" secret_access_key: "test" assets: - s3_bucket_name: "tests" + # store assets locally instead of s3 + # s3_bucket_name: "tests" max_file_size: 5242880 # 5.megabytes app_assets: asset_host: "//cartodb-libs.global.ssl.fastly.net/cartodbui" avatars: - base_url: '//cartodb-libs.global.ssl.fastly.net/cartodbui/assets/unversioned/images/avatars' - kinds: ['ghost', 'marker', 'mountain', 'pacman', 'planet', 'stars'] + base_url: 'cartodb-libs.global.ssl.fastly.net/cartodbui/assets/unversioned/images/avatars' + kinds: ['ghost', 'marker', 'mountain', 'pacman', 'planet', 'star'] colors: ['green', 'orange', 'red', 'yellow'] dropbox_api_key: "" gdrive: diff --git a/config/cartodb.nginx.proxy.conf b/config/cartodb.nginx.proxy.conf index 91bc813..8fb36fe 100644 --- a/config/cartodb.nginx.proxy.conf +++ b/config/cartodb.nginx.proxy.conf @@ -1,7 +1,9 @@ server { server_name cartodb.localhost *.cartodb.localhost; - location /api/v1/maps { + client_max_body_size 100M; + + location ^~ /(user/.*/)?api/v1/maps { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -9,7 +11,7 @@ server { proxy_pass http://127.0.0.1:3000; } - location /api/v1/map { + location ^~ /(user/.*/)?api/v1/map { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -17,7 +19,7 @@ server { proxy_pass http://127.0.0.1:8181; } - location /api/v2/sql { + location ^~ /(user/.*/)?/api/v2/sql { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;