all repos — flounder @ 873a30d3ea4c4d1e43a21a70c9ea2dc08691d537

A small site builder for the Gemini protocol

Remove built in https support
alex wennerberg alex@alexwennerberg.com
Sat, 09 Jan 2021 14:47:28 -0800
commit

873a30d3ea4c4d1e43a21a70c9ea2dc08691d537

parent

6c98078eb024bc7a15bdcc7b33ab0314148e1134

4 files changed, 4 insertions(+), 20 deletions(-)

jump to
M README.mdREADME.md

@@ -22,12 +22,9 @@ ./flounder -c example-config.toml activate-user [your-username]

## Deploying -For the Http(s) server, you have two options: +For production, in order to handle TLS and custom domains, I use Caddy with On Demand TLS certs. -1. Expose the flounder server to the internet directly (I have not tested this extensively and probably don't recommend it) -2. Route the flounder server through a reverse proxy - -For TLS, you'll need to configure a wildcard cert via, for example, LetsEncrypt, that matches [any-subdomain].[your-host]. Over gemini, self-signed certs are handled automatically. +(TODO -- rewrite) I have not extensively tested the self-hosting capabilities, but making it easy to self-host Flounder for either a single or multi-user instance is a goal of mine. Email me if you encounter issues or would like guidance.
M config.goconfig.go

@@ -12,7 +12,6 @@ type Config struct {

FilesDirectory string TemplatesDirectory string Host string - HttpsEnabled bool HttpPort int SiteTitle string Debug bool
M http.gohttp.go

@@ -726,7 +726,7 @@ }

} func runHTTPServer() { - log.Printf("Running http server with hostname %s on port %d. TLS enabled: %t", c.Host, c.HttpPort, c.HttpsEnabled) + log.Printf("Running http server with hostname %s on port %d.", c.Host, c.HttpPort) var err error t = template.New("main").Funcs(template.FuncMap{"parent": path.Dir}) t, err = t.ParseGlob(path.Join(c.TemplatesDirectory, "*.html"))

@@ -774,9 +774,5 @@ Addr: fmt.Sprintf(":%d", port),

// TLSConfig: tlsConfig, Handler: wrapped, } - if c.HttpsEnabled { - log.Fatal(srv.ListenAndServeTLS(c.TLSCertFile, c.TLSKeyFile)) - } else { - log.Fatal(srv.ListenAndServe()) - } + log.Fatal(srv.ListenAndServe()) }
M main.gomain.go

@@ -35,14 +35,6 @@ }

mw := io.MultiWriter(os.Stdout, logFile) log.SetOutput(mw) - if c.HttpsEnabled { - _, err1 := os.Stat(c.TLSCertFile) - _, err2 := os.Stat(c.TLSKeyFile) - if os.IsNotExist(err1) || os.IsNotExist(err2) { - log.Fatal("Keyfile or certfile does not exist.") - } - } - initializeDB() cookie := generateCookieKeyIfDNE()