From 1933b3e712c6dc4ebee1441f618266182139b2e0 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Mon, 18 Jul 2016 23:01:49 +0100 Subject: [PATCH] Encrypt serf communications --- cnf/cnf.go | 2 ++ tcp/tcp.go | 1 + 2 files changed, 3 insertions(+) diff --git a/cnf/cnf.go b/cnf/cnf.go index 077dc282..21446279 100644 --- a/cnf/cnf.go +++ b/cnf/cnf.go @@ -17,6 +17,8 @@ package cnf // Options defines global configuration options type Options struct { DB struct { + Key []byte // Data encryption key + Code string // Data encruption key string Path string // Path to store the data file Host string // Surreal host to connect to Port string // Surreal port to connect to diff --git a/tcp/tcp.go b/tcp/tcp.go index abc342a0..6f3323c9 100644 --- a/tcp/tcp.go +++ b/tcp/tcp.go @@ -43,6 +43,7 @@ func Setup(opts *cnf.Options) (err error) { cfg.MemberlistConfig.LogOutput = ioutil.Discard + cfg.MemberlistConfig.SecretKey = opts.DB.Key cfg.MemberlistConfig.BindPort = opts.Port.Tcp cfg.MemberlistConfig.AdvertisePort = opts.Port.Tcp