SKILL·938F15

deploy-searxng

pjt222
Aktualisiert 1 month ago
20 Ansichten
26
3
26
Auf GitHub ansehen
Dokumentationgeneral

Über

Diese Fähigkeit setzt eine selbst gehostete SearXNG Meta-Suchmaschine mittels Docker Compose ein und bietet Konfigurationen für Einstellungen, Suchmaschinen sowie ein Nginx-Frontend. Sie ermöglicht privates, nicht nachverfolgbares Suchen durch das Aggregieren von Ergebnissen mehrerer Anbieter. Nutzen Sie sie, um Abhängigkeiten von kommerziellen Suchmaschinen zu ersetzen oder eine gemeinsame Suchinstanz für Teams zu betreiben.

Schnellinstallation

Claude Code

Empfohlen
Primär
npx skills add pjt222/agent-almanac -a claude-code
Plugin-BefehlAlternativ
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternativ
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/deploy-searxng

Kopieren Sie diesen Befehl und fügen Sie ihn in Claude Code ein, um diese Fähigkeit zu installieren

Dokumentation

部署 SearXNG

以 Docker Compose+Nginx 部自託 SearXNG 元搜索。

  • 建私人自託搜索
  • 聚合多源無跟蹤
  • 團隊/組織共享搜索
  • 替單一搜索提供商

  • :有 Docker 之機
  • :域名
  • :SSL/Let's Encrypt
  • :自定引擎偏好

一:建項目結構

mkdir -p searxng/{config,nginx}
cd searxng

二:書 Docker Compose

docker-compose.yml

services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    volumes:
      - ./config:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://search.example.com/
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    restart: unless-stopped
    networks:
      - searxng

  nginx:
    image: nginx:1.27-alpine
    container_name: searxng-nginx
    ports:
      - "8080:80"
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - searxng
    restart: unless-stopped
    networks:
      - searxng

networks:
  searxng:
    driver: bridge

三:配 SearXNG 設定

config/settings.yml

use_default_settings: true

general:
  instance_name: "My SearXNG"
  privacypolicy_url: false
  contact_url: false

search:
  safe_search: 0
  autocomplete: "google"
  default_lang: "en"

server:
  secret_key: "generate-a-random-secret-key-here"
  limiter: true
  image_proxy: true
  port: 8080
  bind_address: "0.0.0.0"

ui:
  static_use_hash: true
  default_theme: simple
  infinite_scroll: true

engines:
  - name: google
    engine: google
    shortcut: g
    disabled: false

  - name: duckduckgo
    engine: duckduckgo
    shortcut: ddg
    disabled: false

  - name: wikipedia
    engine: wikipedia
    shortcut: wp
    disabled: false

  - name: github
    engine: github
    shortcut: gh
    disabled: false

  - name: stackoverflow
    engine: stackoverflow
    shortcut: so
    disabled: false

  - name: arxiv
    engine: arxiv
    shortcut: arx
    disabled: false

生密鑰:

openssl rand -hex 32

四:配 Nginx 前端

nginx/nginx.conf

events {
    worker_connections 1024;
}

http {
    server {
        listen 80;

        location / {
            proxy_pass http://searxng:8080;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Connection "";
            proxy_buffering off;
        }

        location /static/ {
            proxy_pass http://searxng:8080/static/;
            expires 1y;
            add_header Cache-Control "public, immutable";
        }
    }
}

五:配限流

config/limiter.toml

[botdetection.ip_limit]
link_token = true

[botdetection.ip_lists]
block_ip = []
pass_ip = ["127.0.0.1/8", "::1/128"]
pass_searxng_org = false

六:部署並驗

# Start the stack
docker compose up -d

# Check logs
docker compose logs -f searxng

# Verify it's running
curl -s http://localhost:8080 | head -5

# Test a search
curl -s "http://localhost:8080/search?q=test&format=json" | head -20

得: SearXNG 於 8080 經 Nginx 應。查詢返聚合結果。

敗:docker compose logs searxng 覓配錯。驗 settings.yml YAML 語法。

七:加 SSL(生產)

公開部署加 SSL。更 docker-compose.yml

