Searx 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
Searx 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
Searx 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 AGPL
开发语言 Python
操作系统 Linux
软件类型 开源软件
所属分类 程序开发搜索引擎
开源组织
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2019-06-13

软件简介

Searx是一个免费的互联网元搜索引擎,汇集了70多种搜索服务的结果。 用户既不被跟踪也不被分析。 此外,searx可以在Tor上实现在线匿名搜索。

基本安装

下面是基于 Debian/Ubuntu 和 virtualenv 的安装指南,如果是 Ubuntu 请确认使用的是 universe 仓库。

安装依赖包:

sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev

安装 searx:

cd /usr/local
sudo git clone https://github.com/asciimoo/searx.git
sudo useradd searx -d /usr/local/searx
sudo chown searx:searx -R /usr/local/searx

在 virtualenv 中安装依赖:

sudo -u searx -i
cd /usr/local/searx
virtualenv searx-ve
. ./searx-ve/bin/activate
./manage.sh update_packages

配置

sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml

根据需要修改 searx/settings.yml

检查

启动 searx:

python searx/webapp.py

浏览器访问 http://localhost:8888

如果一切工作正常,可以在 settings.yml 中禁用调试选项:

sed -i -e "s/debug : True/debug : False/g" searx/settings.yml

配合 uwsgi 使用

安装依赖包

sudo apt-get install uwsgi uwsgi-plugin-python

创建配置文件 /etc/uwsgi/apps-available/searx.ini,内容如下:

[uwsgi]
# Who will run the code
uid = searx
gid = searx

# disable logging for privacy
disable-logging = true

# Number of workers (usually CPU count)
workers = 4

# The right granted on the created socket
chmod-socket = 666

# Plugin to use and interpretor config
single-interpreter = true
master = true
plugin = python
lazy-apps = true
enable-threads = true

# Module to import
module = searx.webapp

# Virtualenv and python path
virtualenv = /usr/local/searx/searx-ve/
pythonpath = /usr/local/searx/
chdir = /usr/local/searx/searx/

激活 uwsgi 应用并重启

cd /etc/uwsgi/apps-enabled
ln -s ../apps-available/searx.ini
/etc/init.d/uwsgi restart

Web 服务器

nginx

使用如下命令安装 Nginx

sudo apt-get install nginx

配置到 / 根路径

创建配置文件 /etc/nginx/sites-available/searx 内容如下:

server {
    listen 80;
    server_name searx.example.com;
    root /usr/local/searx;

    location / {
            include uwsgi_params;
            uwsgi_pass unix:/run/uwsgi/app/searx/socket;
    }
}

重启服务:

sudo service nginx restart
sudo service uwsgi restart

配置到指定路径 (/searx)

添加配置文件 /etc/nginx/sites-enabled/default 内容如下:

location = /searx { rewrite ^ /searx/; }
location /searx {
        try_files $uri @searx;
}
location @searx {
        uwsgi_param SCRIPT_NAME /searx;
        include uwsgi_params;
        uwsgi_modifier1 30;
        uwsgi_pass unix:/run/uwsgi/app/searx/socket;
}

或者使用反向代理(适合单用户使用或者低访问量的实例)

location /searx {
    proxy_pass http://127.0.0.1:8888;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Scheme $scheme;
    proxy_set_header X-Script-Name /searx;
    proxy_buffering off;
}

编辑 searx/settings.xml 中的 base_url 

base_url : http://your.domain.tld/searx/

重启服务:

sudo service nginx restart
sudo service uwsgi restart

为了更好的保护隐私,可以禁用日志,在 /etc/nginx/sites-available/default 的 uwsgi_pass 下面增加如下内容:

access_log /dev/null;
error_log /dev/null;

重启服务

sudo service nginx restart

apache

增加 wsgi mod:

sudo apt-get install libapache2-mod-uwsgi
sudo a2enmod uwsgi

增加配置内容到 /etc/apache2/apache2.conf:

<Location />
    Options FollowSymLinks Indexes
    SetHandler uwsgi-handler
    uWSGISocket /run/uwsgi/app/searx/socket
</Location>

N注意,如果你的 searx 实例不是部署在根路径,需要修改 <Location /> 配置信息,如 <Location /searx>.

重启 Apache:

