From 7b587d82c874df275f147eb461f6389163547e4e Mon Sep 17 00:00:00 2001 From: frosty Date: Mon, 3 Aug 2026 23:21:41 -0400 Subject: feat: add yacy support --- src/Main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Main.c') diff --git a/src/Main.c b/src/Main.c index d7ff185..868244c 100644 --- a/src/Main.c +++ b/src/Main.c @@ -78,6 +78,7 @@ int main() { .cache_ttl_infobox = DEFAULT_CACHE_TTL_INFOBOX, .cache_ttl_image = DEFAULT_CACHE_TTL_IMAGE, .engines = "", + .yacy_instance = "", .rate_limit_search_requests = 0, .rate_limit_search_interval = 0, .rate_limit_images_requests = 0, @@ -101,6 +102,23 @@ int main() { } apply_engines_config(cfg.engines); + configure_yacy_engine(cfg.yacy_instance); + + if (cfg.yacy_instance[0] != '\0') { + int yacy_enabled = 0; + for (int i = 0; i < ENGINE_COUNT; i++) { + if (strcmp(ENGINE_REGISTRY[i].id, "yacy") == 0) { + yacy_enabled = ENGINE_REGISTRY[i].enabled; + break; + } + } + if (!yacy_enabled) { + fprintf( + stderr, + "[INFO] YaCy instance configured but the yacy engine is not " + "enabled (add it to the engines list, e.g. engines=\"*,yacy\")\n"); + } + } if (cache_init(cfg.cache_dir) != 0) { fprintf(stderr, -- cgit v1.3