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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to