From 19faeb52bfd228ec748df39460b4b4f8a3f031f5 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Fri, 3 Jul 2026 17:22:43 +0900 Subject: [PATCH] nix: add zoekt search url configuration to knotmirror Signed-off-by: Seongmin Lee --- docker-compose.yml | 2 +- knotmirror/resyncer.go | 2 +- nix/modules/knotmirror.nix | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4e3b42f6..0a10bad2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -264,7 +264,7 @@ services: MIRROR_KNOT_USE_SSL: "true" MIRROR_KNOT_SSRF: "true" MIRROR_RESYNC_PARALLELISM: "4" - MIRROR_SEARCH_ZOEKT_URL: https://zoekt.tngl.boltless.dev + MIRROR_SEARCH_ZOEKT_URL: https://zoekt.tngl.boltless.dev/indexserver volumes: - knotmirror-data:/data - ./localinfra/certs/root.crt:/usr/local/share/ca-certificates/caddy.crt:ro diff --git a/knotmirror/resyncer.go b/knotmirror/resyncer.go index 3072651b..4d64466f 100644 --- a/knotmirror/resyncer.go +++ b/knotmirror/resyncer.go @@ -426,7 +426,7 @@ func (r *Resyncer) requestIndex(ctx context.Context, repoDid syntax.DID, branche return fmt.Errorf("marshaling index request: %w", err) } - endpoint := r.cfg.Search.ZoektUrl + "/indexserver/admin/enqueueIndex" + endpoint := r.cfg.Search.ZoektUrl + "/admin/enqueueIndex" req, err := http.NewRequestWithContext(ctx, http.MethodPost, endpoint, bytes.NewReader(body)) if err != nil { return err diff --git a/nix/modules/knotmirror.nix b/nix/modules/knotmirror.nix index d981fd0a..7f5ef0eb 100644 --- a/nix/modules/knotmirror.nix +++ b/nix/modules/knotmirror.nix @@ -84,6 +84,12 @@ in description = "enable SSRF protection for knots"; }; + zoektUrl = mkOption { + type = types.str; + example = "https://zoekt.tngl.boltless.dev/indexserver"; + description = "zoekt-tnglserver url"; + }; + tap = { port = mkOption { type = types.port; @@ -158,6 +164,7 @@ in "MIRROR_METRICS_LISTEN=${cfg.metricsListenAddr}" "MIRROR_ADMIN_LISTEN=${cfg.adminListenAddr}" "MIRROR_SLURPER_CONCURRENCY=4" + "MIRROR_SEARCH_ZOEKT_URL=${cfg.zoektUrl}" ]; ExecStart = "${getExe cfg.package} serve"; Restart = "always"; -- 2.51.2