feat(docker): добавлен локальный SearXNG для веб-поиска из opencode
- Зачем: - модели в opencode не имели доступа к поиску без платных API. - Что: - добавлен docker-compose для SearXNG (localhost:57458, без valkey). - секрет подставляется из .env через generate-config.sh при старте. - добавлен MCP-сервер searxng в конфиг opencode. - env_file с fallback: .env.sample работает из коробки, .env опционален. - Проверка: - cd docker/searxng && docker compose up -d. - curl http://localhost:57458/search?q=test&format=json. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d3a91bea95
commit
168b40ddd7
6 files changed
+46
No files matched your search
@@ -3,6 +3,7 @@ nul
|
|||||||
|
|
||||||
# Secrets
|
# Secrets
|
||||||
.env.secrets
|
.env.secrets
|
||||||
|
docker/searxng/.env
|
||||||
|
|
||||||
# Opencode local files
|
# Opencode local files
|
||||||
opencode/.config/opencode/package.json
|
opencode/.config/opencode/package.json
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
SEARXNG_SECRET_KEY=2575fd7919a0d30f5fbc36091d4dabb27784009bf5878617eb6005c4f0a0fef1
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
sed "s|\${SEARXNG_SECRET_KEY}|${SEARXNG_SECRET_KEY}|g" \
|
||||||
|
/tmpl/settings.yml > /etc/searxng/settings.yml
|
||||||
|
exec /usr/local/searxng/entrypoint.sh "$@"
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
use_default_settings: true
|
||||||
|
|
||||||
|
server:
|
||||||
|
secret_key: "${SEARXNG_SECRET_KEY}"
|
||||||
|
|
||||||
|
search:
|
||||||
|
formats:
|
||||||
|
- html
|
||||||
|
- json
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
name: searxng
|
||||||
|
|
||||||
|
services:
|
||||||
|
core:
|
||||||
|
container_name: searxng-core
|
||||||
|
image: docker.io/searxng/searxng:latest
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:57458:8080"
|
||||||
|
env_file:
|
||||||
|
- ./.env.sample
|
||||||
|
- path: ./.env
|
||||||
|
required: false
|
||||||
|
entrypoint: ["/bin/sh", "/tmpl/generate-config.sh"]
|
||||||
|
volumes:
|
||||||
|
- ./core-config/:/tmpl/:ro
|
||||||
|
- core-config:/etc/searxng/
|
||||||
|
- core-data:/var/cache/searxng/
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
core-config:
|
||||||
|
core-data:
|
||||||
@@ -46,6 +46,14 @@
|
|||||||
},
|
},
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
|
"searxng": {
|
||||||
|
"type": "local",
|
||||||
|
"command": ["npx", "-y", "mcp-searxng"],
|
||||||
|
"environment": {
|
||||||
|
"SEARXNG_URL": "http://localhost:57458"
|
||||||
|
},
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
"playwright": {
|
"playwright": {
|
||||||
"type": "local",
|
"type": "local",
|
||||||
"command": ["npx", "-y", "@playwright/mcp@latest"],
|
"command": ["npx", "-y", "@playwright/mcp@latest"],
|
||||||
|
|||||||
Reference in new issue
Block a user