add support for multiple bindings

Fixes #253
This commit is contained in:
Nicola Murino
2020-12-23 16:12:30 +01:00
parent 743b350fdd
commit c69d63c1f8
24 changed files with 1173 additions and 269 deletions

View File

@@ -129,7 +129,7 @@ func (s *Service) startServices() {
webDavDConf := config.GetWebDAVDConfig()
telemetryConf := config.GetTelemetryConfig()
if sftpdConf.BindPort > 0 {
if sftpdConf.ShouldBind() {
go func() {
logger.Debug(logSender, "", "initializing SFTP server with config %+v", sftpdConf)
if err := sftpdConf.Initialize(s.ConfigDir); err != nil {
@@ -158,7 +158,7 @@ func (s *Service) startServices() {
logger.DebugToConsole("HTTP server not started, disabled in config file")
}
}
if ftpdConf.BindPort > 0 {
if ftpdConf.ShouldBind() {
go func() {
if err := ftpdConf.Initialize(s.ConfigDir); err != nil {
logger.Error(logSender, "", "could not start FTP server: %v", err)
@@ -170,7 +170,7 @@ func (s *Service) startServices() {
} else {
logger.Debug(logSender, "", "FTP server not started, disabled in config file")
}
if webDavDConf.BindPort > 0 {
if webDavDConf.ShouldBind() {
go func() {
if err := webDavDConf.Initialize(s.ConfigDir); err != nil {
logger.Error(logSender, "", "could not start WebDAV server: %v", err)