nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
https://apps.nextcloud.com/apps/fulltextsearch_elasticsearch
GNU Affero General Public License v3.0
81 stars 30 forks source link

NC 26 edition does not work with basi auth #256

Closed beertje44 closed 1 year ago

beertje44 commented 1 year ago

Seems that http(s)://username:password@host:port does not work with the latest elesticsearch php connector. Line 384/385 of fulltextsearch_elasticsearch/lib/Platform/ElasticSearchPlatform.php should read:

$cb = ClientBuilder::create() ->setHosts($hosts) ->setBasicAuthentication($username, $password) ->setRetries(3);

Guess you could extract that from the hostname, but since you can provide several hosts, I guess it would be better and easier to add an optional username and password field to the config form? :)

baltaner commented 1 year ago

Thanks a lot - its working now! Same problem here with nc26 and es7.17.10 and readonlyrest-1.48.0_es7.17.10 But in your fix I habe to hardcode username/password - $username/$password doesn't work for me.

beertje44 commented 1 year ago

Yeah this is just some ducktape ;)

We'll have to wait for the maintainber to respond for a decent fix.

depthwise commented 1 year ago

+1 - hardcoded the credentials for now in my instance, and indexing works now.

R0Wi commented 1 year ago

PR is here https://github.com/nextcloud/fulltextsearch_elasticsearch/pull/261