services:
  nginx:
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx/nginx-ssl.conf:/etc/nginx/nginx.conf:ro
      - certbot-certs:/etc/letsencrypt:ro
      - certbot-webroot:/var/www/certbot:ro

  certbot:
    image: certbot/certbot
    volumes:
      - certbot-certs:/etc/letsencrypt
      - certbot-webroot:/var/www/certbot

volumes:
  certbot-certs:
  certbot-webroot:

SSL Nginx 全配見 configure-nginx 技能。

八:更新與維護

# Pull latest image
docker compose pull searxng

# Restart with new image
docker compose up -d

# Backup configuration
cp -r config/ config-backup-$(date +%Y%m%d)/

  • SearXNG 啟無錯於日誌
  • 查詢返配置引擎之結果
  • 圖代理工作(圖經 SearXNG 載)
  • 限流擋過量請求
  • 配置跨容器重啟持久
  • Nginx 正確代理

  • 缺 secret_key:無此 SearXNG 拒啟。
  • 配權限:SearXNG 寫配目錄。卷須 :rw:ro
  • 引擎封:某引擎擋服務器 IP。輪替或用圖代理。
  • YAML 縮進settings.yml 縮進敏感。部前以 YAML linter 驗。
  • Base URL 不匹SEARXNG_BASE_URL 須匹用戶實訪 URL,含協議+尾斜線。
  • Docker DNS 解析:用 Google/Bing 引擎或需主機網絡或正 DNS。默認 Docker DNS 通常可。

  • setup-compose-stack
  • configure-nginx
  • configure-reverse-proxy

GitHub Repository

pjt222/agent-almanac
Pfad: i18n/wenyan-ultra/skills/deploy-searxng
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams
FAQ

Frequently asked questions

What is the deploy-searxng skill?

deploy-searxng is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform deploy-searxng-related tasks without extra prompting.

How do I install deploy-searxng?

Use the install commands on this page: add deploy-searxng to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.

What category does deploy-searxng belong to?

deploy-searxng is in the Documentation category, tagged general.

Is deploy-searxng free to use?

Yes. deploy-searxng is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.

Verwandte Skills

railway-docs
Dokumentation

Diese Fähigkeit ruft aktuelle Railway-Dokumentation ab, um Fragen zu Funktionen, Funktionalität oder spezifischen Dokumentations-URLs zu beantworten. Sie stellt sicher, dass Entwickler genaue, aktuelle Informationen direkt aus den offiziellen Quellen von Railway erhalten. Nutzen Sie sie, wenn Nutzer fragen, wie Railway funktioniert oder auf Railway-Dokumentation verweisen.

Skill ansehen
n8n-code-python
Dokumentation

Dieses Claude Skill bietet fachkundige Anleitung zum Schreiben von Python-Code in n8n-Code-Nodes, insbesondere für die Verwendung der Python-Standardbibliothek und den Umgang mit n8ns spezieller Syntax wie `_input`, `_json` und `_node`. Es hilft Entwicklern, die Grenzen von Python innerhalb von n8n zu verstehen, empfiehlt JavaScript für die meisten Workflows und bietet gleichzeitig Python-Lösungen für spezifische Datenumwandlungsanforderungen.

Skill ansehen
archon
Dokumentation

Die Archon-Funktion bietet semantische Suche auf RAG-Basis und Projektmanagement über eine REST-API. Nutzen Sie sie für das Abfragen von Dokumentation, die Verwaltung hierarchischer Projekte/Aufgaben und die Durchführung von Wissenabruf mit Dokumenten-Upload-Fähigkeiten. Priorisieren Sie stets Archon zuerst bei der Suche in externer Dokumentation, bevor Sie andere Quellen verwenden.

Skill ansehen
n8n-code-javascript
Dokumentation

Diese Claude-Skill bietet fachkundige Anleitung für das Schreiben von JavaScript-Code in n8n-Code-Nodes. Sie behandelt wesentliche n8n-spezifische Syntax wie `$input`/`$json`-Variablen, HTTP-Helfer und DateTime-Verarbeitung und hilft bei der Fehlerbehebung häufiger Probleme. Nutzen Sie sie bei der Entwicklung von n8n-Workflows, die eine benutzerdefinierte JavaScript-Verarbeitung in Code-Nodes erfordern.

Skill ansehen