Skip to content

Commit 9a4f846

Browse files
committed
Revert "config: UI configuration block with Vault/Consul links (#11555)"
This reverts commit 1160817.
1 parent 73eacec commit 9a4f846

File tree

3 files changed

+3
-28
lines changed

3 files changed

+3
-28
lines changed

command/agent/config.go

-12
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ type Config struct {
132132
// parameters necessary to derive tokens.
133133
Vault *config.VaultConfig `hcl:"vault"`
134134

135-
// UI is used to configure the web UI
136-
UI *config.UIConfig `hcl:"ui"`
137-
138135
// NomadConfig is used to override the default config.
139136
// This is largely used for testing purposes.
140137
NomadConfig *nomad.Config `hcl:"-" json:"-"`
@@ -929,7 +926,6 @@ func DefaultConfig() *Config {
929926
AdvertiseAddrs: &AdvertiseAddrs{},
930927
Consul: config.DefaultConsulConfig(),
931928
Vault: config.DefaultVaultConfig(),
932-
UI: config.DefaultUIConfig(),
933929
Client: &ClientConfig{
934930
Enabled: false,
935931
MaxKillTimeout: "30s",
@@ -1168,14 +1164,6 @@ func (c *Config) Merge(b *Config) *Config {
11681164
result.Vault = result.Vault.Merge(b.Vault)
11691165
}
11701166

1171-
// Apply the UI Configuration
1172-
if result.UI == nil && b.UI != nil {
1173-
uiConfig := *b.UI
1174-
result.UI = &uiConfig
1175-
} else if b.UI != nil {
1176-
result.UI = result.UI.Merge(b.UI)
1177-
}
1178-
11791167
// Apply the sentinel config
11801168
if result.Sentinel == nil && b.Sentinel != nil {
11811169
server := *b.Sentinel

command/agent/http.go

+3-12
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ var (
4747
// Set to false by stub_asset if the ui build tag isn't enabled
4848
uiEnabled = true
4949

50-
// Displayed when ui is disabled, but overridden if the ui build
51-
// tag isn't enabled
52-
stubHTML = "<html><p>Nomad UI is disabled</p></html>"
50+
// Overridden if the ui build tag isn't enabled
51+
stubHTML = ""
5352

5453
// allowCORS sets permissive CORS headers for a handler
5554
allowCORS = cors.New(cors.Options{
@@ -337,21 +336,13 @@ func (s *HTTPServer) registerHandlers(enableDebug bool) {
337336
s.mux.HandleFunc("/v1/namespace", s.wrap(s.NamespaceCreateRequest))
338337
s.mux.HandleFunc("/v1/namespace/", s.wrap(s.NamespaceSpecificRequest))
339338

340-
uiConfigEnabled := s.agent.config.UI != nil && s.agent.config.UI.Enabled
341-
342-
if uiEnabled && uiConfigEnabled {
339+
if uiEnabled {
343340
s.mux.Handle("/ui/", http.StripPrefix("/ui/", s.handleUI(http.FileServer(&UIAssetWrapper{FileSystem: assetFS()}))))
344-
s.logger.Debug("UI is enabled")
345341
} else {
346342
// Write the stubHTML
347343
s.mux.HandleFunc("/ui/", func(w http.ResponseWriter, r *http.Request) {
348344
w.Write([]byte(stubHTML))
349345
})
350-
if uiEnabled && !uiConfigEnabled {
351-
s.logger.Warn("UI is disabled")
352-
} else {
353-
s.logger.Debug("UI is disabled in this build")
354-
}
355346
}
356347
s.mux.Handle("/", s.handleRootFallthrough())
357348

website/data/docs-nav-data.json

-4
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@
200200
"title": "tls",
201201
"path": "configuration/tls"
202202
},
203-
{
204-
"title": "ui",
205-
"path": "configuration/ui"
206-
},
207203
{
208204
"title": "vault",
209205
"path": "configuration/vault"

0 commit comments

Comments
 (0)