From 4b4bc9792b21e1bc37c9876f628e4636a9ad23cd Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Sun, 4 Feb 2024 13:41:29 +0100 Subject: [PATCH] feat: Only listen on http-port if we don't have ACME disabled --- cmd/rio/main.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/rio/main.go b/cmd/rio/main.go index fba71f7..ac15f77 100644 --- a/cmd/rio/main.go +++ b/cmd/rio/main.go @@ -210,16 +210,6 @@ func runServer(ctx *cli.Context) error { return err } - // Listen on the HTTP port - httpAddr := ctx.String("http-host") + ":" + ctx.String("http-port") - httpListener, err := net.Listen("tcp", httpAddr) - if err != nil { - fmt.Println( - fmt.Errorf("Failed to create HTTP listener: %v", err), - ) - return err - } - // Prepare the context cacheCtx := context.CacheContext{ RepositoryInformationCache: context.MakeRepoInfoCache(), @@ -310,6 +300,16 @@ func runServer(ctx *cli.Context) error { }() if !acmeDisable { + // Listen on the HTTP port + httpAddr := ctx.String("http-host") + ":" + ctx.String("http-port") + httpListener, err := net.Listen("tcp", httpAddr) + if err != nil { + fmt.Println( + fmt.Errorf("Failed to create HTTP listener: %v", err), + ) + return err + } + go func() { defer waitGroup.Done()