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

Url rewrites #1693

Closed
Kartones opened this issue Jan 9, 2015 · 12 comments · Fixed by #1933
Closed

Url rewrites #1693

Kartones opened this issue Jan 9, 2015 · 12 comments · Fixed by #1933
Assignees
Milestone

Comments

@Kartones
Copy link
Contributor

Kartones commented Jan 9, 2015

Implement the option of not relying on usernames being always present at subdomains xxxxx.mydomain.ext/blablabla. They would appear always at mydomain.ext/u/xxxxx/blablabla.

This must be config-controlled, by default not active and totally optional, but code like Cartodb.extract_subdomain calls need to be rewritten to support it.

Multiuser URLs code will probably benefit from some cleaning due to this changes.

Code also allows to setup a different base port for urls generated (http_port config entry, can be left empty).

Notes:

  • As discussed, organizations don't work if the subdomains_allowed flag is set to false.
  • Changing code inside Cartodb.extract_subdomain and Cartodb.base_url fixed many scenarios and in general makes everything work (and Warden needs no changes), but there might be some issues if somewhere a url is handcrafted instead of using those.
  • Full review of routes.rb has been done, but /superadmin calls haven't been tested.
  • Definetly the editor needs clientside changes for some urls built there. See the internal wiki page for more details of issues found.
  • How to activate domain-less: at app_config.yml, set:
  session_domain:     'localhost.lan'
  subdomains_allowed: false

Note that session domain looks the same but doesn't begins with a '.'

@Kartones Kartones self-assigned this Jan 9, 2015
@Kartones Kartones added this to the Matalascañas milestone Jan 9, 2015
Kartones pushed a commit that referenced this issue Jan 22, 2015
Kartones pushed a commit that referenced this issue Jan 22, 2015
Kartones pushed a commit that referenced this issue Jan 23, 2015
Kartones pushed a commit that referenced this issue Jan 23, 2015
@javisantana
Copy link
Contributor

As discussed, organizations don't work if the subdomains_allowed flag is set to false.

that means a organization user will not work or organization urls will not work (but the user still does) ?

@javisantana javisantana modified the milestones: Castrourdiales, Guarrate Feb 6, 2015
Kartones pushed a commit that referenced this issue Mar 31, 2015
Kartones pushed a commit that referenced this issue Mar 31, 2015
Kartones pushed a commit that referenced this issue Mar 31, 2015
@Kartones Kartones modified the milestones: Guarroman, Baeza Apr 6, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
Kartones pushed a commit that referenced this issue Apr 7, 2015
@freakabcd
Copy link

I was eagerly awaiting the merge of issue-1693 into master; but I am not entirely sure if this issue has been fixed.

I just tried once more to deploy cartodb in an ubuntu 14.04 VM running on my workstation. This process is shown here https://gist.github.com/freakabcd/fd73119869ba57e16751

  • Accessing http://mymaps.lan:3000 from the VirtualBox host immediately redirects to http://mymaps.lan:3000/user//maps and shows the 404 page which links back to mymaps.lan:3000 via the 'Back to the Homepage' button.
  • Accessing http://mymaps.lan:3000/user/subdomain shows the user page which says there are 0 datasets and 0 visualisations. Every link on this page except for the "userpage / 0 datasets / 0 visualisations" points to cartodb.com, so one cannot even log in :-(

Perhaps, I have simply misconfigured everything! Please add more information to the subdomainless wiki page or perhaps a new wiki page on how to setup cartodb in a VM on local_machine / cloud.

@Kartones
Copy link
Contributor Author

Kartones commented Apr 9, 2015

Hi @freakabcd

Have you setup the subdomainless_url config attribute to "true", http_port to 3000 and session_domain to mymaps.lan?

It might be just that, a misconfiguration issue. Check also the small documentation wiki page and let me know if the issues persist.

@freakabcd
Copy link

As you can see from the setup gist, I am setting subdomainless_urls to true and session_domain to "mymaps.lan". I was not setting http_port to 3000 and noticed you added a commit to default it to 3000. I still have the exact same 2 issues outlined before

Here is my app_config.yml I've changed all instances of localhost.lan to mymaps.lan as an additional measure.
My database.yml is identical to the sample in the repo. The config/environments/development.js files in Windshaft-cartodb and CartoDB-SQL-API are simply copies of the provided config/environments/development.js.example files

cartodb instance in VM
The green links are local. The red ones are all pointing back to cartodb.com, so I cannot login and add tables/visualisations. I'm not 100% convinced that this is a configuration-only issue.

@javisantana
Copy link
Contributor

@freakabcd yes, that's a know issue. We accept pull requests :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants