Remove built in https support
alex wennerberg alex@alexwennerberg.com
Sat, 09 Jan 2021 14:47:28 -0800
M
README.md
→
README.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
http.go
→
http.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.go
→
main.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()