flounder

A simple gemini site builder
git clone git://git.alexwennerberg.com/flounder
Log | Files | Refs | README | LICENSE

commit 341e764c0be524117473491581f94b928a817c92
parent bd7658d58a3073de8126f87b7c4aebc988442ac9
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon, 17 Jan 2022 10:07:57 -0800

register domain properly for gemini

Diffstat:
Mgemini.go | 3++-
Mhttp.go | 1+
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/gemini.go b/gemini.go @@ -121,6 +121,8 @@ func gmiPage(_ context.Context, w gmi.ResponseWriter, r *gmi.Request) { gmi.ServeFile(w, os.DirFS(path.Join(c.FilesDirectory, userName)), fileName) } +var certificates = certificate.Store{} + func runGeminiServer() { log.Println("Starting gemini server") var err error @@ -140,7 +142,6 @@ func runGeminiServer() { hostname := strings.SplitN(c.Host, ":", 2)[0] // is this necc? - certificates := &certificate.Store{} err = certificates.Load(c.GeminiCertStore) if err != nil { log.Fatal(err) diff --git a/http.go b/http.go @@ -352,6 +352,7 @@ func myAccountHandler(w http.ResponseWriter, r *http.Request) { if err != nil { errors = append(errors, err.Error()) } else { + certificates.Register(newDomain) refreshDomainMap() log.Printf("Changed domain for %s from %s to %s", authUser, me.Domain, newDomain) }