You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2024/01/10 16:10:05 UTC

(solr) branch branch_9x updated: SOLR-16876: Remove extra /solr from calls that generates extra WARNING in logs (#1833)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 5d1c283bdfe SOLR-16876: Remove extra /solr from calls that generates extra WARNING in logs (#1833)
5d1c283bdfe is described below

commit 5d1c283bdfe43e42c4653970b0436629d3a40135
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Wed Jan 10 11:09:14 2024 -0500

    SOLR-16876: Remove extra /solr from calls that generates extra WARNING in logs (#1833)
    
    Adds a bats test of the full lifecycle of enabling/disabling auth.
---
 solr/bin/solr                                              |  2 +-
 solr/bin/solr.cmd                                          |  2 +-
 solr/packaging/test/test_auth.bats                         | 14 ++++++++++++++
 .../pages/solr-control-script-reference.adoc               |  2 +-
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/solr/bin/solr b/solr/bin/solr
index 278c6177924..664c0ce86da 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1657,7 +1657,7 @@ if [[ "$SCRIPT_CMD" == "auth" ]]; then
         fi
       done
   fi
-  run_tool auth "${AUTH_PARAMS[@]}" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}/solr" -authConfDir "$SOLR_HOME" $VERBOSE
+  run_tool auth "${AUTH_PARAMS[@]}" -solrUrl "$SOLR_URL_SCHEME://$SOLR_TOOL_HOST:${AUTH_PORT:-8983}" -authConfDir "$SOLR_HOME" $VERBOSE
   exit $?
 fi
 
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 3856862137a..1b043888b83 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -2070,7 +2070,7 @@ if "!AUTH_PORT!"=="" (
     -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^
     -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
     org.apache.solr.cli.SolrCLI auth %AUTH_PARAMS% -solrIncludeFile "%SOLR_INCLUDE%" -authConfDir "%SOLR_HOME%" ^
-    -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT!/solr
+    -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT!
 goto done
 
 
diff --git a/solr/packaging/test/test_auth.bats b/solr/packaging/test/test_auth.bats
index 99a6480a59f..0de3786c35e 100644
--- a/solr/packaging/test/test_auth.bats
+++ b/solr/packaging/test/test_auth.bats
@@ -34,3 +34,17 @@ setup() {
   run ! solr auth enable -type basicAuth -credentials any:any -updateIncludeFileOnly ture
   assert_output --partial "Argument [updateIncludeFileOnly] must be either true or false, but was [ture]"
 }
+
+@test "auth enable/disable lifecycle" {
+  solr start -c
+  solr auth enable -type basicAuth -credentials name:password
+  solr assert --started http://localhost:${SOLR_PORT}/solr --timeout 5000
+
+  run curl -u name:password --basic "http://localhost:${SOLR_PORT}/solr/admin/collections?action=CREATE&collection.configName=_default&name=test&numShards=2&replicationFactor=1&router.name=compositeId&wt=json"
+  assert_output --partial '"status":0'
+  
+  solr auth disable
+  run curl "http://localhost:${SOLR_PORT}/solr/test/select?q=*:*"
+  assert_output --partial '"numFound":0'
+  solr stop -all  
+}
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
index dc580c73590..d8fcb33b859 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
@@ -330,7 +330,7 @@ For example, if Solr is running on port 8983, then the embedded ZooKeeper will l
 [IMPORTANT]
 ====
 If your ZooKeeper connection string uses a chroot, such as `localhost:2181/solr`, then you need to create the /solr znode before launching SolrCloud using the `bin/solr` script.
-+
+
 To do this use the `mkroot` command outlined below, for example: `bin/solr zk mkroot /solr -z 192.168.1.4:2181`
 ====