fix(search): AIUI web search was 403ing on every query
SearXNG defaults to `formats: [html]`. Its JSON API answers 403 — and JSON is the only thing AIUI's web search speaks, since `/aiui/api/web-search` proxies straight through to `/search`. Both places that seed settings.yml (the first-boot script and the installer) omitted `search.formats`, so web search has never worked on a node whose SearXNG was installed, running and healthy. It reads as the assistant being unable to search rather than as one missing config key. Verified on archi-dev-box: `format=json` went 403 -> 200, returning 28 results for "bitcoin halving" from Brave and DuckDuckGo. Google and Startpage self-suspend on a self-hosted instance (access denied / CAPTCHA), which is expected and costs little given Brave's independent index. Existing nodes need the same two lines added to /var/lib/archipelago/searxng/settings.yml and a restart; this commit only fixes what new installs get. Also fixes a build break: `fetchLibraryContent` built a bundle literal that predates the images bucket. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
9abc162394
commit
c810b514ed
@@ -720,7 +720,14 @@ impl RpcHandler {
|
||||
)?;
|
||||
let secret_hex = hex::encode(secret);
|
||||
let settings = format!(
|
||||
"use_default_settings: true\ngeneral:\n instance_name: Archipelago Search\nserver:\n secret_key: \"{}\"\n bind_address: \"0.0.0.0\"\n port: 8080\n limiter: false\nui:\n default_theme: simple\n",
|
||||
// `search.formats` MUST include json. SearXNG's default is
|
||||
// html-only, so the JSON API answers 403 — and AIUI's web
|
||||
// search is a JSON client (`/aiui/api/web-search` proxies
|
||||
// straight to `/search`). Without this line every AIUI web
|
||||
// search fails on a node whose SearXNG is running
|
||||
// perfectly, which reads as the AI being unable to search
|
||||
// rather than as one missing config key.
|
||||
"use_default_settings: true\ngeneral:\n instance_name: Archipelago Search\nserver:\n secret_key: \"{}\"\n bind_address: \"0.0.0.0\"\n port: 8080\n limiter: false\nsearch:\n formats:\n - html\n - json\nui:\n default_theme: simple\n",
|
||||
secret_hex
|
||||
);
|
||||
tokio::fs::create_dir_all(searx_dir)
|
||||
|
||||
@@ -538,7 +538,7 @@ export class ContextBroker {
|
||||
method: 'music.list-tracks',
|
||||
params: { limit: 500 },
|
||||
})
|
||||
return { films: [], songs: adaptLibraryTracks(res.tracks ?? []), podcasts: [] }
|
||||
return { ...emptyBundle(), songs: adaptLibraryTracks(res.tracks ?? []) }
|
||||
} catch {
|
||||
return emptyBundle()
|
||||
}
|
||||
|
||||
@@ -1225,6 +1225,12 @@ server:
|
||||
bind_address: "0.0.0.0"
|
||||
port: 8080
|
||||
limiter: false
|
||||
# json is required: SearXNG defaults to html-only and answers 403 on the
|
||||
# JSON API, which is the only thing AIUI's web search speaks.
|
||||
search:
|
||||
formats:
|
||||
- html
|
||||
- json
|
||||
ui:
|
||||
default_theme: simple
|
||||
SEARXCFG
|
||||
|
||||
Reference in New Issue
Block a user