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