|
|
@@ -12,23 +12,23 @@ import (
|
|
12
|
12
|
type Config struct {
|
|
13
|
13
|
Debug bool `json:"debug"`
|
|
14
|
14
|
Secret mtglib.Secret `json:"secret"`
|
|
15
|
|
- BindTo TypeHostPort `json:"bind-to"`
|
|
16
|
|
- TCPBuffer TypeBytes `json:"tcp-buffer"`
|
|
17
|
|
- PreferIP TypePreferIP `json:"prefer-ip"`
|
|
18
|
|
- DomainFrontingPort TypePort `json:"domain-fronting-port"`
|
|
19
|
|
- TolerateTimeSkewness TypeDuration `json:"tolerate-time-skewness"`
|
|
|
15
|
+ BindTo TypeHostPort `json:"bindTo"`
|
|
|
16
|
+ TCPBuffer TypeBytes `json:"tcpBuffer"`
|
|
|
17
|
+ PreferIP TypePreferIP `json:"preferIp"`
|
|
|
18
|
+ DomainFrontingPort TypePort `json:"domainFrontingPort"`
|
|
|
19
|
+ TolerateTimeSkewness TypeDuration `json:"tolerateTimeSkewness"`
|
|
20
|
20
|
Concurrency uint `json:"concurrency"`
|
|
21
|
21
|
Defense struct {
|
|
22
|
22
|
AntiReplay struct {
|
|
23
|
23
|
Enabled bool `json:"enabled"`
|
|
24
|
|
- MaxSize TypeBytes `json:"max-size"`
|
|
25
|
|
- ErrorRate TypeErrorRate `json:"error-rate"`
|
|
26
|
|
- } `json:"anti-replay"`
|
|
|
24
|
+ MaxSize TypeBytes `json:"maxSize"`
|
|
|
25
|
+ ErrorRate TypeErrorRate `json:"errorRate"`
|
|
|
26
|
+ } `json:"antiReplay"`
|
|
27
|
27
|
Blocklist struct {
|
|
28
|
28
|
Enabled bool `json:"enabled"`
|
|
29
|
|
- DownloadConcurrency uint `json:"download-concurrency"`
|
|
|
29
|
+ DownloadConcurrency uint `json:"downloadConcurrency"`
|
|
30
|
30
|
URLs []TypeBlocklistURI `json:"urls"`
|
|
31
|
|
- UpdateEach TypeDuration `json:"update-each"`
|
|
|
31
|
+ UpdateEach TypeDuration `json:"updateEach"`
|
|
32
|
32
|
} `json:"blocklist"`
|
|
33
|
33
|
} `json:"defense"`
|
|
34
|
34
|
Network struct {
|
|
|
@@ -37,21 +37,21 @@ type Config struct {
|
|
37
|
37
|
HTTP TypeDuration `json:"http"`
|
|
38
|
38
|
Idle TypeDuration `json:"idle"`
|
|
39
|
39
|
} `json:"timeout"`
|
|
40
|
|
- DOHIP TypeIP `json:"doh-ip"`
|
|
|
40
|
+ DOHIP TypeIP `json:"dohIp"`
|
|
41
|
41
|
Proxies []TypeURL `json:"proxies"`
|
|
42
|
42
|
} `json:"network"`
|
|
43
|
43
|
Stats struct {
|
|
44
|
44
|
StatsD struct {
|
|
45
|
45
|
Enabled bool `json:"enabled"`
|
|
46
|
46
|
Address TypeHostPort `json:"address"`
|
|
47
|
|
- MetricPrefix TypeMetricPrefix `json:"metric-prefix"`
|
|
48
|
|
- TagFormat TypeStatsdTagFormat `json:"tag-format"`
|
|
|
47
|
+ MetricPrefix TypeMetricPrefix `json:"metricPrefix"`
|
|
|
48
|
+ TagFormat TypeStatsdTagFormat `json:"tagFormat"`
|
|
49
|
49
|
} `json:"statsd"`
|
|
50
|
50
|
Prometheus struct {
|
|
51
|
51
|
Enabled bool `json:"enabled"`
|
|
52
|
|
- BindTo TypeHostPort `json:"bind-to"`
|
|
53
|
|
- HTTPPath TypeHTTPPath `json:"http-path"`
|
|
54
|
|
- MetricPrefix TypeMetricPrefix `json:"metric-prefix"`
|
|
|
52
|
+ BindTo TypeHostPort `json:"bindTo"`
|
|
|
53
|
+ HTTPPath TypeHTTPPath `json:"httpPath"`
|
|
|
54
|
+ MetricPrefix TypeMetricPrefix `json:"metricPrefix"`
|
|
55
|
55
|
} `json:"prometheus"`
|
|
56
|
56
|
} `json:"stats"`
|
|
57
|
57
|
}
|
|
|
@@ -84,23 +84,23 @@ func (c *Config) String() string {
|
|
84
|
84
|
type configRaw struct {
|
|
85
|
85
|
Debug bool `toml:"debug" json:"debug,omitempty"`
|
|
86
|
86
|
Secret string `toml:"secret" json:"secret"`
|
|
87
|
|
- BindTo string `toml:"bind-to" json:"bind-to"`
|
|
88
|
|
- TCPBuffer string `toml:"tcp-buffer" json:"tcp-buffer,omitempty"`
|
|
89
|
|
- PreferIP string `toml:"prefer-ip" json:"prefer-ip,omitempty"`
|
|
90
|
|
- DomainFrontingPort uint `toml:"domain-fronting-port" json:"domain-fronting-port,omitempty"`
|
|
91
|
|
- TolerateTimeSkewness string `toml:"tolerate-time-skewness" json:"tolerate-time-skewness,omitempty"`
|
|
|
87
|
+ BindTo string `toml:"bind-to" json:"bindTo"`
|
|
|
88
|
+ TCPBuffer string `toml:"tcp-buffer" json:"tcpBuffer,omitempty"`
|
|
|
89
|
+ PreferIP string `toml:"prefer-ip" json:"preferIp,omitempty"`
|
|
|
90
|
+ DomainFrontingPort uint `toml:"domain-fronting-port" json:"domainFrontingPort,omitempty"`
|
|
|
91
|
+ TolerateTimeSkewness string `toml:"tolerate-time-skewness" json:"tolerateTimeSkewness,omitempty"`
|
|
92
|
92
|
Concurrency uint `toml:"concurrency" json:"concurrency,omitempty"`
|
|
93
|
93
|
Defense struct {
|
|
94
|
94
|
AntiReplay struct {
|
|
95
|
95
|
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
|
96
|
|
- MaxSize string `toml:"max-size" json:"max-size,omitempty"`
|
|
97
|
|
- ErrorRate float64 `toml:"error-rate" json:"error-rate,omitempty"`
|
|
98
|
|
- } `toml:"anti-replay" json:"anti-replay,omitempty"`
|
|
|
96
|
+ MaxSize string `toml:"max-size" json:"maxSize,omitempty"`
|
|
|
97
|
+ ErrorRate float64 `toml:"error-rate" json:"errorRate,omitempty"`
|
|
|
98
|
+ } `toml:"anti-replay" json:"antiReplay,omitempty"`
|
|
99
|
99
|
Blocklist struct {
|
|
100
|
100
|
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
|
101
|
|
- DownloadConcurrency uint `toml:"download-concurrency" json:"download-concurrency,omitempty"`
|
|
|
101
|
+ DownloadConcurrency uint `toml:"download-concurrency" json:"downloadConcurrency,omitempty"`
|
|
102
|
102
|
URLs []string `toml:"urls" json:"urls,omitempty"`
|
|
103
|
|
- UpdateEach string `toml:"update-each" json:"update-each,omitempty"`
|
|
|
103
|
+ UpdateEach string `toml:"update-each" json:"updateEach,omitempty"`
|
|
104
|
104
|
} `toml:"blocklist" json:"blocklist,omitempty"`
|
|
105
|
105
|
} `toml:"defense" json:"defense,omitempty"`
|
|
106
|
106
|
Network struct {
|
|
|
@@ -109,21 +109,21 @@ type configRaw struct {
|
|
109
|
109
|
HTTP string `toml:"http" json:"http,omitempty"`
|
|
110
|
110
|
Idle string `toml:"idle" json:"idle,omitempty"`
|
|
111
|
111
|
} `toml:"timeout" json:"timeout,omitempty"`
|
|
112
|
|
- DOHIP string `toml:"doh-ip" json:"doh-ip,omitempty"`
|
|
|
112
|
+ DOHIP string `toml:"doh-ip" json:"dohIp,omitempty"`
|
|
113
|
113
|
Proxies []string `toml:"proxies" json:"proxies,omitempty"`
|
|
114
|
114
|
} `toml:"network" json:"network,omitempty"`
|
|
115
|
115
|
Stats struct {
|
|
116
|
116
|
StatsD struct {
|
|
117
|
117
|
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
|
118
|
118
|
Address string `toml:"address" json:"address,omitempty"`
|
|
119
|
|
- MetricPrefix string `toml:"metric-prefix" json:"metric-prefix,omitempty"`
|
|
120
|
|
- TagFormat string `toml:"tag-format" json:"tag-format,omitempty"`
|
|
|
119
|
+ MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
|
|
|
120
|
+ TagFormat string `toml:"tag-format" json:"tagFormat,omitempty"`
|
|
121
|
121
|
} `toml:"statsd" json:"statsd,omitempty"`
|
|
122
|
122
|
Prometheus struct {
|
|
123
|
123
|
Enabled bool `toml:"enabled" json:"enabled,omitempty"`
|
|
124
|
|
- BindTo string `toml:"bind-to" json:"bind-to,omitempty"`
|
|
125
|
|
- HTTPPath string `toml:"http-path" json:"http-path,omitempty"`
|
|
126
|
|
- MetricPrefix string `toml:"metric-prefix" json:"metric-prefix,omitempty"`
|
|
|
124
|
+ BindTo string `toml:"bind-to" json:"bindTo,omitempty"`
|
|
|
125
|
+ HTTPPath string `toml:"http-path" json:"httpPath,omitempty"`
|
|
|
126
|
+ MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
|
|
127
|
127
|
} `toml:"prometheus" json:"prometheus,omitempty"`
|
|
128
|
128
|
} `toml:"stats" json:"stats,omitempty"`
|
|
129
|
129
|
}
|