From 2c1eed342dd4dc5ee4f00bbc1f7bd62fd49171c4 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 8 Nov 2022 21:51:53 +0100 Subject: [PATCH] banner: build timestamp: read port from http-port.txt This fixes the banner on devices that use a non-standard HTTP port --- breakglass.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/breakglass.go b/breakglass.go index 0b39cbc..04f3fdf 100644 --- a/breakglass.go +++ b/breakglass.go @@ -123,7 +123,11 @@ func buildTimestamp() (string, error) { if err != nil { return "", err } - req, err := http.NewRequest("GET", "http://gokrazy:"+strings.TrimSpace(string(pw))+"@localhost/", nil) + port, err := os.ReadFile("/etc/http-port.txt") + if err != nil { + return "", err + } + req, err := http.NewRequest("GET", "http://gokrazy:"+strings.TrimSpace(string(pw))+"@localhost:"+strings.TrimSpace(string(port))+"/", nil) if err != nil { return "", err }