
Ahmia 是 Tor 匿名网络上 .onion 域名的搜索引擎。它由 Juha Nurmi 领导,总部位于芬兰。本仓库包含 Ahmia 搜索引擎所使用的爬虫。
最新版本的 Ahmia 使用 Python 3、Django 5 和 Elasticsearch 8 构建。 你需要了解这些技术才能搭建可用的 Ahmia 安装环境。 Ahmia 使用 ahmia-crawler 进行爬取。
ahmia-index 应已安装并正在运行
pip install -r requirements.txt
这是本地(开发)和生产环境共用的一个步骤。
cp ahmia/example.env ahmia/.env
请修改 .env 中的值,以符合你的需求。如果你使用生产环境设置,至少必须指定
postgresql 凭据。
python manage.py makemigrations ahmia
python manage.py migrate
python manage.py collectstatic
/usr/local/share/ca-certificates/http_ca.crt
开发设置使用 sqlite 作为数据库。 默认设置应当开箱即用。
python manage.py runserver
注意:如果你的部署目录不是 /usr/local/lib/ahmia-site,请相应替换
# Check the confs and *.map filtering files you plan to utilise
cp *.map /etc/nginx/
cp conf/nginx/nginx.conf /etc/nginx/nginx.conf
cp conf/nginx/django-ahmia /etc/nginx/sites-enabled/django-ahmia
service nginx start
增加 /etc/nginx/nginx.conf 中的 worker_connections:
events {
worker_connections 2048;
}
任选其一:
bash ./bin/run-ahmia.sh
bash ./bin/run-ahmia-onion.sh
或者
cp conf/gunicorn/*.service /etc/systemd/system/
systemctl daemon-reload
systemctl enable ahmia.service
systemctl status ahmia.service
systemctl enable ahmia-onion.service
systemctl status ahmia-onion.service
systemctl restart gunicorn
systemctl edit nginx
[Unit]
After=network-online.target remote-fs.target nss-lookup.target ahmia.service ahmia-onion.service
Requires=ahmia.service ahmia-onion.service
systemctl daemon-reload
systemctl cat nginx
# Every three days
40 5 */3 * * cd /usr/local/lib/ahmia-site && venv/bin/python manage.py deleteonions >> weeklydelete.log 2>&1
Ahmia 采用 3-clause BSD license 许可。