flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit 862f998d8403f17b9a1b2e7fdc06e6180c97f30c
parent 1bc4c1f0f0e1425d66f236410e313844772a0aea
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue, 16 Nov 2021 18:54:48 -0800

update finger server

Diffstat:
Mfinger.go | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/finger.go b/finger.go @@ -7,6 +7,7 @@ import ( "os" "path" "path/filepath" + "strings" "time" "github.com/mitchellh/go-finger" @@ -18,7 +19,12 @@ func runFingerServer() { Handler: finger.HandlerFunc(func(ctx context.Context, w io.Writer, q *finger.Query) { log.Printf("finger request: %v", q) if q.Username == "" { - q.Username = "admin" // default to admin finger page + users, err := getActiveUserNames() + if err != nil { + w.Write([]byte("Error\n")) + } + w.Write([]byte(strings.Join(users, "\n"))) + return } userName := filepath.Clean(q.Username) fullPath := path.Join(c.FilesDirectory, userName, "finger")