2022-07-28 11:00:05 -04:00
|
|
|
package conf
|
2022-06-01 13:35:41 -04:00
|
|
|
|
2023-05-16 21:46:52 -04:00
|
|
|
type NodeConfig struct {
|
|
|
|
ApiConfig *ApiConfig `yaml:"ApiConfig"`
|
|
|
|
ControllerConfig *ControllerConfig `yaml:"ControllerConfig"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ApiConfig struct {
|
|
|
|
APIHost string `yaml:"ApiHost"`
|
|
|
|
NodeID int `yaml:"NodeID"`
|
|
|
|
Key string `yaml:"ApiKey"`
|
|
|
|
NodeType string `yaml:"NodeType"`
|
|
|
|
Timeout int `yaml:"Timeout"`
|
|
|
|
RuleListPath string `yaml:"RuleListPath"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ControllerConfig struct {
|
2023-06-18 21:33:20 -04:00
|
|
|
ListenIP string `yaml:"ListenIP"`
|
|
|
|
SendIP string `yaml:"SendIP"`
|
|
|
|
EnableProxyProtocol bool `yaml:"EnableProxyProtocol"`
|
|
|
|
XrayOptions XrayOptions `yaml:"XrayOptions"`
|
|
|
|
HyOptions HyOptions `yaml:"HyOptions"`
|
|
|
|
LimitConfig LimitConfig `yaml:"LimitConfig"`
|
|
|
|
CertConfig *CertConfig `yaml:"CertConfig"`
|
2023-06-08 10:46:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type XrayOptions struct {
|
|
|
|
EnableDNS bool `yaml:"EnableDNS"`
|
|
|
|
DNSType string `yaml:"DNSType"`
|
|
|
|
EnableVless bool `yaml:"EnableVless"`
|
2023-06-24 20:22:05 -04:00
|
|
|
VlessFlow string `json:"VlessFlow"`
|
2023-06-08 10:46:33 -04:00
|
|
|
EnableUot bool `yaml:"EnableUot"`
|
|
|
|
EnableTFO bool `yaml:"EnableTFO"`
|
|
|
|
DisableIVCheck bool `yaml:"DisableIVCheck"`
|
|
|
|
DisableSniffing bool `yaml:"DisableSniffing"`
|
|
|
|
EnableFallback bool `yaml:"EnableFallback"`
|
|
|
|
FallBackConfigs []FallBackConfig `yaml:"FallBackConfigs"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type HyOptions struct {
|
|
|
|
Resolver string `yaml:"Resolver"`
|
|
|
|
ResolvePreference string `yaml:"ResolvePreference"`
|
|
|
|
SendDevice string `yaml:"SendDevice"`
|
2023-05-16 21:46:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type LimitConfig struct {
|
|
|
|
EnableRealtime bool `yaml:"EnableRealtime"`
|
|
|
|
SpeedLimit int `yaml:"SpeedLimit"`
|
|
|
|
IPLimit int `yaml:"DeviceLimit"`
|
|
|
|
ConnLimit int `yaml:"ConnLimit"`
|
|
|
|
EnableIpRecorder bool `yaml:"EnableIpRecorder"`
|
|
|
|
IpRecorderConfig *IpReportConfig `yaml:"IpRecorderConfig"`
|
|
|
|
EnableDynamicSpeedLimit bool `yaml:"EnableDynamicSpeedLimit"`
|
|
|
|
DynamicSpeedLimitConfig *DynamicSpeedLimitConfig `yaml:"DynamicSpeedLimitConfig"`
|
2022-06-01 13:35:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type FallBackConfig struct {
|
2022-09-12 23:08:20 -04:00
|
|
|
SNI string `yaml:"SNI"`
|
|
|
|
Alpn string `yaml:"Alpn"`
|
|
|
|
Path string `yaml:"Path"`
|
|
|
|
Dest string `yaml:"Dest"`
|
|
|
|
ProxyProtocolVer uint64 `yaml:"ProxyProtocolVer"`
|
2022-06-01 13:35:41 -04:00
|
|
|
}
|
2022-07-28 11:00:05 -04:00
|
|
|
|
2022-10-20 23:07:04 -04:00
|
|
|
type RecorderConfig struct {
|
|
|
|
Url string `yaml:"Url"`
|
|
|
|
Token string `yaml:"Token"`
|
|
|
|
Timeout int `yaml:"Timeout"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type RedisConfig struct {
|
|
|
|
Address string `yaml:"Address"`
|
|
|
|
Password string `yaml:"Password"`
|
|
|
|
Db int `yaml:"Db"`
|
2022-11-17 21:18:26 -05:00
|
|
|
Expiry int `json:"Expiry"`
|
2022-10-20 23:07:04 -04:00
|
|
|
}
|
|
|
|
|
2022-07-28 11:00:05 -04:00
|
|
|
type IpReportConfig struct {
|
2022-10-20 23:07:04 -04:00
|
|
|
Periodic int `yaml:"Periodic"`
|
|
|
|
Type string `yaml:"Type"`
|
|
|
|
RecorderConfig *RecorderConfig `yaml:"RecorderConfig"`
|
|
|
|
RedisConfig *RedisConfig `yaml:"RedisConfig"`
|
|
|
|
EnableIpSync bool `yaml:"EnableIpSync"`
|
2022-07-28 11:00:05 -04:00
|
|
|
}
|
|
|
|
|
2022-09-07 11:02:02 -04:00
|
|
|
type DynamicSpeedLimitConfig struct {
|
2022-12-18 10:31:06 -05:00
|
|
|
Periodic int `yaml:"Periodic"`
|
|
|
|
Traffic int64 `yaml:"Traffic"`
|
|
|
|
SpeedLimit int `yaml:"SpeedLimit"`
|
|
|
|
ExpireTime int `yaml:"ExpireTime"`
|
2022-09-07 11:02:02 -04:00
|
|
|
}
|
|
|
|
|
2023-05-16 21:46:52 -04:00
|
|
|
type CertConfig struct {
|
|
|
|
CertMode string `yaml:"CertMode"` // none, file, http, dns
|
|
|
|
RejectUnknownSni bool `yaml:"RejectUnknownSni"`
|
|
|
|
CertDomain string `yaml:"CertDomain"`
|
|
|
|
CertFile string `yaml:"CertFile"`
|
|
|
|
KeyFile string `yaml:"KeyFile"`
|
|
|
|
Provider string `yaml:"Provider"` // alidns, cloudflare, gandi, godaddy....
|
|
|
|
Email string `yaml:"Email"`
|
|
|
|
DNSEnv map[string]string `yaml:"DNSEnv"`
|
2023-06-02 10:55:53 -04:00
|
|
|
RealityConfig *RealityConfig `yaml:"RealityConfig"`
|
2022-07-28 11:00:05 -04:00
|
|
|
}
|
2023-05-21 22:36:10 -04:00
|
|
|
|
|
|
|
type RealityConfig struct {
|
2023-06-24 20:22:05 -04:00
|
|
|
Dest interface{} `yaml:"Dest" json:"Dest"`
|
|
|
|
Xver uint64 `yaml:"Xver" json:"Xver"`
|
|
|
|
ServerNames []string `yaml:"ServerNames" json:"ServerNames"`
|
|
|
|
PrivateKey string `yaml:"PrivateKey" json:"PrivateKey"`
|
|
|
|
MinClientVer string `yaml:"MinClientVer" json:"MinClientVer"`
|
|
|
|
MaxClientVer string `yaml:"MaxClientVer" json:"MaxClientVer"`
|
|
|
|
MaxTimeDiff uint64 `yaml:"MaxTimeDiff" json:"MaxTimeDiff"`
|
|
|
|
ShortIds []string `yaml:"ShortIds" json:"ShortIds"`
|
2023-05-21 22:36:10 -04:00
|
|
|
}
|