Gets rid of these warnings:

WARNING: solrconfig.xml uses deprecated <admin/gettableFiles>, Please update your config to use the ShowFileRequestHandler.
WARNING: adding ShowFileRequestHandler with hidden files: [ADMIN-EXTRA.HTML, SCRIPTS.CONF, XSLT]

Background:
http://lucene.apache.org/solr/api/org/apache/solr/handler/admin/ShowFile...
https://issues.apache.org/jira/secure/attachment/12387863/SOLR-493-OldAd...

Comments

pwolanin’s picture

Well, I actually liked better the explicit listing of allowed files, since there could be various unexpected conf files, backups, etc that should not be exposed, which is why I stayed with the (deprecated) handler.

jpmckinney’s picture

Component: Code » solrconfig.xml

True, though deprecation isn't good long term. We can keep this here for now, and hope Solr allows whitelisting instead of only blacklisting.

jpmckinney’s picture

Status: Needs review » Postponed
jpmckinney’s picture

Status: Postponed » Active

See #799970: update README.txt and other docs w.r.t. required conf files.. Using gettableFiles can lead to frustration when setting up Solr.

pwolanin’s picture

Status: Active » Needs work

So, this doesn't seem to work to block a request to

http://localhost:8983/solr/admin/file/?file=xslt/luke.xsl

However, the xsl files are not listed in the admin interface.

jpmckinney’s picture

I was optimistic that Solr allowed blocking of directories, but it seems it requires the listing of each file explicitly.

pwolanin’s picture

The xsl files are not sensitive, I was mostly trying to avoid confusion in the UI by listing stuff a typical admin would not need to see.

So, if the files are not listed, maybe it doesn't matter.

jpmckinney’s picture

Status: Needs work » Needs review
StatusFileSize
new1.19 KB

New patch in any case to block requests to xslt files.

nick_vh’s picture

Status: Needs review » Needs work

I guess this update does require a notice so that the drupal administrator knows that solrconfig.xml has changed? Can we somehow see if the version is different and notify them?

jpmckinney’s picture

Since when do we notify administrators that the xml files have changed? The patch just needs to be re-rolled to change the version at the top of the file.

nick_vh’s picture

Status: Needs work » Needs review

Alright, didn't know the history or impact of these changes.
Marking as needs review

nick_vh’s picture

Status: Needs review » Needs work

I was testing this patch and found out that apachesolr_config_files_overview doesn't work with solr 3.4
Have to test if it is the same behavior with solr 1.4 but I expect not.

In solr 3.4 the files table or response is being answered as an json_encoded string.

nick_vh’s picture

So indeed

Solr 1.4 :
<?xml version="1.0" encoding="UTF-8"?> 01913102010-06-17T17:07:48Z31142010-06-17T17:07:48Z1872011-11-14T11:29:27Z267552011-11-14T11:29:27Z306852011-11-14T11:29:27Z12292010-06-17T17:07:48Z11632010-06-17T17:07:48Z

Solr 3.4:
{"responseHeader":{"status":0,"QTime":25},"files":{"elevate.xml":{"size":1274,"modified":"2011-09-07T17:11:33Z"},"mapping-ISOLatin1Accent.txt":{"size":2868,"modified":"2011-09-07T17:11:33Z"},"protwords.txt":{"size":187,"modified":"2011-10-01T03:19:17Z"},"schema.xml":{"size":28104,"modified":"2011-10-01T03:19:17Z"},"solrconfig.xml":{"size":30703,"modified":"2011-10-27T14:04:22Z"},"stopwords.txt":{"size":781,"modified":"2011-09-07T17:11:33Z"},"synonyms.txt":{"size":1133,"modified":"2011-09-07T17:11:33Z"}}}

nick_vh’s picture

And in a followup

To know if we are running solr 1.4 or 3.4 we need to include the following handler

Then we can retrieve the following info :

<lst name="lucene">
<str name="solr-spec-version">3.4.0.2011.09.09.09.06.17</str>
<str name="solr-impl-version">3.4.0 1167142 - mike - 2011-09-09 09:06:17</str>
<str name="lucene-spec-version">3.4.0</str>
<str name="lucene-impl-version">3.4.0 1167142 - mike - 2011-09-09 09:02:09</str>
</lst>

Will make a proof of concept code

nick_vh’s picture

StatusFileSize
new15.12 KB

This patch supports multiple versions of solr (1.4 and 3.4)

  • Adds admin/system handler
  • Checks if the lucene version is higher or lower then 3
  • Includes the patch from earlier in this issue
  • Depending on the version of Solr it will parse the resultset differently
  • Removes some spacing problems in solrconfig.xml
nick_vh’s picture

Status: Needs work » Needs review
nick_vh’s picture

StatusFileSize
new6.73 KB

Clean patch that does not take those whitespaces into account

nick_vh’s picture

StatusFileSize
new6.66 KB

One more fix

nick_vh’s picture

StatusFileSize
new7.21 KB

And using a table, much prettier and less clunky :)

nick_vh’s picture

StatusFileSize
new7.21 KB

Changed the error text if there are no files found

pwolanin’s picture

need wt=xml in the servlet request

nick_vh’s picture

StatusFileSize
new4.44 KB

This patch should be much better.
Still formats it in a table and does a better job checking if the value of the xml is the expected value. Directories are not listed.

nick_vh’s picture

StatusFileSize
new4.31 KB

Smaller and leaner

nick_vh’s picture

Status: Needs review » Fixed

Tested extensively on both Apache Solr 1.4 and 3.4
Committed

Thanks!

pwolanin’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Would seem like the wt=xml part at least needs to be backported to 6.x?

nick_vh’s picture

StatusFileSize
new501 bytes

This might do it for d6

pwolanin’s picture

Yes, let's test it, but I think that's all that's required.

nick_vh’s picture

nick_vh’s picture

Status: Patch (to be ported) » Fixed

And committed for 6.x also

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.