From 496c8bc785fc5c4eb77346cdc4f4e7bc70701e27 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 f4bf34ea..de6c108e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -592,6 +592,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 b3ca6ff7..0d242aa9 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