A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(rexctl): check proxy health without a published port (#3598)
Hampus4abd1a3ec574
diff --git a/fluxer_rexctl/internal/checks/health.go b/fluxer_rexctl/internal/checks/health.goindex 915518bc7..668046638 100644--- a/fluxer_rexctl/internal/checks/health.go+++ b/fluxer_rexctl/internal/checks/health.go@@ -51,6 +51,14 @@ func (e *Env) healthURLs() []string {}}+func (e *Env) edgePublished() bool {+ if e.Project == nil || e.Project.Model == nil {+ return true+ }+ svc, ok := e.Project.Model.Services["edge"]+ return !ok || len(svc.Ports) > 0+}+func (e *Env) localClient() *http.Client {return &http.Client{Timeout: 10 * time.Second,@@ -70,6 +78,12 @@ func runHealth(ctx context.Context, e *Env) Result {if err != nil || !slices.ContainsFunc(states, func(s ServiceState) bool { return s.Name == "edge" && s.Running() }) {return skip("")}+ if e.mode() == modeProxy && !e.edgePublished() {+ if _, err := e.exec(ctx, "edge", "", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/_health"); err != nil {+ 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.")+ }client := e.localClient()answered := falsefor _, u := range e.healthURLs() {