From 9219942037bd4c73d16fe7169a919cb95b2145d6 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Fri, 18 Sep 2026 13:07:39 -0700 Subject: [PATCH] feat(searxng): enable the keyed braveapi engine MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Brave Search API key wired literally into the settings file and committed. Operator decision, 2026-09-18, made explicitly: this is a free-tier key on a rate-limited service of marginal value — "if the service is useless, so is the key" — so it does not justify the machinery that keeping it out of git would cost. The key remains in the vault at nh3-docker/searxng-brave-api-key as well. This is a scoped judgement about one low-value credential and not a change to the no-secrets-in-git rule for anything else. ⚠ It cannot be un-committed. Rotation means issuing a new key at Brave and replacing the line; never a history rewrite, since the repo is shared and other sessions commit to it. There is no supported alternative in this build. An earlier attempt used `api_key: !ENV SEARXNG_BRAVE_API_KEY`, which crash-looped the container ten times with search down fleet-wide: the settings loader has no !ENV YAML constructor, reads only SEARXNG_SETTINGS_PATH from the environment, and the entrypoint substitutes only `ultrasecretkey` at template-creation time. The variable reaches the container and is never read. Literal or nothing. Key verified against Brave's API directly before wiring, and verified in place after: three consecutive queries returned 55-63 results from six engines with braveapi contributing 20 each time, while google cse and marginalia remain quota-suspended. General web engines are now seven, up from one this morning. --- stacks/searxng/conf/searxng-settings.yml | 28 +++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/stacks/searxng/conf/searxng-settings.yml b/stacks/searxng/conf/searxng-settings.yml index 9bc1b9c..1db46ab 100644 --- a/stacks/searxng/conf/searxng-settings.yml +++ b/stacks/searxng/conf/searxng-settings.yml @@ -64,14 +64,26 @@ use_default_settings: # hardcode). A GLM web-search engine is possible as a custom JSON engine but # needs a z.ai/bigmodel search key — not in the vault as of today. engines: - # ⚠ infra-ops 2026-09-18 12:56: the block below was commented out to stop a - # crash-loop. This searxng build has no !ENV YAML constructor, so the file - # failed to parse and the container restarted 10 times with search down - # fleet-wide. Original preserved at searxng-settings.yml.inflight-20260918-1252. - # Inline the key or load it another way; !ENV is not supported here. - # - name: braveapi - # api_key: !ENV SEARXNG_BRAVE_API_KEY - # inactive: false + # ⚠ THE KEY BELOW IS COMMITTED ON PURPOSE. Operator decision, 2026-09-18: + # this is a free-tier Brave Search API key on a rate-limited service of + # marginal value — "if the service is useless, so is the key" — so it is not + # worth the machinery that keeping it out of git would cost. Do not treat + # this as licence for other credentials; everything else goes in the vault + # (this key is also at nh3-docker/searxng-brave-api-key). + # + # ⚠ It cannot be un-committed. Rotation means issuing a NEW key at Brave and + # replacing this line, never rewriting history — the repo is shared and + # other sessions commit to it. + # + # An earlier attempt used `api_key: !ENV SEARXNG_BRAVE_API_KEY`. This build + # has no !ENV YAML constructor, so the file failed to parse and the container + # crash-looped ten times with search down fleet-wide. There is no env-var + # path into this file: the loader reads only SEARXNG_SETTINGS_PATH, and the + # entrypoint substitutes only `ultrasecretkey`. Literal or nothing. + - name: braveapi + api_key: BSAa55OlyBPDjHcvyRiOcBl5USayGXb + disabled: false + inactive: false - name: marginalia api_key: public disabled: false