flounder

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

commit 873a30d3ea4c4d1e43a21a70c9ea2dc08691d537
parent 6c98078eb024bc7a15bdcc7b33ab0314148e1134
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat,  9 Jan 2021 14:47:28 -0800

Remove built in https support

Diffstat:
MREADME.md | 7++-----
Mconfig.go | 1-
Mhttp.go | 8++------
Mmain.go | 8--------
4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md @@ -22,12 +22,9 @@ After creating an account, you can activate it at the command line with: ## 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. diff --git a/config.go b/config.go @@ -12,7 +12,6 @@ type Config struct { FilesDirectory string TemplatesDirectory string Host string - HttpsEnabled bool HttpPort int SiteTitle string Debug bool diff --git a/http.go b/http.go @@ -726,7 +726,7 @@ func adminUserHandler(w http.ResponseWriter, r *http.Request) { } 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 @@ func runHTTPServer() { // TLSConfig: tlsConfig, Handler: wrapped, } - if c.HttpsEnabled { - log.Fatal(srv.ListenAndServeTLS(c.TLSCertFile, c.TLSKeyFile)) - } else { - log.Fatal(srv.ListenAndServe()) - } + log.Fatal(srv.ListenAndServe()) } diff --git a/main.go b/main.go @@ -35,14 +35,6 @@ func main() { 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()