354 lines
7.8 KiB
Markdown
354 lines
7.8 KiB
Markdown
# Intro
|
|
|
|
部署`searxng`服务作为网络搜索工具。
|
|
|
|
## docker-compose
|
|
|
|
```yaml
|
|
services:
|
|
searxng-core:
|
|
container_name: searxng-core
|
|
image: searxng/searxng:2026.3.29-7ac4ff39f
|
|
restart: on-failure:3
|
|
network_mode: host
|
|
volumes:
|
|
- ./conf/:/etc/searxng/
|
|
- ./data:/var/cache/searxng/
|
|
environment:
|
|
- SEARXNG_PORT=36571
|
|
- SEARXNG_BIND_ADDRESS=0.0.0.0
|
|
- SEARXNG_SECRET=397492b7676965ecec6bfb483d992ff7df3286ee6113c40472c46ed39567d1d4
|
|
```
|
|
|
|
## 启动前要做的事
|
|
|
|
```bash
|
|
docker pull searxng/searxng:2026.3.29-7ac4ff39f
|
|
```
|
|
|
|
```bash
|
|
mkdir conf data
|
|
```
|
|
|
|
```bash
|
|
rm -rf conf/settings.yml && vim conf/settings.yml
|
|
```
|
|
|
|
```yaml
|
|
# settings.yml
|
|
general:
|
|
# Debug mode, only for development. Is overwritten by ${SEARXNG_DEBUG}
|
|
debug: false
|
|
# displayed name
|
|
instance_name: "SearXNG"
|
|
# For example: https://example.com/privacy
|
|
privacypolicy_url: false
|
|
# use true to use your own donation page written in searx/info/en/donate.md
|
|
# use false to disable the donation link
|
|
donation_url: false
|
|
# mailto:contact@example.com
|
|
contact_url: false
|
|
# record stats
|
|
enable_metrics: true
|
|
# expose stats in open metrics format at /metrics
|
|
# leave empty to disable (no password set)
|
|
# open_metrics: <password>
|
|
open_metrics: ''
|
|
|
|
brand:
|
|
docs_url: https://docs.searxng.org/
|
|
public_instances: https://searx.space
|
|
wiki_url: https://github.com/searxng/searxng/wiki
|
|
issue_url: https://github.com/searxng/searxng/issues
|
|
|
|
search:
|
|
# Filter results. 0: None, 1: Moderate, 2: Strict
|
|
safe_search: 0
|
|
# Existing autocomplete backends: "360search", "baidu", "bing", "brave", "dbpedia", "duckduckgo", "google",
|
|
# "yandex", "mwmbl", "naver", "seznam", "sogou", "startpage", "swisscows", "quark", "qwant", "wikipedia" -
|
|
# leave blank to turn it off by default.
|
|
autocomplete: ""
|
|
# minimun characters to type before autocompleter starts
|
|
autocomplete_min: 4
|
|
# Available resolvers: "allesedv", "duckduckgo", "google", "yandex" - leave blank to turn it off by default.
|
|
favicon_resolver: ""
|
|
# use codes from 'languages.py'
|
|
default_lang: "auto"
|
|
# max_page: 0 # if engine supports paging, 0 means unlimited numbers of pages
|
|
ban_time_on_fail: 5
|
|
max_ban_time_on_fail: 120
|
|
suspended_times:
|
|
SearxEngineAccessDenied: 180
|
|
SearxEngineCaptcha: 3600
|
|
SearxEngineTooManyRequests: 180
|
|
cf_SearxEngineCaptcha: 1296000
|
|
cf_SearxEngineAccessDenied: 86400
|
|
recaptcha_SearxEngineCaptcha: 604800
|
|
|
|
# formats: [html, csv, json, rss]
|
|
formats:
|
|
- html
|
|
- json
|
|
|
|
server:
|
|
# Is overwritten by ${SEARXNG_PORT} and ${SEARXNG_BIND_ADDRESS}
|
|
port: 8888
|
|
bind_address: "127.0.0.1"
|
|
base_url: false
|
|
# Is overwritten by ${SEARXNG_LIMITER}
|
|
limiter: false
|
|
# Is overwritten by ${SEARXNG_PUBLIC_INSTANCE}
|
|
public_instance: false
|
|
# Is overwritten by ${SEARXNG_SECRET}
|
|
secret_key: ""
|
|
# Proxy image results through SearXNG. Is overwritten by ${SEARXNG_IMAGE_PROXY}
|
|
image_proxy: false
|
|
# 1.0 and 1.1 are supported
|
|
http_protocol_version: "1.0"
|
|
# see https://github.com/searxng/searxng/pull/3619
|
|
# Is overwritten by ${SEARXNG_METHOD}
|
|
method: "POST"
|
|
default_http_headers:
|
|
X-Content-Type-Options: nosniff
|
|
X-Download-Options: noopen
|
|
X-Robots-Tag: noindex, nofollow
|
|
Referrer-Policy: no-referrer
|
|
|
|
valkey:
|
|
# URL to connect valkey database. Is overwritten by ${SEARXNG_VALKEY_URL}.
|
|
url: false
|
|
|
|
ui:
|
|
static_path: ""
|
|
templates_path: ""
|
|
query_in_title: false
|
|
default_theme: simple
|
|
center_alignment: false
|
|
default_locale: ""
|
|
theme_args:
|
|
simple_style: auto
|
|
search_on_category_select: true
|
|
hotkeys: default
|
|
url_formatting: pretty
|
|
|
|
outgoing:
|
|
request_timeout: 3.0
|
|
useragent_suffix: ""
|
|
pool_connections: 100
|
|
pool_maxsize: 20
|
|
enable_http2: true
|
|
proxies:
|
|
all:
|
|
- http://192.168.31.9:7890
|
|
using_tor_proxy: false
|
|
extra_proxy_timeout: 10
|
|
|
|
plugins:
|
|
searx.plugins.calculator.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.infinite_scroll.SXNGPlugin:
|
|
active: false
|
|
searx.plugins.hash_plugin.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.self_info.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.unit_converter.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.ahmia_filter.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.hostnames.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.time_zone.SXNGPlugin:
|
|
active: true
|
|
searx.plugins.oa_doi_rewrite.SXNGPlugin:
|
|
active: false
|
|
searx.plugins.tor_check.SXNGPlugin:
|
|
active: false
|
|
searx.plugins.tracker_url_remover.SXNGPlugin:
|
|
active: true
|
|
|
|
categories_as_tabs:
|
|
general:
|
|
images:
|
|
videos:
|
|
news:
|
|
map:
|
|
music:
|
|
it:
|
|
science:
|
|
files:
|
|
social media:
|
|
|
|
engines:
|
|
- name: 360search
|
|
engine: 360search
|
|
shortcut: 360so
|
|
timeout: 10.0
|
|
disabled: true
|
|
|
|
- name: alpine linux packages
|
|
engine: alpinelinux
|
|
disabled: true
|
|
shortcut: alp
|
|
|
|
- name: apk mirror
|
|
engine: apkmirror
|
|
timeout: 4.0
|
|
shortcut: apkm
|
|
disabled: true
|
|
|
|
- name: arch linux wiki
|
|
engine: archlinux
|
|
shortcut: al
|
|
|
|
- name: arxiv
|
|
engine: arxiv
|
|
shortcut: arx
|
|
|
|
- name: wikipedia
|
|
engine: wikipedia
|
|
shortcut: wp
|
|
# add "list" to the array to get results in the results list
|
|
display_type: ["infobox"]
|
|
categories: [general]
|
|
|
|
- name: bing
|
|
engine: bing
|
|
shortcut: bi
|
|
|
|
- name: bing images
|
|
engine: bing_images
|
|
shortcut: bii
|
|
|
|
- name: bing news
|
|
engine: bing_news
|
|
shortcut: bin
|
|
|
|
- name: bing videos
|
|
engine: bing_videos
|
|
shortcut: biv
|
|
|
|
- name: docker hub
|
|
engine: docker_hub
|
|
shortcut: dh
|
|
categories: [it, packages]
|
|
|
|
- name: duckduckgo
|
|
engine: duckduckgo
|
|
shortcut: ddg
|
|
|
|
- name: duckduckgo images
|
|
engine: duckduckgo_extra
|
|
categories: [images]
|
|
ddg_category: images
|
|
shortcut: ddi
|
|
|
|
- name: duckduckgo videos
|
|
engine: duckduckgo_extra
|
|
categories: [videos]
|
|
ddg_category: videos
|
|
shortcut: ddv
|
|
|
|
- name: duckduckgo news
|
|
engine: duckduckgo_extra
|
|
categories: [news]
|
|
ddg_category: news
|
|
shortcut: ddn
|
|
|
|
- name: github
|
|
engine: github
|
|
shortcut: gh
|
|
|
|
- name: github code
|
|
engine: github_code
|
|
shortcut: ghc
|
|
inactive: true
|
|
ghc_auth:
|
|
# type is one of:
|
|
# * none
|
|
# * personal_access_token
|
|
# * bearer
|
|
# When none is passed, the token is not requried.
|
|
type: "none"
|
|
token: "token"
|
|
# specify whether to highlight the matching lines to the query
|
|
ghc_highlight_matching_lines: true
|
|
ghc_strip_new_lines: true
|
|
ghc_strip_whitespace: false
|
|
timeout: 10.0
|
|
|
|
- name: google
|
|
engine: google
|
|
shortcut: go
|
|
|
|
- name: google images
|
|
engine: google_images
|
|
shortcut: goi
|
|
|
|
- name: google news
|
|
engine: google_news
|
|
shortcut: gon
|
|
|
|
- name: google videos
|
|
engine: google_videos
|
|
shortcut: gov
|
|
|
|
- name: google scholar
|
|
engine: google_scholar
|
|
shortcut: gos
|
|
|
|
- name: pypi
|
|
shortcut: pypi
|
|
engine: pypi
|
|
|
|
- name: stackoverflow
|
|
engine: stackexchange
|
|
shortcut: st
|
|
api_site: 'stackoverflow'
|
|
categories: [it, q&a]
|
|
|
|
- name: askubuntu
|
|
engine: stackexchange
|
|
shortcut: ubuntu
|
|
api_site: 'askubuntu'
|
|
categories: [it, q&a]
|
|
|
|
- name: brave
|
|
engine: brave
|
|
shortcut: br
|
|
time_range_support: true
|
|
paging: true
|
|
categories: [general, web]
|
|
brave_category: search
|
|
# brave_spellcheck: true
|
|
|
|
- name: brave.images
|
|
engine: brave
|
|
network: brave
|
|
shortcut: brimg
|
|
categories: [images, web]
|
|
brave_category: images
|
|
|
|
- name: brave.videos
|
|
engine: brave
|
|
network: brave
|
|
shortcut: brvid
|
|
categories: [videos, web]
|
|
brave_category: videos
|
|
|
|
- name: brave.news
|
|
engine: brave
|
|
network: brave
|
|
shortcut: brnews
|
|
categories: news
|
|
brave_category: news
|
|
|
|
doi_resolvers:
|
|
oadoi.org: 'https://oadoi.org/'
|
|
doi.org: 'https://doi.org/'
|
|
sci-hub.se: 'https://sci-hub.se/'
|
|
sci-hub.st: 'https://sci-hub.st/'
|
|
sci-hub.ru: 'https://sci-hub.ru/'
|
|
|
|
default_doi_resolver: 'oadoi.org'
|
|
``` |