From 2d7cb1b61c48b07133fb7f4477c18b753a46cb27 Mon Sep 17 00:00:00 2001 From: Pavlo Golub Date: Tue, 29 Oct 2024 11:48:17 +0100 Subject: [PATCH] [+] disable web user interface if `--web-addr` is empty --- internal/cmdopts/cmdoptions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/cmdopts/cmdoptions.go b/internal/cmdopts/cmdoptions.go index b3ed5d0d5..876f5f0cd 100644 --- a/internal/cmdopts/cmdoptions.go +++ b/internal/cmdopts/cmdoptions.go @@ -181,6 +181,10 @@ func (c *Options) NeedsSchemaUpgrade() (upgrade bool, err error) { // InitWebUI initializes the web UI server func (c *Options) InitWebUI(fs fs.FS, logger log.LoggerIface) error { + if c.WebUI.WebAddr == "" { + logger.Info("web user interface is disabled") + return nil + } if webserver.Init(c.WebUI, fs, c.MetricsReaderWriter, c.SourcesReaderWriter, logger) == nil { return errors.New("failed to initialize web UI") }