From 485ed0fec2e892944845dd125a4cd3342f4ca8cc Mon Sep 17 00:00:00 2001 From: June Date: Mon, 22 Jan 2024 17:59:01 +0100 Subject: [PATCH] Use opensearch for code and issue search --- config/hosts/git/default.nix | 1 + config/hosts/git/forgejo.nix | 7 +++++++ config/hosts/git/opensearch.nix | 12 ++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 config/hosts/git/opensearch.nix diff --git a/config/hosts/git/default.nix b/config/hosts/git/default.nix index e2f517b..0f4664e 100644 --- a/config/hosts/git/default.nix +++ b/config/hosts/git/default.nix @@ -6,6 +6,7 @@ ./forgejo.nix ./networking.nix ./nginx.nix + ./opensearch.nix ./redis.nix ]; } diff --git a/config/hosts/git/forgejo.nix b/config/hosts/git/forgejo.nix index cd8477a..d571fb6 100644 --- a/config/hosts/git/forgejo.nix +++ b/config/hosts/git/forgejo.nix @@ -66,6 +66,13 @@ ADAPTER = "redis"; HOST = "redis+socket:///run/redis-forgejo/redis.sock"; }; + indexer = { + ISSUE_INDEXER_TYPE = "elasticsearch"; + ISSUE_INDEXER_CONN_STR = "http://127.0.0.1:9200"; + REPO_INDEXER_ENABLED = true; + REPO_INDEXER_TYPE = "elasticsearch"; + REPO_INDEXER_CONN_STR = "http://127.0.0.1:9200"; + }; }; }; diff --git a/config/hosts/git/opensearch.nix b/config/hosts/git/opensearch.nix new file mode 100644 index 0000000..1dc4490 --- /dev/null +++ b/config/hosts/git/opensearch.nix @@ -0,0 +1,12 @@ +{ ... }: + +{ + services.opensearch = { + enable = true; + }; + + systemd.services.forgejo = { + after = [ "opensearch.service" ]; + requires = [ "opensearch.service" ]; + }; +}