Skip to content

Commit e773ef9

Browse files
linusfrisandydoo
andauthored
Fix/meilisearch 'error: invalid value '1' for '--no-analytics' (#1741)
Co-authored-by: sander <[email protected]>
1 parent 8e5d3c0 commit e773ef9

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

src/modules/services/meilisearch.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ in
7676

7777
env.MEILI_DB_PATH = config.env.DEVENV_STATE + "/meilisearch";
7878
env.MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}";
79-
env.MEILI_NO_ANALYTICS = toString cfg.noAnalytics;
79+
env.MEILI_NO_ANALYTICS = lib.boolToString cfg.noAnalytics;
8080
env.MEILI_ENV = cfg.environment;
8181
env.MEILI_DUMP_DIR = config.env.MEILI_DB_PATH + "/dumps";
8282
env.MEILI_LOG_LEVEL = cfg.logLevel;

tests/meilisearch/devenv.nix

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{ pkgs, ... }:
2+
let
3+
port = 7700;
4+
in
5+
{
6+
7+
config = {
8+
services.meilisearch = {
9+
enable = true;
10+
listenPort = port;
11+
noAnalytics = true;
12+
listenAddress = "127.0.0.1";
13+
};
14+
15+
scripts.meilisearch-healthcheck.exec = ''
16+
RUNNING=$(${pkgs.curl}/bin/curl -s 127.0.0.1:${toString port}/health | grep "available")
17+
18+
if [[ -z "$RUNNING" ]]; then
19+
exit 1
20+
else
21+
exit 0
22+
fi
23+
'';
24+
25+
enterTest = ''
26+
wait_for_port ${toString port}
27+
28+
timeout 5 bash -c "until meilisearch-healthcheck; do sleep 1; done"
29+
'';
30+
};
31+
}

0 commit comments

Comments
 (0)