ahmia / ahmia-site

Ahmia.fi - Hidden service search engine
https://ahmia.fi
BSD 3-Clause "New" or "Revised" License
423 stars 69 forks source link

https://ahmia.fi/

Ahmia is the search engine for .onion domains on the Tor anonymity network. It is led by Juha Nurmi and is based in Finland. This repository contains crawlers used by Ahmia search engine.

Compatibility

The newest version of Ahmia is built with Python 3, Django 5 and Elasticsearch 8. You will need to know these technologies to create a working Ahmia installation. Ahmia crawls using ahmia-crawler.

Prerequisites

Ahmia-index should be installed and running

Installation guide

pip install -r requirements.txt

Configuration

This is a common step, both for local (dev) and production environment.

cp ahmia/example.env ahmia/.env

Please modify the values in .env, to fit your needs. You have to specify at least the postgresql credentials, if you are using the production settings.

Setup Website

Migrate db

python manage.py makemigrations ahmia
python manage.py migrate

Make the static files

python manage.py collectstatic

Copy Elasticsearch CA cert in place

/usr/local/share/ca-certificates/http_ca.crt

Run site in dev mode

Start development server

Development settings use sqlite as a database. Default settings should work out of the box.

python manage.py runserver

Production -- Nginx

NOTE: If your deployment directory isn't /usr/local/lib/ahmia-site replace accordingly

Increase worker_connections in /etc/nginx/nginx.conf:

events {
        worker_connections 2048;
}

Production -- Gunicorn

EITHER:

OR

Edit your /lib/systemd/system/nginx.service to add ahmia-site.service ahmia-site-onion.service

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

Delete added onions once a week

# EVERY WEEK, Tuesday 12:57
57 12 * * 2 cd /usr/local/lib/ahmia-site && venv/bin/python manage.py deleteonions >> weeklydelete.log 2>&1

License

Ahmia is licensed under the 3-clause BSD license.