Advanced Tor Relay Analytics & Metrics Platform β a security-hardened static site generator that produces a browsable Tor relay analytics site from Onionoo API data.
- Static site output in
allium/www/β serve locally or deploy anywhere static files can be hosted - Relay + operator analytics β bandwidth, consensus weight, diversity views, uptime/reliability, and more
- AROI leaderboards β 21 specialized categories recognizing authenticated relay operators
- Privacy-First β Generates static HTML requiring no server-side processing or JavaScript dependencies
- Security-Hardened β Input sanitization, XSS protection, and dependency scanning built-in
- Deep Intelligence β Goes beyond basic metrics with operator leaderboards and 6-layer analytics engine
Originally forked from allium, this version adds extensive analytics, operator leaderboards, and intelligence features.
curl -sSL https://raw.githubusercontent.com/1aeo/allium/master/setup.sh | bashcurl -fsSL https://raw.githubusercontent.com/1aeo/allium/master/setup.sh -o setup.sh
less setup.sh
bash setup.shgit clone https://github.com/1aeo/allium.git && cd allium
# Create and activate virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r config/requirements.txt
cd allium && python3 allium.py --progress
cd www && python3 -m http.server 8000
# Visit http://localhost:8000| Task | Command |
|---|---|
| Generate site | cd allium && python3 allium.py --progress |
| Serve output | cd allium/www && python3 -m http.server 8000 |
| Custom output dir | python3 allium.py --out /path/to/site |
| Minimal memory mode | python3 allium.py --apis details --progress |
- Memory: Plan for ~3GB RAM available (the uptime dataset alone peaks around ~2GB)
- Time: Full generation takes ~2-5 minutes producing ~21,700 HTML pages
- Disk: Output is approximately ~500MB
π Full Quick Start Guide β detailed setup instructions, troubleshooting, and deployment options.
- Key Features
- Usage & Configuration
- API Data Sources
- Security & Performance
- Requirements
- Documentation
- Contributing
- Screenshots
- License
- References
Data Processing
- Multi-threaded API fetching from 5 sources: Onionoo Details/Uptime/Bandwidth, AROI Validation, CollecTor Consensus
- Multiprocessing page generation (configurable via
--workers) - Downtime filtering: excludes relays offline >7 days (configurable via
--filter-downtime) - Generates relay, contact, country, AS, family, platform, and flag pages
AROI Leaderboards (21 Categories)
Authenticated Relay Operator Identification system ranking verified operators:
Capacity: Bandwidth Contributed, Consensus Weight Leaders, Total Data Transferred Champions (5yr)
Roles: Exit/Guard Authority Champions, Exit/Guard Operators
Reliability: Reliability Masters (6mo), Legacy Titans (5yr), Bandwidth Served Masters (6mo), Bandwidth Served Legends (5yr)
Diversity (two co-equal boards per dimension β Volume = scale of non-dominant contribution, Breadth = distinct spread within one operator): Diversity All-Rounders (overall, ranked by a 0-100 Diversity Index averaging four co-equal Geographic/Platform/Network/Scale sub-scores with yardsticks derived from the live network), Non-Linux Powerhouses (platform volume), OS Polyglots (platform breadth, 2+ distinct OSes incl. Linux), Global Powerhouses (non-EU volume), Jurisdiction Globetrotters (non-EU breadth), Frontier Builders (rare-country breadth)
Infrastructure: Network Veterans (tenure), IPv4/IPv6 Address Leaders, AROI Validation Champions (with v2/v3 split columns + tiered migration badges π/π/π/π)
- Paginated rankings (Top 10, 11-20, 21-25) with CSS-only navigation
- Champion badge system for top performers
- Dual CIISS spec support: tracks both ciissversion:2 (RSA-fingerprint proofs) and ciissversion:3 (ed25519 happy-family proofs) with operator-level migration tier classification
Reliability System
- Multi-period uptime tracking: 1-month, 6-month, 1-year, 5-year
- Flag-specific uptime with priority: Exit > Guard > Fast > Running
- Network percentile positioning (5th, 25th, 50th, 75th, 90th, 95th, 99th)
- Statistical outlier detection using β₯2Ο standard deviation threshold
- Uptime normalization from Onionoo 0-999 scale to 0-100%
- Minimum 30 data points required for valid calculations
Network Health Dashboard
Real-time metrics at network-health.html:
- Relay counts by role (exit/guard/middle) with percentages
- Bandwidth distribution (total, by role, mean/median per category)
- Uptime statistics (1mo mean/median by role, multi-period series)
- AROI validation status (CIISS spec v2 + v3 dual-spec): per-version success rates, ciissversion adoption, peer-issue alerts (π¨ leaked-key incidents, β³ pending Onionoo refresh)
- IPv4/IPv6 adoption rates
- Flag distribution (Fast, Stable, HSDir, V2Dir, Authority)
- New relay tracking (24h, 30d, 6mo, 1yr)
Intelligence Engine (6 Layers)
Pre-computed analysis attached to contact pages:
- Basic Relationships β total countries, networks, operators, families, platforms
- Concentration Patterns β top-3 country/AS weight, Five Eyes percentage, no-contact percentage
- Performance Correlation β measured percentage, underutilized relay detection, CW/BW efficiency ratio
- Infrastructure Dependency β unique Tor versions, critical AS identification (>5% weight), sync risk assessment
- Geographic Clustering β Five/Fourteen Eyes influence, regional HHI concentration index
- Capacity Distribution β Gini coefficient, guard/exit capacity percentages
Directory Authorities
misc/authorities.html provides:
- Authority uptime statistics with Z-score outlier detection
- Version compliance tracking
- Consensus participation monitoring
- Geographic distribution
./allium.py [options]| Option | Default | Description |
|---|---|---|
--out |
./www |
Output directory for generated files |
--onionoo-url |
https://onionoo.torproject.org/details |
Onionoo API endpoint |
--onionoo-bandwidth-url |
https://onionoo.torproject.org/bandwidth |
Historical bandwidth API endpoint |
--bandwidth-cache-hours |
12 |
Cache time for historical bandwidth data (hours) |
--display-bandwidth-units |
bits |
Units for bandwidth display (bits or bytes) |
--progress |
false |
Show detailed progress with memory usage |
--apis |
all |
API sources: all (~2.4GB) or details (~400MB) |
--filter-downtime |
7 |
Exclude relays offline >N days (0 to disable) |
--workers |
CPU count (min 4) | Parallel workers for page generation |
Examples:
# Generate with progress tracking
./allium.py --progress
# Custom output with bytes units
./allium.py --out /var/www/tor-metrics --display-bandwidth-units bytes
# Minimal memory mode (~400MB instead of ~2.4GB)
./allium.py --apis details --progressAllium integrates with multiple Tor Project APIs:
- URL:
https://onionoo.torproject.org/details - Purpose: Core relay information (bandwidth, flags, location, technical details)
- Memory: ~400MB during processing
Sample response
{
"relays": [{
"fingerprint": "9695DFC35FFEB861329B9F1AB04C46397020CE31",
"nickname": "moria1",
"running": true,
"flags": ["Authority", "Fast", "Running", "Stable"],
"consensus_weight": 27,
"country": "us",
"platform": "Tor 0.4.8.7 on Linux",
"observed_bandwidth": 20971520
}]
}- URL:
https://onionoo.torproject.org/uptime - Purpose: Historical uptime statistics, flag history for reliability analysis, and cross-check source for
first_seencorrection (see Notable behaviour below) - Memory: ~2GB during processing (large historical dataset)
Sample response
{
"relays": [{
"fingerprint": "9695DFC35FFEB861329B9F1AB04C46397020CE31",
"uptime": {
"1_month": "978",
"1_year": "945"
},
"flags": {
"Running": {"1_month": "987", "1_year": "954"},
"Guard": {"1_month": "974", "1_year": "943"}
}
}]
}- URL:
https://onionoo.torproject.org/bandwidth - Purpose: Historical bandwidth statistics for trend analysis
- Cache: Configurable (default: 12 hours)
Performance Features: Parallel API fetching, HTTP conditional requests, graceful fallback to cached data
Allium repairs the first_seen field on each relay using Onionoo's
/uptime endpoint before page generation. This works around a long-standing
upstream Onionoo bug (issues
#40018,
#40028,
#40033,
#40042)
which periodically resets first_seen for large fractions of the network
after backend state-loss events. When the bug is active, a per-run summary
log line reports how many relays were repaired and the resulting
network_mean_age_formatted reflects the corrected (older) dates. Logic
lives in allium/lib/first_seen_correction.py and will be removed once
the upstream bug is fixed.
- Global XSS protection via Jinja2 autoescape
- Input sanitization for all external data sources
- Static generation eliminating server-side vulnerabilities
- No JavaScript dependencies for maximum security
- Real-time memory usage tracking during generation
- Scalable architecture supporting large relay counts
- Python 3.8+
- Jinja2 β₯2.11.2
- pytest β₯6.0.0 β Unit testing framework
- pytest-cov β₯2.10.0 β Coverage reporting
- flake8 β₯3.8.0 β Code style checker
- bandit β₯1.7.0 β Security vulnerability scanner
- safety β₯1.10.0 β Dependency vulnerability checker
- djlint β₯1.0.0 β HTML/template linter
- memory-profiler β₯0.60.0 β Memory usage profiling
Comprehensive documentation in docs/:
- Configuration Guide β All options and automation setup
- Deployment Guide β Web server setup
- Troubleshooting β Common issues and solutions
- Architecture Overview β System design and data flow
- Testing Standards β Test naming and organization
- Security Guide β Security best practices
- Documentation Index β Full navigation
- Roadmap 2025-2026 β Future plans
- Current Capabilities β All working features
- Planned Features β What's coming next
Contributions welcome! See CONTRIBUTING.md for detailed instructions.
Follow Quick Start, then install dev dependencies:
pip install -r config/requirements-dev.txtRun tests: pytest β’ Lint: flake8 . β’ Security scan: bandit -r .
- Security enhancements and vulnerability reporting
- Analytics improvements and new leaderboard categories
- Geographic intelligence and country classification updates
- Performance optimizations and memory efficiency
- Template improvements and UI enhancements
Main AROI leaderboard showing top operators across categories with expandable views.
Detailed ranking of top bandwidth contributors with network impact metrics.
Achievement badge system displaying operator accomplishments.
Contact-based interface for exploring relay operators grouped by contact information.
Individual operator profile showing relay family details and geographic distribution.
UNLICENSE (public domain)
Third-Party Assets: Country flags (GoSquared), Relay flags (The Tor Project)
- Original allium β Fork source
- Tor Metrics Project β Official metrics (inspiration)
- Onionoo API β Tor relay data source
- Tor Project β Privacy and anonymity network
allium β Empowering Tor network analysis with intelligence, security, and performance.




