How ahmia/ahmia-site works
Ahmia is a Django web search engine for .onion domains; crawling and index maintenance are handled by the separately documented ahmia-crawler and ahmia-index services. The main user workflow routes a search request to the results view, queries Elasticsearch, filters/formats hits, and renders a results page. Separate branches support onion submissions, domain listings, blacklist/help handling, and safe redirects. Source excerpts are partial, so links between views and unsampled model or template details are limited to what the tree, README, and excerpts support.
Main entry points: views.py Request views · models.py Domain records · urls.py URL routes · validators.py Search client
Components 14
Web interface
- URL routes
ahmia/urls.py - Request views
ahmia/views.py - Page templates
ahmia/templates
Search and index
- Search configuration
ahmia/settings.py - Search client
ahmia/validators.py - Elasticsearch index
- Ahmia crawler
Safety and submissions
- Submission form
ahmia/forms.py - URL validators
ahmia/validators.py - Detection importer
ahmia/management/commands/importcsamdetections.py
Application state
- Domain records
ahmia/models.py - Relational database
- Submission cleanup
ahmia/management/commands/deleteonions.py
Other components
- Visitor
Connections 14
- Visitor → URL routes: sends request
- URL routes → Request views: dispatches
- Request views → Page templates: renders
- Request views → Submission form: uses
- Submission form → URL validators: validates with
- URL validators → Elasticsearch index: checks banned status
- Request views → Elasticsearch index: searches
- Search configuration → Search client: configures
- Search client → Elasticsearch index: connects to
- Request views → Domain records: reads and writes
- Domain records → Relational database: persists
- Detection importer → Domain records: imports domains
- Submission cleanup → Domain records: deletes submissions
- Ahmia crawler → Elasticsearch index: indexes crawl data