You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/04/30 21:58:10 UTC

[GitHub] [lucene-solr] MarcusSorealheis opened a new pull request #1471: Revised SOLR-14014 PR Against Master

MarcusSorealheis opened a new pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471


   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   I added a system property to allow users to disable the Solr Admin UI on start.
   
   # Solution
   
   I added this property, which accepts a boolean value, to SOLR_START_OPTS and START_OPTS.
   
   # Tests
   
   Not easily testable in the current project.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ ] I have developed this patch against the `master` branch.
   - [ ] I have run `ant precommit` and the appropriate test suite.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis edited a comment on pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis edited a comment on pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#issuecomment-622290677


   Here, I take UI instance that was previously started when ADMIN UI was enabled, disabled the admin ui via system property, and then show the result. The first page change possible is because it's a single page app and I didn't reload the page (but you can see system property): 
   
   ![disabled-gif](https://user-images.githubusercontent.com/2353608/80791537-ce19f280-8b46-11ea-834b-e5bf59f6be80.gif)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418671239



##########
File path: solr/bin/solr
##########
@@ -2097,6 +2097,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it
+if [ "$SOLR_ADMIN_UI_DISABLED" == "true" ]; then
+  SOLR_ADMIN_UI="-DdisableAdminUI=true"
+  echo -e "ADMIN UI Disabled"
+else
+  SOLR_ADMIN_UI="-DdisableAdminUI=false"

Review comment:
       https://github.com/apache/lucene-solr/pull/1471/commits/dedcdfe8b9af18d1a4662937be96b4d710963826 @madrob 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r419210970



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default is false
+  private static final boolean disabled = Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse _response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+
+    if(disabled){

Review comment:
       Handling the raw response works better. Looking at the snippet on this page originally I didn't have the full context. Good suggestion. Thanks 👍 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#issuecomment-622140309


   @madrob and @gerlowskija I made a new PR and merged master, but it looks like another typo fix on my local made it in there, which is fine because it should be there. It is not totally relevant so it is not a pure PR, but it is one character added in docs so should be fine.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#issuecomment-622290677


   Here, I take UI instance that was previously started when ADMIN UI was enabled, disabled the admin ui via system property, and then show the result. THe first change is because it's a single page app and I didn't reload the page: 
   
   ![disabled-gif](https://user-images.githubusercontent.com/2353608/80791537-ce19f280-8b46-11ea-834b-e5bf59f6be80.gif)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418689669



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default is false
+  private static final boolean disabled = Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse _response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+
+    if(disabled){

Review comment:
       Not in its current state because response object won't exist, but I could refactor if you have a good reason for that. Or, if I think of one. Gonna peep those methods again now.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418779981



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default is false
+  private static final boolean disabled = Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse _response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+
+    if(disabled){

Review comment:
       I'm testing it now.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on pull request #1471: SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#issuecomment-623629267


   > Here, I take UI instance that was previously started when ADMIN UI was enabled, disabled the admin ui via system property, and then show the result. The first page change possible is because it's a single page app and I didn't reload the page (but you can see system property):
   > 
   > ![disabled-gif](https://user-images.githubusercontent.com/2353608/80791537-ce19f280-8b46-11ea-834b-e5bf59f6be80.gif)
   
   This image doesn't apply anymore as you need to set the environment variable at startup and not use the Java Prop directly. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418779755



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default is false
+  private static final boolean disabled = Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse _response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+
+    if(disabled){

Review comment:
       So, I got pulled away by some work. I'll update. I think it makes sense to drop the response before the close shield if possible. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418629568



##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -15,6 +15,13 @@
  * limitations under the License.
  */
 package org.apache.solr.servlet;
+import javax.servlet.http.HttpServletRequest;

Review comment:
       Yes. I did that because the precommit failed before locally. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418677843



##########
File path: solr/bin/solr.cmd
##########
@@ -1288,6 +1295,7 @@ REM '-OmitStackTraceInFastThrow' ensures stack traces in errors,
 REM users who don't care about useful error msgs can override in SOLR_OPTS with +OmitStackTraceInFastThrow
 set "START_OPTS=%START_OPTS% -XX:-OmitStackTraceInFastThrow"
 set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
+set START_OPTS=-DdisableAdminUI=%DISABLE_ADMIN_UI%

Review comment:
       I believe this one is fixed as well @madrob 
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418630121



##########
File path: solr/bin/solr
##########
@@ -2097,6 +2097,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it
+if [ "$SOLR_ADMIN_UI_DISABLED" == "true" ]; then
+  SOLR_ADMIN_UI="-DdisableAdminUI=true"
+  echo -e "ADMIN UI Disabled"
+else
+  SOLR_ADMIN_UI="-DdisableAdminUI=false"

Review comment:
       You have to explicitly pass it, or you can pass the system property




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418646100



##########
File path: solr/bin/solr
##########
@@ -2097,6 +2097,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it
+if [ "$SOLR_ADMIN_UI_DISABLED" == "true" ]; then
+  SOLR_ADMIN_UI="-DdisableAdminUI=true"
+  echo -e "ADMIN UI Disabled"
+else
+  SOLR_ADMIN_UI="-DdisableAdminUI=false"

Review comment:
       Yes, that was an error on my part. I forgot to carry that over from the previous PR. I've added it. See line 2219




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418644915



##########
File path: solr/bin/solr
##########
@@ -2097,6 +2097,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it
+if [ "$SOLR_ADMIN_UI_DISABLED" == "true" ]; then
+  SOLR_ADMIN_UI="-DdisableAdminUI=true"
+  echo -e "ADMIN UI Disabled"
+else
+  SOLR_ADMIN_UI="-DdisableAdminUI=false"

Review comment:
       So if I set `SOLR_ADMIN_UI_DISABLED=true` in my `solr.in.sh`, then it sets `SOLR_ADMIN_UI="-DdisableAdminUI=true"` here, and then... does nothing? Because the `SOLR_ADMIN_UI` variable is never read. What am I missing?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] MarcusSorealheis commented on pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#issuecomment-623017503


   > It would be nice to make the Admin UI Disabled page a little bit prettier if possible, something more akin to the login page, but that might be out of scope of this PR. Feel free to defer that to a follow on if you think it's better to handle separately.
   
   Subsequent PR please


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] madrob commented on a change in pull request #1471: Revised SOLR-14014 PR Against Master

Posted by GitBox <gi...@apache.org>.
madrob commented on a change in pull request #1471:
URL: https://github.com/apache/lucene-solr/pull/1471#discussion_r418622731



##########
File path: solr/bin/solr.cmd
##########
@@ -1288,6 +1295,7 @@ REM '-OmitStackTraceInFastThrow' ensures stack traces in errors,
 REM users who don't care about useful error msgs can override in SOLR_OPTS with +OmitStackTraceInFastThrow
 set "START_OPTS=%START_OPTS% -XX:-OmitStackTraceInFastThrow"
 set START_OPTS=%START_OPTS% !GC_TUNE! %GC_LOG_OPTS%
+set START_OPTS=-DdisableAdminUI=%DISABLE_ADMIN_UI%

Review comment:
       This clobbers the previous START_OPTS

##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -15,6 +15,13 @@
  * limitations under the License.
  */
 package org.apache.solr.servlet;
+import javax.servlet.http.HttpServletRequest;

Review comment:
       nit: did you mean to move these imports around?

##########
File path: solr/bin/solr
##########
@@ -2097,6 +2097,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it
+if [ "$SOLR_ADMIN_UI_DISABLED" == "true" ]; then
+  SOLR_ADMIN_UI="-DdisableAdminUI=true"
+  echo -e "ADMIN UI Disabled"
+else
+  SOLR_ADMIN_UI="-DdisableAdminUI=false"

Review comment:
       It doesn't look like this property is ever passed to the run command?

##########
File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
##########
@@ -24,29 +31,26 @@
 import org.apache.solr.core.CoreContainer;
 import org.apache.solr.core.SolrCore;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-
 /**
  * A simple servlet to load the Solr Admin UI
  * 
  * @since solr 4.0
  */
 public final class LoadAdminUiServlet extends BaseSolrServlet {
 
+  // check system properties for whether or not admin UI is disabled, default is false
+  private static final boolean disabled = Boolean.parseBoolean(System.getProperty("disableAdminUI", "false"));
+
   @Override
-  public void doGet(HttpServletRequest _request,
-                    HttpServletResponse _response)
-      throws IOException {
+  public void doGet(HttpServletRequest _request, HttpServletResponse _response) throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+
+    if(disabled){

Review comment:
       Would this make sense to do before the close shield methods?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org