summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-06-30 08:43:50 -0500
committerJeff Carr <[email protected]>2025-06-30 08:44:44 -0500
commit735bfd81223430b900d996b30c22b82b8e3a1146 (patch)
tree074366b5f5f96fc152d192c1a5d5becd7fb3fa11
parent7458af2162ea4c3ec4f559eee6e0aba35204ee5f (diff)
-rw-r--r--Makefile2
-rw-r--r--http.go14
2 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1c1720f..4f6b3de 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,8 @@ install:
prod: build
make stop
cp gowebd /usr/bin/gowebd
+ # allow the binary to open ports below 1024
+ setcap 'cap_net_bind_service=+ep' /usr/bin/gowebd
make start
make log
diff --git a/http.go b/http.go
index 38e07cf..fbd9fc5 100644
--- a/http.go
+++ b/http.go
@@ -78,6 +78,20 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
return
}
+ if route == "/lookup" {
+ w.Header().Set("Content-Type", "text")
+ fmt.Fprintf(w, "go.wit.com/apps/utils/gowebd Version: %s\n", argv.Version())
+ fmt.Fprintf(w, "\n")
+
+ all := forge.Repos.SortByFullPath()
+ for all.Scan() {
+ repo := all.Next()
+
+ fmt.Fprintf(w, "Namespace=%s FullPath=%s %s\n", repo.Namespace, repo.FullPath)
+ }
+ return
+ }
+
if route == "/goReference.svg" {
writeFile(w, "goReference.svg")
return