couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amos Hayes <aha...@gcrc.carleton.ca>
Subject Re: Reverse proxy design?
Date Thu, 12 Mar 2009 15:13:50 GMT

Thanks Vicente.

Yesterday, I did go through changing URL strings starting with "/ 
something" to "../something" in all the client files and was able to  
get futon working. Then I started work on the tests and got a bunch of  
them running through similar tricks, but there were still a number  
failing, as there are with proxying at root.

Then I went and proxied back to "/" instead of "/couchdb" to test what  
I had done and futon wasn't happy. At that point I lost patience and  
went home.

To be perfectly honest, the number of hard-coded paths and path  
prefixes scattered around the client code is really off-putting. Even  
after spending an afternoon hunting down variations of what amounts to  
"/", and putting code in to do regex on window.location.pathname to  
complement CouchDB.host, I still had failing tests and, being new to  
all this, no idea of where to go next.

It seems to me that having one spot where you figure out the host and  
path prefix and build all the paths everything else needs like "http://example.com/my/couch/db/_all_dbs

" would do wonders for making the couchdb package more flexible and  
happy as a piece of web infrastructure.

For those of you that are using couchdb with a site that isn't hosted  
from within it, how do you do it now? How do you get couchdb to live  
under the same domain:port as your website, while still being able to  
administer and run tests? Do you proxy couchdb and then use ssh port  
forwarding and test/administer against localhost:5984? That's the only  
way I can see both sides of the couch being happy.

Anyway, I really like the ideas you have come up for a web database,  
I'm just frustrated. If I work up the nerve again, I will have another  
look and see if I can't get it so my changes don't break installs that  
*are* at "/". Then I will humbly send in my patches and hope that  
someone else can run with getting the remaining tests to be happy.

--
Amos Hayes
Geomatics and Cartographic Research Centre
Carleton University
ahayes@gcrc.carleton.ca
+1.613.520.2600x8179

On 12-Mar-09, at 9:07 AM, Vicente Jiménez wrote:

> Sorry I wanted to meant _all_dbs.
> Reference to  ../../_all_dbs instead of /_all_dbs for example.
>
> On Thu, Mar 12, 2009 at 2:04 PM, Vicente Jiménez <googuy@gmail.com>  
> wrote:
>> I think you just must change all futon interface url from absolute to
>> relative. Using event many .. references like ../../_all_docs.
>>
>> On Wed, Mar 11, 2009 at 7:11 PM, Chris Anderson <jchris@apache.org>  
>> wrote:
>>> On Wed, Mar 11, 2009 at 10:57 AM, Amos Hayes <ahayes@gcrc.carleton.ca 
>>> > wrote:
>>>>
>>>> OK. Thanks Chris. When you say that almost all tests passed when  
>>>> proxied to
>>>> a different domain (still on /), do you think there is something  
>>>> wrong with
>>>> how couchdb is operating or is it just that the tests are broken  
>>>> in that
>>>> environment? I assume the later if you are talking about test- 
>>>> suite tests.
>>>>
>>>
>>> just some little test runner bugs related to the port it's running  
>>> on
>>> (and the fact that I redirect '/' elsewhere)
>>>
>>> Yes, you should be able to patch this without touching couchdb  
>>> (just JS)
>>>
>>> --
>>> Chris Anderson
>>> http://jchris.mfdz.com
>>>
>>


Mime
View raw message