Stay Hungry,Stay Foolish!

searxng

searxng

https://github.com/searxng/searxng

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

 

 

 

Privacy-respecting, hackable metasearch engine

Searx.space lists ready-to-use running instances.

A user, admin and developer handbook is available on the homepage.

SearXNG install SearXNG homepage SearXNG wiki AGPL License Issues commits weblate SearXNG logo


Contact

Ask questions or chat with the SearXNG community (this not a chatbot) on

IRC
#searxng on libera.chat which is bridged to Matrix.
Matrix
#searxng:matrix.org

Setup

 

searXNG是怎么获得各种搜索引擎的访问权限的?

https://www.bilibili.com/video/BV1Nqd6YKEhR/?spm_id_from=333.337.search-card.all.click&vd_source=57e261300f39bf692de396b55bf8c41b

 

SearXNG 作为一款开源的元搜索引擎,其获取各种搜索引擎访问权限的方式主要依赖于以下机制和技术手段,结合搜索结果中的信息总结如下:


1. ​​直接网页抓取(无需API权限)​

  • ​原理​​:SearXNG 通过模拟浏览器请求(如 HTTP GET/POST)直接抓取目标搜索引擎的公开网页结果页,解析 HTML 结构提取搜索内容。这种方式无需官方 API 授权,但可能受目标网站的反爬机制限制。
  • ​适用场景​​:适用于百度、Bing 等未严格封锁爬虫的搜索引擎。例如,通过配置 settings.yml 中的 search_url 字段指定目标引擎的搜索链接模板(如百度:https://www.baidu.com/s?wd={query})。
  • ​限制​​:稳定性较差,可能因网页结构变更或反爬策略导致失效。

2. ​​调用官方API(需API Key)​

  • ​原理​​:部分搜索引擎(如 Google、Bing)提供付费 API 接口。SearXNG 支持通过配置 API Key 调用这些接口,获取结构化数据(如 JSON 格式结果)。
  • ​配置方法​​:在 settings.yml 中为特定引擎(如 Bing)添加 API Key 参数,例如:
    engines:
      - name: bing
        api_key: "your_api_key"
        disabled: false
  • ​优势​​:结果更稳定、格式规范,适合企业级应用。
  • ​限制​​:需付费或申请免费额度,且部分 API 在国内网络环境下访问受限。

3. ​​自定义插件扩展​

  • ​开发插件​​:SearXNG 允许用户编写 Python 插件(继承 Engine 类),实现特定搜索引擎的定制化访问逻辑。例如,通过 fetch_results 方法处理请求和解析响应。
  • ​案例​​:如添加微信公众号搜索插件,需解析微信的接口或网页结构,并映射到 SearXNG 的标准化结果格式。
  • ​灵活性​​:适用于小众或私有数据源,但需维护代码适配性。

4. ​​利用开源引擎集成​

  • ​内置引擎支持​​:SearXNG 默认集成了数十种开源或公共搜索引擎(如 Wikipedia、DuckDuckGo),这些引擎本身提供开放的 API 或无权限要求的访问方式。
  • ​配置调整​​:通过 settings.ymlengines 部分启用或禁用特定引擎,例如禁用国内无法访问的 DuckDuckGo,启用 Bilibili 等本地化引擎。

5. ​​代理与反反爬策略​

  • ​IP轮换与延迟​​:为避免被封禁,SearXNG 支持配置请求延迟和代理服务器,例如通过 Docker 环境变量设置代理。
  • ​结果缓存​​:结合 Redis 缓存搜索结果,减少对目标引擎的频繁请求。

常见问题与优化

  • ​国内网络适配​​:需禁用无法访问的引擎(如 Google),并启用百度、360 等本地化引擎。
  • ​JSON 格式支持​​:在 settings.yml 中启用 json 输出格式,便于 API 集成。

通过上述方式,SearXNG 实现了对多源搜索引擎的灵活整合,平衡了隐私、成本与稳定性需求。用户可根据实际场景选择适合的访问策略。

 

 

AGENTSEEK DEPENDS ON IT

https://github.com/Fosowl/agenticSeek

https://github.com/Fosowl/agenticSeek/blob/main/docker-compose.yml

version: '3'

services:
  redis:
    container_name: redis
    profiles: ["core", "full"]
    image: docker.io/valkey/valkey:8-alpine
    command: valkey-server --save 30 1 --loglevel warning
    restart: unless-stopped
    volumes:
      - redis-data:/data
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
      - DAC_OVERRIDE
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
    networks:
      - agentic-seek-net

  searxng:
    container_name: searxng
    profiles: ["core", "full"]
    image: docker.io/searxng/searxng:latest
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./searxng:/etc/searxng:rw,z
    environment:
      - SEARXNG_BASE_URL=${SEARXNG_BASE_URL:-http://localhost:8080/}
      - SEARXNG_SECRET_KEY=${SEARXNG_SECRET_KEY}
      - UWSGI_WORKERS=5
      - UWSGI_THREADS=4
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
    depends_on:
      - redis
    networks:
      - agentic-seek-net

  frontend:
    container_name: frontend
    profiles: ["core", "full"]
    build:
      context: ./frontend
      dockerfile: Dockerfile.frontend
    ports:
      - "3000:3000"
    volumes:
      - ./frontend/agentic-seek-front/src:/app/src:rw,z
      - ./screenshots:/app/screenshots
    environment:
      - NODE_ENV=development
      - CHOKIDAR_USEPOLLING=true
      - REACT_APP_BACKEND_URL=http://host.docker.internal:${BACKEND_PORT:-7777}
    networks:
      - agentic-seek-net

  backend:
    container_name: backend
    profiles: ["backend", "full"]
    build:
      context: .
      dockerfile: Dockerfile.backend
    ports:
      - ${BACKEND_PORT:-7777}:${BACKEND_PORT:-7777}
      - ${OLLAMA_PORT:-11434}:${OLLAMA_PORT:-11434}
      - ${LM_STUDIO_PORT:-1234}:${LM_STUDIO_PORT:-1234}
      - ${CUSTOM_ADDITIONAL_LLM_PORT:-8000}:${CUSTOM_ADDITIONAL_LLM_PORT:-8000}
    volumes:
      - ./:/app
      - ${WORK_DIR:-.}:/opt/workspace
    command: python3 api.py
    environment:
      - SEARXNG_BASE_URL=${SEARXNG_BASE_URL:-http://searxng:8080}
      - REDIS_URL=${REDIS_BASE_URL:-redis://redis:6379/0}
      - WORK_DIR=/opt/workspace
      - BACKEND_PORT=${BACKEND_PORT}
      - DOCKER_INTERNAL_URL=http://host.docker.internal
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
      - OPENROUTER_API_KEY=${OPENROUTER_API_KEY}
      - TOGETHER_API_KEY=${TOGETHER_API_KEY}
      - GOOGLE_API_KEY=${GOOGLE_API_KEY}
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
      - HUGGINGFACE_API_KEY=${HUGGINGFACE_API_KEY}
      - DSK_DEEPSEEK_API_KEY=${DSK_DEEPSEEK_API_KEY}
    networks:
      - agentic-seek-net
    extra_hosts:
      - "host.docker.internal:host-gateway"
  
volumes:
  redis-data:
  chrome_profiles:

networks:
  agentic-seek-net:
    driver: bridge

 

 

https://www.bilibili.com/video/BV1Nqd6YKEhR/?spm_id_from=333.337.search-card.all.click&vd_source=57e261300f39bf692de396b55bf8c41b
posted @ 2025-06-30 19:19  lightsong  阅读(189)  评论(0)    收藏  举报
千山鸟飞绝,万径人踪灭