aboutsummaryrefslogtreecommitdiff
path: root/src/Main.c
diff options
context:
space:
mode:
authorfrosty <gabriel@bwaaa.monster>2026-08-03 23:21:41 -0400
committerfrosty <gabriel@bwaaa.monster>2026-08-03 23:21:41 -0400
commit7b587d82c874df275f147eb461f6389163547e4e (patch)
treefc6ce57519cee8098d5864e17a8c18b46ce94e20 /src/Main.c
parent953937cfa2bb0fefc2e6e13cf19e34a09fa045dc (diff)
downloadomnisearch-7b587d82c874df275f147eb461f6389163547e4e.tar.gz
feat: add yacy support
Diffstat (limited to 'src/Main.c')
-rw-r--r--src/Main.c18
1 files changed, 18 insertions, 0 deletions
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,