diff --git a/README.md b/README.md index 3afdd08..83a5113 100644 --- a/README.md +++ b/README.md @@ -39,18 +39,21 @@ openssl req -x509 -newkey rsa:4096 -keyout key.rsa -out cert.pem \ -days 3650 -nodes -subj "/CN=nox.im" ``` -start gmifs with the keypair +start gmifs with a key pair ``` gmifs -addr 0.0.0.0:1965 -root /var/www/htdocs/nox.im/gemini \ - -host nox.im -max-conns 1024 -timeout 5 \ + -host nox.im -max-conns 256 -timeout 5 -cache 256 \ -logs /var/gemini/logs/ \ -cert /etc/ssl/nox.im.fullchain.pem \ -key /etc/ssl/private/nox.im.key ``` -if need be, send SIGHUP to reload the certificate without downtime +if need be, send SIGHUP to reload the certificate without cold start, e.g. after a Let's Encrypt +renewal ``` pgrep gmifs | awk '{print "kill -1 " $1}' | sh ``` + +If debug logs are enabled, the certificate rotation will be confirmed. diff --git a/gemini/interceptor.go b/gemini/interceptor.go index a64f121..0d506a2 100644 --- a/gemini/interceptor.go +++ b/gemini/interceptor.go @@ -7,14 +7,11 @@ import ( // Interceptor is a ResponseWriter wrapper that may be used as buffer. // // A middleware may pass it to the next handlers ServeGemini method as a drop in replacement for the -// response writer. After the ServeGemini method is run the middleware may examine what has been -// written to the Interceptor and decide what to write to the "original" ResponseWriter (that may well be -// another buffer passed from another middleware). +// response writer. See the logger and cache middlewares for examples. // -// The downside is the body being written two times and the complete caching of the -// body in the memory. +// Note that the body being written two times and the complete caching of the body in the memory. type Interceptor struct { - // ioWriter is the underlying response writer that is wrapped by Interceptor + // ResponseWriter is the underlying response writer that is wrapped by Interceptor w ResponseWriter // Interceptor is the underlying io.Writer that buffers the response body