configure anonymous SearXNG provider defaults
This commit is contained in:
1 parent
e6670f914f
commit
2693259227
4 files changed
+170
-16
No files matched your search
@@ -63,13 +63,32 @@ import sys, yaml
|
||||
with open(sys.argv[1]) as fh:
|
||||
data = yaml.safe_load(fh)
|
||||
outgoing = data.get("outgoing", {})
|
||||
assert outgoing.get("request_timeout") == 4.0, outgoing
|
||||
assert outgoing.get("max_request_timeout") == 12.0, outgoing
|
||||
assert outgoing.get("request_timeout") == 5.0, outgoing
|
||||
assert outgoing.get("max_request_timeout") == 15.0, outgoing
|
||||
assert outgoing.get("retries") == 1, outgoing
|
||||
assert outgoing["request_timeout"] < outgoing["max_request_timeout"], outgoing
|
||||
PYEOF
|
||||
}
|
||||
|
||||
@test "SearXNG default provider policy favors anonymous healthy engines" {
|
||||
python3 - "$REPO_ROOT/shared/searxng/settings.yml" <<'PYEOF'
|
||||
import sys, yaml
|
||||
with open(sys.argv[1]) as fh:
|
||||
data = yaml.safe_load(fh)
|
||||
engines = {entry["name"]: entry for entry in data.get("engines", [])}
|
||||
assert engines["bing"]["disabled"] is False, engines.get("bing")
|
||||
assert engines["bing"]["weight"] > 1, engines["bing"]
|
||||
assert engines["bing"]["paging"] is False, engines["bing"]
|
||||
assert engines["duckduckgo"]["disabled"] is False, engines["duckduckgo"]
|
||||
assert engines["duckduckgo"]["paging"] is False, engines["duckduckgo"]
|
||||
for name in ("google cse", "startpage", "brave"):
|
||||
assert engines[name]["disabled"] is True, engines.get(name)
|
||||
assert engines[name].get("inactive", False) is False, engines[name]
|
||||
for name in ("bing", "duckduckgo", "wikipedia"):
|
||||
assert engines[name]["timeout"] == 5.0, engines[name]
|
||||
PYEOF
|
||||
}
|
||||
|
||||
@test "deploy.sh copies limiter.toml into /opt/searxng/config" {
|
||||
grep -q "shared/searxng/limiter.toml" "$REPO_ROOT/scripts/deploy.sh" \
|
||||
|| { echo "deploy.sh does not copy shared/searxng/limiter.toml"; return 1; }
|
||||
|
||||
Reference in new issue
Block a user