sudo /etc/init.d/apache2 restart

禁用日志

回到配置文件 /etc/apache2/apache2.conf 在 <Location /> 指令上方增加:

CustomLog /dev/null combined

重启 Apache:

sudo /etc/init.d/apache2 restart

如何更新

cd /usr/local/searx
sudo -u searx -i
. ./searx-ve/bin/activate
git stash
git pull origin master
git stash apply
./manage.sh update_packages
sudo service uwsgi restart

Docker

确认你已装有 Docker ,然后使用如下命令来部署 searx:

docker pull wonderfall/searx
docker run -d --name searx -p $PORT:8888 wonderfall/searx

打开浏览器访问 http://localhost:$PORT.

更多的帮助请看 https://hub.docker.com/r/wonderfall/searx/ 

你也可以通过 Dockerfile 来构建 searx

git clone https://github.com/asciimoo/searx.git
cd searx
docker build -t whatever/searx .

参考资料

展开阅读全文

代码

的 Gitee 指数为
超过 的项目

评论

点击加入讨论🔥(13) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
Certifi 存在数据真实性验证不充分漏洞
对数据真实性的验证不充分
Certifi 是一个用于验证 TLS 主机身份的同时验证 SSL 证书的可信度的开源代码库。 根据媒体报道:TrustCor 的所有权经营一家生产间谍软件的企业,Certifi 从根存储中删除 TrustCor 中的根证书,并且 TrustCor 正在被 Mozilla 从信任证书库中删除。请阅读相关链接:https://groups.google.com/a/mozilla.org/g/dev-security-policy/c/oxX69KFvsm4/m/yLohoVqtCgAJ
CVE-2022-23491 MPS-2022-1918
2023-12-20 19:54
Matthäus G. Chajdas pygments 代码问题漏洞
任意文件上传
Matthäus G. Chajdas pygments是 Matthäus G. Chajdas开源的一个应用软件。提供通用语法突出显示工具功能。 pygments 2.15.0及之前版本存在安全漏洞,该漏洞源于pygments/lexers/smithy.py存在正则表达式拒绝服务(ReDoS)漏洞。
CVE-2022-40896 MPS-2022-57237
2023-12-20 19:54
PyPI仓库selenium组件包内嵌恶意代码
内嵌恶意代码
受影响的selenium组件被检测出网络、文件的异常行为,存在后门风险。
MPS-52me-b76a
2023-12-20 19:54
Certifi 数据伪造问题漏洞
对数据真实性的验证不充分
Certifi是一个针对SSL证书进行可信验证和TLS主机身份验证的根证书精选集。在2023.07.22版本之前,Certifi识别并信任'e-Tugra'根证书,然而'e-Tugra'根证书在其系统中存在安全问题,因此受到调查。在Certifi 2023.07.22版本中移除了'e-Tugra'根证书。
CVE-2023-37920 MPS-ck78-r6zg
2023-12-20 19:54
Flask 安全漏洞
通过持久性Cookie导致的信息暴露
Flask是一款轻量级WSGI web应用程序框架。当满足以下所有条件时,代理可能缓存包含用于单个客户端的数据的响应,并随后将其发送给其他客户端。如果代理也缓存了“Set-Cookie”标头,则可能会将一个客户端的“session” cookie发送到其他客户端。严重程度取决于应用程序对会话的使用以及代理关于Cookie的行为。风险取决于满足所有这些条件。要发生这种情况,必须满足以下所有条件:1. 应用程序必须托管在不剥离Cookie或忽略具有Cookie的响应的缓存代理后面。2. 应用程序设置“session.permanent = True”3. 应用程序在请求期间不访问或修改会话。4. 启用了“SESSION_REFRESH_EACH_REQUEST”(默认情况下)。5. 应用程序未设置“Cache-Control”标头以指示页面是私有的或不应该被缓存。这是因为存在漏洞的Flask版本仅在访问或修改会话时设置“Vary: Cookie”标头,而在刷新(重新发送以更新过期时间)会话时没有访问或修改而没有设置“Vary: Cookie”标头。该问题已在版本2.3.2和2.2.5中进行了修复。
CVE-2023-30861 MPS-y7qk-6aom
2023-12-20 19:54
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
13 评论
88 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部