cpsgroup / sarapis

A RESTful, proxied, read-only Solr interface
http://sarapis.herokuapp.com
MIT License
1 stars 2 forks source link

Solr-Backend Base-Path #14

Open MartinLichtblau opened 9 years ago

MartinLichtblau commented 9 years ago

The problem is that you can't connect to a solr server which has a different solr-path than "solr/select", e.g. "lucene-solr/select". So this path shouldn't be hardcoded. Such a solr-server can have mutliple cores. And the "Valid_Proxy_Path" argument defines specific paths which should be accessible - but wouldn't it be logical that this argument defines only sub-paths like /select /admin and not /solr/select, since the proxy can connect to only one server the base-path always stays the same!?

So a full address (URI) has this structure: 'host':'port'/'base-path'/'core'/'allowed-sub-paths' Example addres: 111.2.2.4:6565/mysolrserver/core1/select

P.S.:Beside that, why would someone allow other sub-paths than "/select" with the "Valid_Proxy_Path" argument, allowing "/admin" wouldn't be very wise. P.S.:Beside that, why would someone allow other sub-paths than "/select" with the "Valid_Proxy_Path" argument, allowing "/admin" wouldn't be very wise.

vyo commented 9 years ago

If someone wants to configure his proxy to be more lenient, who am I to dissuade him - I don't think we have to provide an opinionated solution here. Thanks for catching that path issue, though, much appreciated.

About connecting to only one server: I intend to allow connecting to multiple shards AND cores, i.e. effectively supporting multiple servers. For distributed instances this is a must. I have a few ideas for this, but for now I only want to ensure that our architecture makes extending in that direction as easy as possible. I'll update #2 to make it more clear-

vyo commented 9 years ago

@MartinLichtblau about that mocking business: Just found a way to easily(!) test that cli argument stuff - just set the arguments manually... E.g. in your test before requiring/rewiring sarapis.js:

process.argv.push('--solr-host'); process.argv.push('localhost');

and so on.

Duh... which of course means we can remove all those '//if (process.env.NODE_ENV != 'test') { ...}' guards and test it properly.

MartinLichtblau commented 9 years ago

Ohh yes, that's much better. Thanks for the hint!

On Thu, Jul 9, 2015 at 7:14 PM, Manuel Weidmann notifications@github.com wrote:

@MartinLichtblau https://github.com/MartinLichtblau about that mocking business: Just found a way to easily(!) test that cli argument stuff - just set the arguments manually... E.g. in your test before requiring/rewiring sarapis.js:

process.argv.push('--solr-host'); process.argv.push('localhost');

and so on.

Duh... which of course means we can remove all those '//if (process.env.NODE_ENV != 'test') { ...}' guards and test it properly.

— Reply to this email directly or view it on GitHub https://github.com/cpsgroup/sarapis/issues/14#issuecomment-120075251.