From bd118e61bc730456c8237a81416e015f010d6240 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 17 Jan 2023 18:22:04 +0100 Subject: [PATCH] allow to start if only httpd service is enabled Signed-off-by: Nicola Murino --- internal/config/config.go | 3 +++ internal/config/config_test.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 2b40895f..7dc03b7c 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -591,6 +591,9 @@ func HasServicesToStart() bool { if globalConf.WebDAVD.ShouldBind() { return true } + if globalConf.HTTPDConfig.ShouldBind() { + return true + } return false } diff --git a/internal/config/config_test.go b/internal/config/config_test.go index dd8c32c1..2032a3a8 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -386,6 +386,10 @@ func TestServiceToStart(t *testing.T) { sftpdConf := config.GetSFTPDConfig() sftpdConf.Bindings[0].Port = 0 config.SetSFTPDConfig(sftpdConf) + // httpd service is enabled + assert.True(t, config.HasServicesToStart()) + httpdConf := config.GetHTTPDConfig() + httpdConf.Bindings[0].Port = 0 assert.False(t, config.HasServicesToStart()) ftpdConf := config.GetFTPDConfig() ftpdConf.Bindings[0].Port = 2121