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/03/30 23:45:48 UTC

[GitHub] [lucene-solr] MarcusSorealheis opened a new pull request #1391: SOLR-14014 Add a disable Admin UI Flag

MarcusSorealheis opened a new pull request #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391
 
 
   <!--
   _(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/browse/SOLR-14014
   
   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 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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#discussion_r400839031
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/servlet/LoadAdminUiServlet.java
 ##########
 @@ -33,20 +34,34 @@
 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 enabled, default is true
+  private static final boolean enabled = Boolean.parseBoolean(System.getProperty("enableAdminUI", "true"));
+
+  public void init() throws ServletException {
+    super.init();
+  }
+
   @Override
   public void doGet(HttpServletRequest _request,
                     HttpServletResponse _response)
       throws IOException {
     HttpServletRequest request = SolrDispatchFilter.closeShield(_request, false);
     HttpServletResponse response = SolrDispatchFilter.closeShield(_response, false);
-    
+      if(!enabled){
+      response.sendError(404, "Solr Admin UI is disabled. To enable it, change the default value of SOLR_ADMIN_UI_" +
 
 Review comment:
   [0] Interesting, I didn't know this existed.  I would've made the Java-side change somewhere else, like HttpSolrCall.  But I like this better at first glance, good digging.
   
   I'll review this file in more detail and then maybe follow up here if anything looks off.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#discussion_r400834539
 
 

 ##########
 File path: solr/CHANGES.txt
 ##########
 @@ -8,6 +8,13 @@ https://github.com/apache/lucene-solr/blob/master/solr/solr-ref-guide/src/solr-u
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
 
+Improvements
+---------------------
+
+* SOLR-14014: Introducing a system property that allows users to disabled the Admin UI, which is enabled by default.
 
 Review comment:
   [+1] Thanks for including CHANGES text!  David made a point recently about ensuring this gets included in PRs, but I still personally always forget.
   
   [-0] Typo here: "disabled" -> "disable"
   
   [0] This blurb should probably mention the name of the system property, so users can add it easily if they want to.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#discussion_r400837339
 
 

 ##########
 File path: solr/bin/solr
 ##########
 @@ -2089,6 +2089,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it when.
 
 Review comment:
   [-1] The way I read this, the Admin UI will be disabled whenever SOLR_ADMIN_UI_ENABLED is empty, unset, etc.  And I don't see that value set anywhere, except in commented-out lines in solr.in.sh/solr.in.cmd.
   
   So by default the Admin UI is disabled, which doesn't seem like your intention?  Or am I missing something?

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on issue #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#issuecomment-609394891
 
 
   @gerlowskija I believe all the changes here are made

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on a change in pull request #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#discussion_r401246229
 
 

 ##########
 File path: solr/bin/solr
 ##########
 @@ -2089,6 +2089,14 @@ else
   SECURITY_MANAGER_OPTS=()
 fi
 
+# Enable ADMIN UI by default, and give the option for users to disable it when.
 
 Review comment:
   it's fixed. Psyched even myself out. I have also changed the names.

----------------------------------------------------------------
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


With regards,
Apache Git Services

---------------------------------------------------------------------
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 issue #1391: SOLR-14014 Add a disable Admin UI Flag

Posted by GitBox <gi...@apache.org>.
MarcusSorealheis commented on issue #1391: SOLR-14014 Add a disable Admin UI Flag
URL: https://github.com/apache/lucene-solr/pull/1391#issuecomment-615943497
 
 
   @gerlowskija soft knock 

----------------------------------------------------------------
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


With regards,
Apache Git Services

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