A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(rexctl): probe the edge before failing on host ports (#3642)
Hampusb8dc81922245
diff --git a/fluxer_rexctl/internal/checks/health.go b/fluxer_rexctl/internal/checks/health.goindex 085f5904e..b70b2d799 100644--- a/fluxer_rexctl/internal/checks/health.go+++ b/fluxer_rexctl/internal/checks/health.go@@ -79,11 +79,7 @@ func runHealth(ctx context.Context, e *Env) Result {return skip("")}if !e.edgePublished() {- probe := "http://127.0.0.1:8088/_edge"- if e.mode() == modeProxy {- probe = "http://127.0.0.1:8080/_health"- }- if _, err := e.exec(ctx, "edge", "", "wget", "-q", "-O", "/dev/null", probe); err != nil {+ if !answersInsideEdge(ctx, e) {return fail("Fluxer doesn't answer inside the edge container.", "Run rexctl logs edge to see why.")}return pass("Fluxer answers inside the edge container.")@@ -115,5 +111,17 @@ func runHealth(ctx context.Context, e *Env) Result {if answered {return fail("Fluxer's web server answers with an error.", "Run rexctl logs api to see why.")}+ if answersInsideEdge(ctx, e) {+ return warn("Fluxer answers inside the edge container, but not on this machine's ports 80 and 443.", "That's fine if your own reverse proxy forwards to the edge container. Run rexctl proxy on to tell rexctl about it.")+ }return fail("Fluxer doesn't answer on this machine.", "Run rexctl logs edge to see why.")}++func answersInsideEdge(ctx context.Context, e *Env) bool {+ probe := "http://127.0.0.1:8088/_edge"+ if e.mode() == modeProxy {+ probe = "http://127.0.0.1:8080/_health"+ }+ _, err := e.exec(ctx, "edge", "", "wget", "-q", "-O", "/dev/null", probe)+ return err == nil+}