[ 
https://issues.apache.org/jira/browse/SOLR-9725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15655406#comment-15655406
 ] 

Jamie Jackson edited comment on SOLR-9725 at 11/10/16 10:44 PM:
----------------------------------------------------------------

I barely know what I'm doing here, but it's a combination of 
[this|https://github.com/apache/lucene-solr/pull/46] and 
[this|https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=blobdiff;f=solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java;h=3b1568f4892661fa52ad9b50f8667f1f8c11b060;hp=08a936ae48c510838dce86c404fd9e569d2f2d39;hb=c2aea1b;hpb=59b4fc0bb0105ec25285f763fde86739433a38b1].
 

Notes:
* I haven't actually tested it in situ (variables actually in a DIH config 
file, running a core), since I don't have time today to figure out building and 
configuring. 
* It targets {{branch_5_5}}, so I'm not sure the best way to get it up to 
master. Separate pull request?
* {{testRetrieveFromJndiWithCredentialsEncryptedAndResolved()}} replaces 
{{testRetrieveFromJndiWithCredentialsWithEncryptedPwd()}}, as I didn't think 
the old name made as much sense anymore.
* Master has 
{{testRetrieveFromJndiWithCredentialsWithEncryptedAndResolvedPwd()}} (note the 
trailing {{pwd}}). IMO, my new test will replace this one.


was (Author: jamiejackson):
I barely know what I'm doing here, but it's a combination of 
[this|https://github.com/apache/lucene-solr/pull/46] and 
[this|https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;a=blobdiff;f=solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java;h=3b1568f4892661fa52ad9b50f8667f1f8c11b060;hp=08a936ae48c510838dce86c404fd9e569d2f2d39;hb=c2aea1b;hpb=59b4fc0bb0105ec25285f763fde86739433a38b1].
 

Notes:
* I haven't actually tested it in situ (variables actually in a DIH config 
file, running a core), since I don't have time today to figure out building and 
configuring. 
* It targets {{branch_5_5}}, so I'm not sure the best way to get it up to 
master. Separate pull request?
* {{testRetrieveFromJndiWithCredentialsEncryptedAndResolved()}} replaces 
{{testRetrieveFromJndiWithCredentialsWithEncryptedPwd()}}, as I didn't think 
the old name made as much sense anymore.

> Allow Variables for All Data Import Handler Data Source Configuration Values
> ----------------------------------------------------------------------------
>
>                 Key: SOLR-9725
>                 URL: https://issues.apache.org/jira/browse/SOLR-9725
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - DataImportHandler
>    Affects Versions: 5.5.3
>            Reporter: Jamie Jackson
>            Priority: Minor
>              Labels: patch
>
> I need to be able to use a variable for a password when also using 
> {{encryptKeyFile}}.
> For instance:
> {code:xml}
>       <dataSource
>               driver="${custom.dataimporter.datasource.driver}"
>               url="${custom.dataimporter.datasource.url}"
>               user="${custom.dataimporter.datasource.user}"
>               password="${custom.dataimporter.datasource.password}"
>               encryptKeyFile="/opt/solr/credentials/encrypt.key"
>       />
> {code}
> Because I need to change certain variables based on the environment. I'd 
> start like this:
> {code}
>      -a
>       -Dcustom.dataimporter.datasource.driver=org.mariadb.jdbc.Driver
>       
> -Dcustom.dataimporter.datasource.url=jdbc:mysql://local.mysite.com:3306/mysite
>       -Dcustom.dataimporter.datasource.user=root
>       
> -Dcustom.dataimporter.datasource.password=U2FsdGVkX1/dqwTb8RBfFq82SM37DkDRGeWMOndftHY=
> {code}
> If I hardcode the password, it works; if I use a variable reference, it 
> doesn't.
> As far as I know [this pull 
> request|https://github.com/apache/lucene-solr/pull/46] was submitted to 
> address this issue, but it didn't come with a Jira ticket or a full 
> explanation.
> Also, note that I'm not using a variable for the value of {{encryptKeyFile}}, 
> because [it's not possible in 5.x, though it seems to be fixed in 
> 6.1|https://issues.apache.org/jira/browse/SOLR-8610]. Presumably, the above 
> patch would encompass {{encryptKeyFile}}'s value, as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to