You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Patrick Aljord (JIRA)" <ji...@apache.org> on 2009/01/30 20:52:59 UTC

[jira] Created: (COUCHDB-230) Add Support for Rewritable URL

Add Support for Rewritable URL
------------------------------

                 Key: COUCHDB-230
                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
             Project: CouchDB
          Issue Type: New Feature
            Reporter: Patrick Aljord
             Fix For: 1.0


It would be good if couchdb would allow to rewrite urls so that instead of having to write that:

http://127.0.0.1:5984/blogdb/_design/sofa/account.html

I could just write:

http://127.0.0.1:5984/blogdb/account

It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.

Here are a few propositions from davisp:

<davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
<davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
<davisp> bobesponja: or perhaps, regex's -> erlang handler
<davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899421#action_12899421 ] 

Jan Lehnardt commented on COUCHDB-230:
--------------------------------------

I think pointing a vhost at a rewrite function gets you there today. I like the idea of 127.0.0.1:5984/ to always give you the raw CouchDB API.


> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900825#action_12900825 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

Ok, I'm starting to be annoyed now.  Can you for just explain what is the issue? Current implementation doesn't change anything to what is was in the past. 

Time to ask for the community I guess.

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>         Attachments: 0001-manage-aliases.patch
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900814#action_12900814 ] 

Chris Anderson commented on COUCHDB-230:
----------------------------------------

I'm am starting to get concerned about this feature (and the $foo pattern matching vhosts stuff as well) mostly because I'm not sure I understand all the implications of it.

In the past when features have been proposed that have been complex enough to not be easy to reason about, we've decided against them. I'm not saying that's what we need to do hear, but I think that until we are totally clear about what we are and aren't getting into with this stuff, we should proceed with caution.

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>         Attachments: 0001-manage-aliases.patch
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Noah Slater (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noah Slater updated COUCHDB-230:
--------------------------------

    Fix Version/s: 1.0.1
                       (was: 1.0)

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.1
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Randall Leeds (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12888454#action_12888454 ] 

Randall Leeds commented on COUCHDB-230:
---------------------------------------

Isn't this fixed?

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.1
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Noah Slater (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Noah Slater updated COUCHDB-230:
--------------------------------

    Fix Version/s: 1.0.2
                       (was: 1.0.1)

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899770#action_12899770 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

actually you could already do :

example.com/foobar = /foo/_design/bar/_rewrite
*.website.com/foobar = /foo/_design/bar/_rewrite
localhost:5984/bazbam = /whatever 

and :

$vhost.example.com = /$vhost

even

$app.$vhost.example.com /$vhost/_design/$app/_rewrite

for the path based reouting we could likely introduce that too, but it need some code rewrite to share code with rewriter. 

For local usage though I was thinking that not allowing /pathname but only /_root/pathname would have been better to not be in conflict with the current API.

[

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899449#action_12899449 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

vhosts can only work well with vhosts.Maybe it's overkill but I thought it would be interresting for users to have a shott access to apps rather than pointing them to /dbname/_design/somedesign/_rewrite or smth else.

Instead having smth like /_/somedesign would make things easier I think.



> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899954#action_12899954 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

the $ stuff is already in the code with the vhost refactoring. The only thing to add is this path stuff which is a little more complex btw. I will work on it this week, it will likely land  on friday.

- benoit

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899948#action_12899948 ] 

Chris Anderson commented on COUCHDB-230:
----------------------------------------

not worrying about stomping on database names (Eg by allowing admins to vhost */foo = /foo/_design/foo/_rewrite ) I think is OK.

I'm not sure about the $stuff, if only because that adds an entire new level of complexity to the implementation. one thing I like about the implementation now is how simple it is.

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12669005#action_12669005 ] 

Paul Joseph Davis commented on COUCHDB-230:
-------------------------------------------

There's been idle discussion about such a system on IRC and I figured that it seems like enough people are starting to have to deal with it that we should probably get some discussion going.

The general outline that I'd suggest would be to have the (one of many) standard methods using regex's to do transparent redirects (ie, the redirect is inside CouchDB not via response code).

Couple thoughts:
1. All redirects should be limited to the scope of a single database.
2. Redirects should be specified in _design documents.
3. Profit

The one specific argument against a URL rewrite mechanism I remember was from Chris on how this could cause major havoc for client libraries. I'd contend that the same could be said of all the path specifications in the config files. We're giving users a tool they can use, but they only have themselves to blame if they get into a pile of hurt.


> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Chesneau resolved COUCHDB-230.
-------------------------------------

      Assignee: Benoit Chesneau
    Resolution: Fixed

fixed in last trunk. 

it's now possible to do :

*/test = /somedb/_design/test/_rewrite

or 

example.com/test = /somedb/_design/test/_rewrite
*.example.com/test = /somedb/_design/test/_rewrite

...

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>            Assignee: Benoit Chesneau
>             Fix For: 1.0.2
>
>         Attachments: 0001-manage-aliases.patch
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899656#action_12899656 ] 

Chris Anderson commented on COUCHDB-230:
----------------------------------------

I was thinking we could just extend the current vhosts api so that:

[vhosts]
example.com/foobar = /foo/_design/bar/_rewrite

it would be up to the admin to avoid stomping on existing database names. I am more than happy to allow them to live with that risk.

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899394#action_12899394 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

I would like to develop this feature but I'm not sure we should be on / ?

My idee is to do /_root/some-location -> /rewrittent-location where _root is customizable via the ini.  

Thoughts ?


> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900448#action_12900448 ] 

Benoit Chesneau commented on COUCHDB-230:
-----------------------------------------

Following thread on ml

Imo Path alias shouln't be in vhosts but in its own section since this is not a vhost but more an "aliases" section is we follow the apache server wording. 3 questions anyway :

1) What happend anyway if a couchapp is self configuring but another app with same name already exist ?

2) What happend if path replace db path

3) security concern how to make sure a couchapp won't self configure even if the user is connected as admin ?

I think anyway for 2, that having it in /_root or /_/ would be better so api always available. Or at least, this prefix should be configurable (/ , /app or watever). 

> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-230) Add Support for Rewritable URL

