fix(ecosia): wire proxy policy, validation, raw mode, and OpenAPI docs

This commit is contained in:
Rustem Kamalov
2026-05-05 02:47:47 +03:00
parent 718fad0542
commit 3eaa30118e
5 changed files with 10 additions and 6 deletions
+1
View File
@@ -13,6 +13,7 @@ func buildEngineProxyPolicyMap() map[string]string {
"baidu": config.BaiduConfig.Proxy,
"bing": config.BingConfig.Proxy,
"duckduckgo": config.DuckDuckGoConfig.Proxy,
"ecosia": config.EcosiaConfig.Proxy,
}
}
+2 -2
View File
@@ -16,7 +16,7 @@ import (
)
const (
version = "0.7.7"
version = "0.7.8"
defaultConfigFilename = "config"
envPrefix = "OPENSERP"
)
@@ -317,7 +317,7 @@ func initializeConfig(cmd *cobra.Command) error {
}
func validateEngineProxyTags(v *viper.Viper) error {
for _, engineName := range []string{"google", "yandex", "baidu", "bing", "duckduckgo"} {
for _, engineName := range []string{"google", "yandex", "baidu", "bing", "duckduckgo", "ecosia"} {
key := engineName + ".proxy"
if !v.IsSet(key) {
continue
+3
View File
@@ -39,6 +39,8 @@ func (r *rawEngine) Search(ctx context.Context, q core.Query) ([]core.SearchResu
return yandex.Search(ctx, q)
case "baidu":
return baidu.Search(ctx, q)
case "ecosia":
return ecosia.Search(ctx, q)
default:
return nil, fmt.Errorf("unsupported engine: %s", r.name)
}
@@ -102,6 +104,7 @@ func serve(cmd *cobra.Command, args []string) {
&rawEngine{name: "google"},
&rawEngine{name: "yandex"},
&rawEngine{name: "baidu"},
&rawEngine{name: "ecosia"},
)
if err := listenWithGracefulShutdown(serv, nil); err != nil {
logrus.Error(err)