Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ ignoreWords:
- codeberg
- sourcehut
- uwsgi
- valkey
- startpage
- crossref
- freesound
Expand Down
13 changes: 13 additions & 0 deletions src/modules/services/searxng/raise-api-limit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/searx/botdetection/ip_limit.py b/searx/botdetection/ip_limit.py
index b2559a97b..fbdc318fe 100644
--- a/searx/botdetection/ip_limit.py
+++ b/searx/botdetection/ip_limit.py
@@ -79,7 +79,7 @@ LONG_MAX_SUSPICIOUS = 10
API_WINDOW = 3600
"""Time (sec) before sliding window for API requests (format != html) expires."""

-API_MAX = 4
+API_MAX = 60
"""Maximum requests from one IP in the :py:obj:`API_WINDOW`"""

SUSPICIOUS_IP_WINDOW = 3600 * 24 * 30
16 changes: 14 additions & 2 deletions src/modules/services/searxng/searxng.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
machines.nixosModules.searxng =
{
pkgs,
config,
lib,
...
Expand All @@ -11,6 +12,10 @@

hardware = config.dot.hardware;

searxng = pkgs.searxng.overridePythonAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./raise-api-limit.patch ];
});

failingEngines = [
# NOTE: these don't even pass a start check
"torch"
Expand Down Expand Up @@ -39,24 +44,31 @@
url = "http://${address}:${builtins.toString port}";
};

services.redis.package = pkgs.valkey;

services.searx = {
enable = true;

package = searxng;

configureUwsgi = false;
redisCreateLocally = false;
redisCreateLocally = true;

settings = {
search.formats = [
"html"
"json"
];

server = {
port = port;
bind_address = address;
secret_key = "local-only";
limiter = false;
limiter = true;
};

use_default_settings.engines.remove = failingEngines;

engines =
defaultEngines
++ (builtins.map
Expand Down
Loading