all repos — website @ a3dae65bcbf572b02a36996b91d13d49036abb30

My website

Add support for connecting to redis via TLS
Alan Pearce alan@alanpearce.eu
Wed, 27 Nov 2024 22:47:07 +0100
commit

a3dae65bcbf572b02a36996b91d13d49036abb30

parent

a7b7b026f6279f9cb9104b41580ebe5264c86c9d

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M internal/server/tls.gointernal/server/tls.go
@@ -24,6 +24,8 @@ Username      string `conf:"default:default"` 	Password      string `conf:"required"`
 	EncryptionKey string `conf:"required"`
 	KeyPrefix     string `conf:"default:certmagic"`
+	TLSEnabled    bool   `conf:"default:false,env:TLS_ENABLED"`
+	TLSInsecure   bool   `conf:"default:false,env:TLS_INSECURE"`
 }
 
 func (s *Server) serveTLS() (err error) {
@@ -101,6 +103,8 @@ rs.Username = rc.Username 		rs.Password = rc.Password
 		rs.EncryptionKey = rc.EncryptionKey
 		rs.KeyPrefix = rc.KeyPrefix
+		rs.TlsEnabled = rc.TLSEnabled
+		rs.TlsInsecure = rc.TLSInsecure
 
 		cfg.Storage = rs
 		err = rs.Provision(caddy.Context{