Ok, so I have a separate server with solr, and this is great for the application. Using regular sunspot.yml, we have something like:
production: solr: hostname: domain port: 8080 log_level: WARNING path: path/to/data
The problem is that I wanted to get permission for my tomcat application. It looks like as long as you know the domain and port, you can just go and visit solr / admin. So in my tomcat web.xml I added:
<security-constraint> <web-resource-collection> <web-resource-name> Solr authenticated application </web-resource-name> <url-pattern>/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> </web-resource-collection> <auth-constraint> <role-name>role</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>BASIC</auth-method> <realm-name>REALM</realm-name> </login-config> <security-role> <description>ROLE NAME</description> <role-name>role</role-name> </security-role>
This will require someone to visit the username and password of solr / admin before gaining access. The problem is, how can I say this in my rails application? After that, I get the expected "Unauthorized" response when my rails application tries to access the solr server. I know that it will probably go into the sunspot.yml file, but what do I need to add?
source share