Migrate to stdlib ECH support

This commit is contained in:
世界
2025-02-22 08:00:59 +08:00
parent 277dfc7c44
commit 417726e3e0
32 changed files with 654 additions and 895 deletions

View File

@@ -179,6 +179,13 @@ var OptionMissingDomainResolver = Note{
MigrationLink: "https://sing-box.sagernet.org/migration/#migrate-outbound-dns-rule-items-to-domain-resolver",
}
var OptionLegacyECHOptions = Note{
Name: "legacy-ech-options",
Description: "legacy ECH options",
DeprecatedVersion: "1.12.0",
ScheduledVersion: "1.13.0",
}
var Options = []Note{
OptionBadMatchSource,
OptionGEOIP,
@@ -194,4 +201,5 @@ var Options = []Note{
OptionLegacyDNSFakeIPOptions,
OptionOutboundDNSRuleItem,
OptionMissingDomainResolver,
OptionLegacyECHOptions,
}

View File

@@ -28,11 +28,15 @@ func (f *stderrManager) ReportDeprecated(feature Note) {
f.logger.Warn(feature.MessageWithLink())
return
}
enable, enableErr := strconv.ParseBool(os.Getenv("ENABLE_DEPRECATED_" + feature.EnvName))
if enableErr == nil && enable {
f.logger.Warn(feature.MessageWithLink())
return
if feature.EnvName != "" {
enable, enableErr := strconv.ParseBool(os.Getenv("ENABLE_DEPRECATED_" + feature.EnvName))
if enableErr == nil && enable {
f.logger.Warn(feature.MessageWithLink())
return
}
f.logger.Error(feature.MessageWithLink())
f.logger.Fatal("to continuing using this feature, set environment variable ENABLE_DEPRECATED_" + feature.EnvName + "=true")
} else {
f.logger.Error(feature.MessageWithLink())
}
f.logger.Error(feature.MessageWithLink())
f.logger.Fatal("to continuing using this feature, set environment variable ENABLE_DEPRECATED_" + feature.EnvName + "=true")
}