|
|
@@ -16,6 +16,7 @@ type Config struct {
|
|
16
|
16
|
Debug bool
|
|
17
|
17
|
Verbose bool
|
|
18
|
18
|
SecureMode bool
|
|
|
19
|
+ SecureOnly bool
|
|
19
|
20
|
|
|
20
|
21
|
ReadBufferSize int
|
|
21
|
22
|
WriteBufferSize int
|
|
|
@@ -116,8 +117,9 @@ func NewConfig(debug, verbose bool, // nolint: gocyclo
|
|
116
|
117
|
bindPort, publicIPv4Port, publicIPv6Port, statsPort, statsdPort uint16,
|
|
117
|
118
|
statsdIP, statsdNetwork, statsdPrefix, statsdTagsFormat string,
|
|
118
|
119
|
statsdTags map[string]string,
|
|
|
120
|
+ secureOnly bool,
|
|
119
|
121
|
secret, adtag []byte) (*Config, error) {
|
|
120
|
|
- secureMode := false
|
|
|
122
|
+ secureMode := secureOnly
|
|
121
|
123
|
if bytes.HasPrefix(secret, []byte{0xdd}) && len(secret) == 17 {
|
|
122
|
124
|
secureMode = true
|
|
123
|
125
|
secret = bytes.TrimPrefix(secret, []byte{0xdd})
|
|
|
@@ -157,6 +159,7 @@ func NewConfig(debug, verbose bool, // nolint: gocyclo
|
|
157
|
159
|
conf := &Config{
|
|
158
|
160
|
Debug: debug,
|
|
159
|
161
|
Verbose: verbose,
|
|
|
162
|
+ SecureOnly: secureOnly,
|
|
160
|
163
|
BindIP: bindIP,
|
|
161
|
164
|
BindPort: bindPort,
|
|
162
|
165
|
PublicIPv4: publicIPv4,
|