[KYUUBI #6299] Support disabling Web UI

# 🔍 Description
## Issue References 🔗

This pull request fixes #6299

## Describe Your Solution 🔧

when disabling web ui, return 404 page

## Types of changes 🔖

- [ ] 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 ⚰️

#### Behavior With This Pull Request 🎉

#### 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 <senmiaoliu@trip.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
senmiaoliu 2024-04-16 15:25:35 +08:00 committed by Cheng Pan
parent 15911573ba
commit 11343cd6ea
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D
3 changed files with 11 additions and 2 deletions

View File

@ -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. | int | 1.10.0 |
| 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. | int | 1.10.0 |
| kyuubi.frontend.rest.proxy.jetty.client.timeout | PT60S | The total timeout in milliseconds for Jetty server used by the RESTful frontend service. | duration | 1.10.0 |
| kyuubi.frontend.rest.ui.enabled | true | Whether to enable Web UI when RESTful protocol is enabled | boolean | 1.10.0 |
| kyuubi.frontend.ssl.keystore.algorithm | &lt;undefined&gt; | SSL certificate keystore algorithm. | string | 1.7.0 |
| kyuubi.frontend.ssl.keystore.password | &lt;undefined&gt; | SSL certificate keystore password. | string | 1.7.0 |
| kyuubi.frontend.ssl.keystore.path | &lt;undefined&gt; | SSL certificate keystore location. | string | 1.7.0 |

View File

@ -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")

View File

@ -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 = {