尊重隱私的開源搜索引擎
一顆小胡椒2023-05-17 15:09:18
Searx介紹
Searx,一個基于Python的完全開源免費搜索引擎平臺,為你提供來自Google、Bing、Yahoo等70多種各大視頻、圖片、搜索、磁力等網站結果展示,并對搜索結果進行優化,同時不會存儲你的任何搜索信息,搭建也很方便。你完全可以用它來搭建Google鏡像等。

Searx安裝
#拉取源碼 $ git clone https://github.com/asciimoo/searx.git #安裝依賴 $ cd searx $ pip install -r requirements.txt #編輯配置文件 $ nano searx/settings.yml
settings.yml 配置
參考settings.yml,當然你也可以全部使用默認(不建議)
language:為搜索語言,默認en-US,如果你的搜索以中文為主,那就改成zh-CN,當然這個語言在搜索界面也可以設置 port:為監聽端口,默認8888,可自行修改。 bind_address:為監控地址,默認為127.0.0.1,如果需要讓ip地址能被外網訪問,就修改為0.0.0.0,這里建議默認,然后再用域名反代即可。 secret_key:該參數為加密密匙,可自行設置,數值可以在ssh客戶端使用openssl rand -hex 16命令生成。
運行Searx
yum install screen -y screen -dmS searx python searx/webapp.py
然后使用ip:port訪問,如果你的bind_address地址沒修改,可能瀏覽器會訪問不了,就需要反代了,方法后面會說。
如果你修改了bind_address地址為0.0.0.0,還打不開媒體界面的話,還需要開啟防火墻端口,使用命令:
#CentOS 7 firewall-cmd --zone=public --add-port=8888/tcp --permanent firewall-cmd --reload
如果你開了端口還不能打開,可能還需要去服務商后臺開啟對應的端口。
Docker安裝Searx
建立searx
git clone https://github.com/asciimoo/searx.git cd searx docker build -t searx.
您可以使用兩個環境變量自定義您的searx實例:
- MAGE_PROXY (default : False), 如果設置為True,則searx將代理所有圖像。
- BASE_URL (default : False) 應該設置為您的域名 (with http/https).
運行searx
在反向代理后面運行一個searx容器:
docker run -d --name searx -e IMAGE_PROXY=True -e BASE_URL=https://domain.tld sea
使用nginx(反向代理),使用以下內容創建一個vhost:
...
location / {
proxy_pass http://searx:8888;
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-Remote-Port $remote_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
}
..
至此,你可以去http://localhost:$PORT使用searx了。
Searx項目
https://github.com/asciimoo/searx
一顆小胡椒
暫無描述