Following Bug 33563, if you enable Elasticsearch authentication using "userinfo" parameter in koha-conf (David's method in comment 3 of Bug 33563), about.pl page breaks and gives an internal server error.
Created attachment 162286 [details] [review] Bug 36134: Read complete Elasticsearch configuration in about.pl When enabling Elasticsearch authentication in Koha using userinfo parameter of Search::Elasticsearch, about.pl breaks and gives an internal server error. This patch reads the complete Elasticsearch configuration for about.pl including userinfo causing about.pl to recover. To test: 1. In Elasticsearch 7 settings, set "xpack.security.enabled: true" 2. Add <userinfo>elastic:password</userinfo> to KOHA_CONF elasticsearch settings 3. Restart plack and navigate to about.pl 4. Observe internal server error 5. Apply patch 6. Refresh about.pl 7. Observe it working again
Above patch should not change about.pl behavior for Kohas using Basic authentication or no authentication at all for Elasticsearch, but helps those using the "userinfo" setting.
Above patch should not change about.pl behavior for Kohas using Basic authentication within "server" setting or no authentication at all for Elasticsearch, but helps those using the "userinfo" setting.
The test plan needs some modifications for koha-testing-docker: 1. In the docker-compose.yml file, change xpack.security.enabled=false to xpack.security.enabled=true 2. In the docker-compose.yml file, add another environment variable for the "es" container like the following: ELASTIC_PASSWORD=awesomepassword You'll end up with a koha-conf.xml element like the following then: <userinfo>elastic:awesomepassword</userinfo>
Good catch, Lari. Thanks for taking the time to do this. QA tools look good too.
Created attachment 162287 [details] [review] Bug 36134: Read complete Elasticsearch configuration in about.pl When enabling Elasticsearch authentication in Koha using userinfo parameter of Search::Elasticsearch, about.pl breaks and gives an internal server error. This patch reads the complete Elasticsearch configuration for about.pl including userinfo causing about.pl to recover. To test: 1. In Elasticsearch 7 settings, set "xpack.security.enabled: true" 2. Add <userinfo>elastic:password</userinfo> to KOHA_CONF elasticsearch settings 3. Restart plack and navigate to about.pl 4. Observe internal server error 5. Apply patch 6. Refresh about.pl 7. Observe it working again Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 162366 [details] [review] Bug 36134: Read complete Elasticsearch configuration in about.pl When enabling Elasticsearch authentication in Koha using userinfo parameter of Search::Elasticsearch, about.pl breaks and gives an internal server error. This patch reads the complete Elasticsearch configuration for about.pl including userinfo causing about.pl to recover. To test: 1. In Elasticsearch 7 settings, set "xpack.security.enabled: true" 2. Add <userinfo>elastic:password</userinfo> to KOHA_CONF elasticsearch settings 3. Restart plack and navigate to about.pl 4. Observe internal server error 5. Apply patch 6. Refresh about.pl 7. Observe it working again Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.04
Backported to 23.05.x for upcoming 23.05.10