flounder

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

commit b626eb0a83d6ee8c62d82154dd2a44badcedfeb6
parent 7bf10b1a0e72bf7bfa0a249b84c3233eff6a5f7a
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Mon, 26 Oct 2020 19:41:54 -0700

 some qa

Diffstat:
Mconfig.go | 2+-
Mflounder.toml | 4++--
Mhttp.go | 5+++--
Mtemplates/index.gmi | 2+-
4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/config.go b/config.go @@ -9,7 +9,7 @@ type Config struct { TemplatesDirectory string Host string HttpsEnabled bool - HttpPort string + HttpPort int SiteTitle string Debug bool SecretKey string diff --git a/flounder.toml b/flounder.toml @@ -2,10 +2,10 @@ SiteTitle="­čÉčflounder" # Include port if running locally -Host="localhost:8080" +Host="localhost:8165" # Set this depending on whether you want to run this service standalone or through a reverse proxy server -HttpPort="8443" +HttpPort=8165 HttpsEnabled=false # Folder containing subfolders for each user's files diff --git a/http.go b/http.go @@ -3,6 +3,7 @@ package main import ( "bytes" "database/sql" + "fmt" gmi "git.sr.ht/~adnano/go-gemini" "github.com/gorilla/handlers" "github.com/gorilla/sessions" @@ -367,7 +368,7 @@ func userFile(w http.ResponseWriter, r *http.Request) { } func runHTTPServer() { - log.Printf("Running http server on %s", c.Host) + log.Printf("Running http server with hostname %s on port %d. TLS enabled: %t", c.Host, c.HttpPort, c.HttpsEnabled) var err error t, err = template.ParseGlob(path.Join(c.TemplatesDirectory, "*.html")) if err != nil { @@ -399,7 +400,7 @@ func runHTTPServer() { ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second, IdleTimeout: 120 * time.Second, - Addr: ":" + port, + Addr: fmt.Sprintf(":%d", port), // TLSConfig: tlsConfig, Handler: wrapped, } diff --git a/templates/index.gmi b/templates/index.gmi @@ -11,5 +11,5 @@ Welcome to flounder, a home for Gemini sites. Flounder hosts small Gemini web pa {{end}} ## Recently updated files: -{{range .Files}}=> gemini://{{.Creator}}.{{$host}}/{{.Name}} {{.Name}} ({{.UpdatedTime}}) +{{range .Files}}=> gemini://{{.Creator}}.{{$host}}/{{.Name}} {{.Creator}}: {{.Name}} ({{.TimeAgo}}) {{end}}