Posted by "Benoit Chesneau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benoit Chesneau updated COUCHDB-230:
------------------------------------

    Attachment: 0001-manage-aliases.patch

Here is a patch that manage rewritting of location. So you could do :

/example = /etape-test-db

or /example/* = /etape-test-db/_design/example/*

Now it doesn't work well when vhosts rewrite url like the last test show:

Vhost rule :

example1.com = /testdb/_design/somedoc/_rewrite/

alias rule :
/example = /etape-test-db

Vhost first rewrite the path to /testdb/_design/somedoc/_rewrite/example 

This patch doesn't match aliases then it will be ignored. I can inverse the behaviour to match first aliases then vhosts but it sound weird. What do you think ?



> Add Support for Rewritable URL
> ------------------------------
>
>                 Key: COUCHDB-230
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-230
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Patrick Aljord
>             Fix For: 1.0.2
>
>         Attachments: 0001-manage-aliases.patch
>
>
> It would be good if couchdb would allow to rewrite urls so that instead of having to write that:
> http://127.0.0.1:5984/blogdb/_design/sofa/account.html
> I could just write:
> http://127.0.0.1:5984/blogdb/account
> It could be done with the web server but having the rewritten rules in the db would make it a bit easier for replication so we don't have to write the rules on each web server where a db gets replicated.
> Here are a few propositions from davisp:
> <davisp> alisdair: how so? rewriting urls should be in _design documents, since they're in _design docs they should be limited to per db namespaces
> <davisp> bobesponja: I don't know that anyone has looked at it seriously, but my first guess is that we'd just make a _design/doc "urls" member that's a list of regex's and targets as is fairly standard practice
> <davisp> bobesponja: or perhaps, regex's -> erlang handler
> <davisp> the second might not be as fun

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.