feat(server): Add ability to disable the UI#26682
Merged
aaneja merged 1 commit intoprestodb:masterfrom Feb 24, 2026
Merged
Conversation
Contributor
Reviewer's GuideAdds a configurable server flag to enable or disable the Presto web UI and conditionally binds UI routes to either the full UI or a minimal "UI disabled" page, including configuration plumbing and tests. Sequence diagram for handling /ui requests with configurable web UIsequenceDiagram
actor "User" as User
participant "Browser" as Browser
participant "PrestoServer" as Server
participant "CoordinatorModule" as CoordModule
participant "StaticResourceHandler" as StaticHandler
User->>Browser: "Enter /ui URL"
Browser->>Server: "HTTP GET /ui"
Server->>CoordModule: "Resolve route for /ui"
alt "Web UI enabled (webUIEnabled = true)"
CoordModule->>StaticHandler: "Bind /ui to \"webapp\" resources with welcome \"index.html\""
CoordModule->>StaticHandler: "Bind /ui/dev and /tableau when enabled"
Server->>Browser: "Serve full UI index.html from \"webapp/index.html\""
Browser->>User: "Display full Presto UI"
else "Web UI disabled (webUIEnabled = false)"
CoordModule->>StaticHandler: "Bind /ui to \"nowebapp\" resources with welcome \"index.html\""
Server->>Browser: "Serve minimal disabled page from \"nowebapp/index.html\""
Browser->>User: "Display message: \"The Presto UI has been disabled for this environment\""
end
Class diagram for updated server configuration and coordinator moduleclassDiagram
class ServerConfig {
- Duration clusterStatsExpirationDuration
- boolean nestedDataSerializationEnabled
- Duration clusterResourceGroupStateInfoExpirationDuration
- boolean webUIEnabled = true
+ boolean isResourceManager()
+ boolean isCoordinator()
+ boolean isCatalogServer()
+ boolean isWebUIEnabled()
+ ServerConfig setWebUIEnabled(boolean webUIEnabled)
}
class CoordinatorModule {
- String DEFAULT_WEBUI_CSP
- boolean isWebUIEnabled
+ CoordinatorModule(boolean webUIEnabled)
+ void setup(Binder binder)
+ static HttpResourceBinding webUIBinder(Binder binder, String path, String classPathResourceBase)
}
class ServerMainModule {
+ void configure()
}
ServerMainModule --> ServerConfig : reads webUIEnabled flag
ServerMainModule --> CoordinatorModule : creates with isWebUIEnabled()
CoordinatorModule --> HttpResourceBinding : uses for /ui route binding
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Changing CoordinatorModule from a no-arg constructor to requiring a boolean may break existing code/tests that instantiate it directly; consider adding an overloaded no-arg constructor that defaults to
webUIEnabled = trueto preserve backward compatibility.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Changing CoordinatorModule from a no-arg constructor to requiring a boolean may break existing code/tests that instantiate it directly; consider adding an overloaded no-arg constructor that defaults to `webUIEnabled = true` to preserve backward compatibility.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
agrawalreetika
requested changes
Nov 26, 2025
presto-main/src/main/java/com/facebook/presto/server/ServerMainModule.java
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/server/CoordinatorModule.java
Show resolved
Hide resolved
For controlled environments, users may want to disable the UI (enabled by default)
tdcmeehan
approved these changes
Feb 24, 2026
agrawalreetika
approved these changes
Feb 24, 2026
This was referenced Mar 31, 2026
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
For controlled environments, users may want to disable the UI
The UI is enabled by default
Impact
No impact
Test Plan
Contributor checklist
Release Notes