all repos — flounder @ b626eb0a83d6ee8c62d82154dd2a44badcedfeb6

A small site builder for the Gemini protocol

 some qa
alex wennerberg alex@alexwennerberg.com
Mon, 26 Oct 2020 19:41:54 -0700
commit

b626eb0a83d6ee8c62d82154dd2a44badcedfeb6

parent

7bf10b1a0e72bf7bfa0a249b84c3233eff6a5f7a

4 files changed, 7 insertions(+), 6 deletions(-)

jump to
M config.goconfig.go

@@ -9,7 +9,7 @@ FilesDirectory string

TemplatesDirectory string Host string HttpsEnabled bool - HttpPort string + HttpPort int SiteTitle string Debug bool SecretKey string
M flounder.tomlflounder.toml

@@ -2,10 +2,10 @@ # Used in HTML templates and titles

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
M http.gohttp.go

@@ -3,6 +3,7 @@

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 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 @@ srv := &http.Server{

ReadTimeout: 5 * time.Second, WriteTimeout: 10 * time.Second, IdleTimeout: 120 * time.Second, - Addr: ":" + port, + Addr: fmt.Sprintf(":%d", port), // TLSConfig: tlsConfig, Handler: wrapped, }
M templates/index.gmitemplates/index.gmi

@@ -11,5 +11,5 @@ {{range .Users}}=> gemini://{{.}}.{{$host}}

{{end}} ## Recently updated files: -{{range .Files}}=> gemini://{{.Creator}}.{{$host}}/{{.Name}} {{.Name}} ({{.UpdatedTime}}) +{{range .Files}}=> gemini://{{.Creator}}.{{$host}}/{{.Name}} {{.Creator}}: {{.Name}} ({{.TimeAgo}}) {{end}}