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

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 11343cd6e [KYUUBI #6299] Support disabling Web UI
11343cd6e is described below

commit 11343cd6ea76f642e30afcde743320f32efd2e5c
Author: senmiaoliu <[email protected]>
AuthorDate: Tue Apr 16 15:25:35 2024 +0800

    [KYUUBI #6299] Support disabling Web UI
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This pull request fixes #6299
    
    ## Describe Your Solution ๐Ÿ”ง
    
    when disabling web ui, return 404 page
    
    ## Types of changes :bookmark:
    
    - [ ] Bugfix (non-breaking change which fixes an issue)
    - [x] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    #### Behavior Without This Pull Request :coffin:
    
    #### Behavior With This Pull Request :tada:
    
    #### Related Unit Tests
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [ ] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6311 from lsm1/branch-support-disable-webui.
    
    Closes #6299
    
    aa96c2737 [senmiaoliu] remove enable.html
    998504710 [senmiaoliu] fix style
    a2622cbbc [senmiaoliu] disable web ui
    
    Authored-by: senmiaoliu <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 docs/configuration/settings.md                                     | 1 +
 .../src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala       | 7 +++++++
 .../scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala | 5 +++--
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/docs/configuration/settings.md b/docs/configuration/settings.md
index 72b5ab520..f102e0a05 100644
--- a/docs/configuration/settings.md
+++ b/docs/configuration/settings.md
@@ -260,6 +260,7 @@ You can configure the Kyuubi properties in 
`$KYUUBI_HOME/conf/kyuubi-defaults.co
 | kyuubi.frontend.rest.proxy.jetty.client.requestBufferSize  | 4096            
   | Size of the buffer in bytes used to write requests for Jetty server used 
by the RESTful frontend service.                                                
                                                                                
                                                                                
                                                                                
                [...]
 | kyuubi.frontend.rest.proxy.jetty.client.responseBufferSize | 4096            
   | Size of the buffer in bytes used to read response for Jetty server used by 
the RESTful frontend service.                                                   
                                                                                
                                                                                
                                                                                
              [...]
 | kyuubi.frontend.rest.proxy.jetty.client.timeout            | PT60S           
   | The total timeout in milliseconds for Jetty server used by the RESTful 
frontend service.                                                               
                                                                                
                                                                                
                                                                                
                  [...]
+| kyuubi.frontend.rest.ui.enabled                            | true            
   | Whether to enable Web UI when RESTful protocol is enabled                  
                                                                                
                                                                                
                                                                                
                                                                                
              [...]
 | kyuubi.frontend.ssl.keystore.algorithm                     | 
&lt;undefined&gt;  | SSL certificate keystore algorithm.                        
                                                                                
                                                                                
                                                                                
                                                                                
                              [...]
 | kyuubi.frontend.ssl.keystore.password                      | 
&lt;undefined&gt;  | SSL certificate keystore password.                         
                                                                                
                                                                                
                                                                                
                                                                                
                              [...]
 | kyuubi.frontend.ssl.keystore.path                          | 
&lt;undefined&gt;  | SSL certificate keystore location.                         
                                                                                
                                                                                
                                                                                
                                                                                
                              [...]
diff --git 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
index 840421a3d..397c04935 100644
--- a/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
+++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/config/KyuubiConf.scala
@@ -626,6 +626,13 @@ object KyuubiConf {
       .timeConf
       .createWithDefaultString("PT5S")
 
+  val FRONTEND_REST_UI_ENABLED: ConfigEntry[Boolean] =
+    buildConf("kyuubi.frontend.rest.ui.enabled")
+      .doc("Whether to enable Web UI when RESTful protocol is enabled")
+      .version("1.10.0")
+      .booleanConf
+      .createWithDefault(true)
+
   val FRONTEND_WORKER_KEEPALIVE_TIME: ConfigEntry[Long] =
     buildConf("kyuubi.frontend.worker.keepalive.time")
       .doc("(deprecated) Keep-alive time (in milliseconds) for an idle worker 
thread")
diff --git 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
index a3dd40389..06eb63fee 100644
--- 
a/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
+++ 
b/kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala
@@ -111,8 +111,9 @@ class KyuubiRestFrontendService(override val serverable: 
Serverable)
 
     val proxyHandler = ApiRootResource.getEngineUIProxyHandler(this)
     
server.addHandler(authenticationFactory.httpHandlerWrapperFactory.wrapHandler(proxyHandler))
-
-    installWebUI()
+    if (conf.get(FRONTEND_REST_UI_ENABLED)) {
+      installWebUI()
+    }
   }
 
   private def installWebUI(): Unit = {

Reply via email to