Skip to content
้กน็›ฎ

ๅ…ณไบŽ

Hardened Docker AIO Tor Bridge, Relay & Exit Stack ๐Ÿง…๐Ÿ‹๐Ÿ›ก๏ธ

็ณป็ปŸไธŽๅŸบ็ก€่ฎพๆ–ฝ

่ฟ™ไบ›ๆ•ฐๅญ—ๅฆ‚ไฝ•็ปŸ่ฎก

ๅฎžๆต‹ๆ˜Ÿๆ ‡ๅขž้•ฟ

24ๅฐๆ—ถ
0
7ๅคฉ
0
15ๅคฉ
0
1ไธชๆœˆ
ๆญฃๅœจๆ”ถ้›†ๅކๅฒ

ๅ„ๅ‘จๆœŸๅ†…็š„ๆ˜Ÿๆ ‡ๅ‡€ๅ˜ๅŒ–๏ผŒๅ‘จๆœŸ็›ธไบ’้‡ๅ ๏ผŒๅนถ้žๆฏๆ—ฅๆ–ฐๅขžใ€‚็ผบๅคฑ็š„ๆต‹้‡ไฟๆŒ็ฉบ็™ฝใ€‚ๆ˜Ÿๆ ‡ไปฃ่กจๅ…ณๆณจๅบฆ๏ผŒไธไปฃ่กจ่ฝฏไปถ่ดจ้‡ใ€‚

README.md

ๅŽŸๆ–‡

๐Ÿง… Tor Guard Relay

Build Release Platforms Docker Pulls License Donate

Onion Bridge/Middle/Guard/Exit Relay

A hardened, production-ready Tor relay with built-in diagnostics and monitoring

Quick Start โ€ข Features โ€ข ๐ŸŒ Live Dashboard โ€ข Documentation โ€ข Gallery โ€ข FAQ โ€ข Architecture โ€ข Tools โ€ข Contributing


๐Ÿ†• v2.2.1: directory-request DoS defenses

Current source version: v2.2.1.

[!IMPORTANT] ๐Ÿ›ก๏ธ Current v2.2.1 source builds use the reviewed Tor source pin. The original release shipped Tor 0.4.9.15; subsequent validated rebuilds can refresh the existing image tags. Tor comes from authenticated upstream source instead of waiting for Alpineโ€™s Tor package. Read the upgrade and torrc guidance. Deploy a validated published image, recreate the container and verify the running binary; an image tag alone does not establish a successful upgrade.

๐Ÿ“ torrc: Leave DoSBeginDirRateEnabled, DoSBeginDirRate, DoSBeginDirBurst and DoSBeginDirDefenseType unset so the network consensus controls them. No new torrc lines are required. After upgrading, review any temporary DirCache 0 workaround. Keep DirPort 0 if it is part of your deployment. The sample configs document this without forcing thresholds.

Improvement Operator benefit Guide
๐Ÿ”Ž Current-run health and doctor Separate liveness, configuration, freshness and readiness Tools
โš™๏ธ Validated atomic config changes Mounted torrc remains authoritative; generated config follows ENV Deployment
๐Ÿ” Encrypted complete recovery Authenticate config/includes, keys and state before staged restore Backup
๐Ÿ“Š Host inventory and metrics Observe a fleet without exposing a metrics listener Monitoring
๐Ÿ—๏ธ Build-once release gates Validate all four candidates before promoting their exact images Release process
๐Ÿ›ก๏ธ Independent security updates Reviewed Lyrebird pins, direct/indirect Go fixes and six-hour read-only scans Security policy

Stable runtime: Alpine 3.25.0 pinned by digest. Builder: Go 1.27.3. The independent lock includes Pion STUN 3.1.7 and klauspost/compress 1.20.3. Both variants build the reviewed Tor source pin and enforce its security floor.

Generated torrc is regenerated from ENV on restart. Persist operator changes in deployment ENV or mount a torrc. Verify an encrypted backup and compare fingerprints before a real upgrade; never activate two copies of one relay identity.


๐Ÿš€ What is This?

Tor Guard Relay is a production-ready, Tor relay container designed for privacy advocates who want to contribute to the Tor network securely and efficiently.

๐ŸŒ‰ Multi-Mode: guard, exit, and bridge with obfs4 transport. Configure via TOR_RELAY_MODE.

Why Choose This Project?

  • ๐Ÿ›ก๏ธ Security-First - Hardened Alpine Linux, non-root operation, and minimized port exposure
  • ๐Ÿชถ Lightweight - Alpine runtime with build tools kept in the builder stages
  • ๐ŸŽฏ Simple - One command to deploy, minimal configuration needed
  • ๐Ÿ“Š Observable - 9 POSIX shell tools with JSON health and PID-preserving config reloads
  • ๐ŸŒ‰ Multi-Mode - Supports guard, exit, and bridge (obfs4) relays
  • ๐Ÿ”„ Automated - Weekly security rebuilds, CI/CD ready
  • ๐Ÿ“š Documented - Comprehensive guides for deployment, monitoring, backup, and more
  • ๐Ÿ—๏ธ Multi-Arch - Native support for AMD64 and ARM64 (Raspberry Pi, AWS Graviton, etc.)

๐ŸŒ Live Production Network

Battle-tested in production. See it live: relays.brokenbotnet.com

๐ŸŒ‰ Bridges (Obfs4) โ€ข ๐Ÿ›ก๏ธ Middle/Guard โ€ข ๐Ÿšช Exit across 16 countries

๐Ÿ‡ฏ๐Ÿ‡ต โ€ข ๐Ÿ‡ฐ๐Ÿ‡ท โ€ข ๐Ÿ‡ธ๐Ÿ‡ฌ โ€ข ๐Ÿ‡ฒ๐Ÿ‡พ โ€ข ๐Ÿ‡ฎ๐Ÿ‡ฉ โ€ข ๐Ÿ‡ป๐Ÿ‡ณ โ€ข ๐Ÿ‡ญ๐Ÿ‡ฐ โ€ข ๐Ÿ‡ฆ๐Ÿ‡บ โ€ข ๐Ÿ‡ท๐Ÿ‡บ โ€ข ๐Ÿ‡น๐Ÿ‡ท โ€ข ๐Ÿ‡ฟ๐Ÿ‡ฆ โ€ข ๐Ÿ‡จ๐Ÿ‡ฆ โ€ข ๐Ÿ‡บ๐Ÿ‡ธ โ€ข ๐Ÿ‡ฒ๐Ÿ‡ฝ โ€ข ๐Ÿ‡ง๐Ÿ‡ท โ€ข ๐Ÿ‡จ๐Ÿ‡ฑ


๐Ÿ”’ Security Model

Port Exposure Policy

  • 9001 ORPort, public
  • 9002 obfs4 for bridge mode
  • DirPort, Disabled (0) by default

Environment Variables

  • TOR_ORPORT default 9001
  • TOR_OBFS4_PORT default 9002
  • TOR_DIRPORT default 0 (Disabled)

Diagnostics are run only through docker exec, with no exposed monitoring ports.

Minimal surface area, roughly variant-dependent image size.


โšก Quick Start

System Requirements

Component Minimum Recommended
CPU 1 core 2+ cores
RAM 512 MB 1 GB+
Disk 10 GB 20 GB+ SSD
Bandwidth 10 Mbps 100+ Mbps
Uptime 95 percent 99 percent
Docker 20.10+ Latest

Supported Architectures: AMD64, ARM64

Network Security Notes

โš ๏ธ Port Exposure:

  • Guard/Middle/Exit: Port 9001 (ORPort) should be publicly accessible
  • Bridge: Ports 9001 (ORPort) and 9002 (obfs4) should be publicly accessible
  • No monitoring ports - all diagnostics via docker exec commands only
  • Use --network host for best IPv6 support (Tor recommended practice)

Interactive Quick Start (Recommended for Beginners)

๐Ÿš€ Try our interactive setup script:

# Download and run the quick-start script
curl -fsSL https://raw.githubusercontent.com/r3bo0tbx1/tor-guard-relay/main/scripts/utilities/quick-start.sh -o quick-start.sh
chmod +x quick-start.sh && sh ./quick-start.sh

The script will:

  • โœ… Guide you through relay type selection (guard, exit, bridge)
  • โœ… Collect required information with validation
  • โœ… Generate deployment commands or docker-compose.yml
  • โœ… Provide next steps and monitoring guidance

Manual Deployment

Step 1: Create your relay configuration (or use our example):

mkdir -p ~/tor-relay && cd ~/tor-relay && curl -o relay.conf https://raw.githubusercontent.com/r3bo0tbx1/tor-guard-relay/refs/heads/main/examples/relay-guard.conf && nano relay.conf

Step 2: Run (Docker Hub)

docker run -d \
  --name tor-relay \
  --restart unless-stopped \
  --network host \
  --security-opt no-new-privileges:true \
  -v $(pwd)/relay.conf:/etc/tor/torrc:ro \
  -v tor-guard-data:/var/lib/tor \
  -v tor-guard-logs:/var/log/tor \
  r3bo0tbx1/onion-relay:latest

Step 3: Verify it's running:

# Check status
docker exec tor-relay status

# View fingerprint
docker exec tor-relay fingerprint

# Stream logs
docker logs -f tor-relay

That's it! Your relay will bootstrap in 10-30 minutes and appear on Tor Metrics within 1-2 hours.

๐Ÿ“– Need more? See our comprehensive Deployment Guide for Docker Compose, Cosmos Cloud, Portainer, and advanced setups.


๐ŸŽฏ Choosing a Variant

We offer two build variants to match your risk tolerance and requirements:

Registry Stable tags Edge tags
๐Ÿณ Docker Hub latest, 2.2.1 edge
๐Ÿ“ฆ GHCR latest, 2.2.1 edge, 2.2.1-edge

Each current tag supports AMD64 and ARM64. Retired container versions can be removed while historical GitHub releases and their downloadable assets remain available. Retained v2.2.0 builds can be selected by digest for rollback. Validated package rebuilds can refresh version tags; use a digest to select an exact build. Publishing intermediates are addressed by digest and do not need public tags. The branded Docker Hub overview is maintained separately from this full guide.

๐Ÿ”„ Merging a newer Tor source pin into main starts ๐Ÿš€โœจ automatically. For other merged fixes or a retry, run it on main, leave source_tag empty and enable Publish validated candidates. All four candidates must pass before publishing. An explicit source_tag rebuilds that release's original code. See the rebuild commands and source policy.

Stable Variant (Recommended)

Base: Alpine 3.25.0 | Recommended for: Production relays

  • โœ… Battle-tested Alpine stable release
  • โœ… Weekly automated rebuilds with latest security patches
  • โœ… Proven stability for long-running relays
  • โœ… Available on both Docker Hub and GHCR
# Pull from Docker Hub (easiest)
docker pull r3bo0tbx1/onion-relay:latest
docker pull r3bo0tbx1/onion-relay:2.2.1

# Pull from GHCR
docker pull ghcr.io/r3bo0tbx1/onion-relay:latest
docker pull ghcr.io/r3bo0tbx1/onion-relay:2.2.1

Edge Variant (Testing Only)

Base: Alpine edge | Recommended for: Testing, security research

  • โšก Bleeding-edge Alpine packages (faster security updates)
  • โšก Latest Tor and obfs4 versions as soon as available
  • โšก More frequent rebuilds - Every 3 days + weekly (~2-3x faster updates than stable)
  • โš ๏ธ NOT recommended for production - less stable, potential breaking changes
  • ๐Ÿ“ฆ Available on both Docker Hub and GHCR
# Pull from Docker Hub
docker pull r3bo0tbx1/onion-relay:edge

# Pull from GHCR
docker pull ghcr.io/r3bo0tbx1/onion-relay:edge
docker pull ghcr.io/r3bo0tbx1/onion-relay:2.2.1-edge

When to use edge:

  • ๐Ÿ”ฌ Testing new Tor features before stable release
  • ๐Ÿ›ก๏ธ Security research requiring latest packages
  • ๐Ÿงช Non-production test environments
  • ๐Ÿš€ Early adopters willing to accept potential breakage

๐Ÿ’ก Our recommendation: Use stable for production relays, edge only for testing or when you specifically need the latest package versions.


๐Ÿ—๏ธ Deployment Methods

Choose the method that fits your workflow.

Method Best For Guide
๐Ÿณ Docker CLI Quick testing Guide
๐Ÿ“ฆ Docker Compose Production Guide
โ˜๏ธ Cosmos Cloud UI based deployment Guide
๐ŸŽ›๏ธ Portainer Web UI Guide

New to Docker? Try Cosmos Cloud by azukaar - a gorgeous, self-hosted Docker management platform.

Multi-Relay Setup

Running multiple relays? We have templates for that:

See Deployment Guide for complete instructions.


๐Ÿ”ง Built-in Tools

๐Ÿ†• doctor, config and host-only encrypted backup/inventory extend the original tools. See the complete tools reference.

Seven busybox-only diagnostic and operational tools are included.

Tool Purpose Usage
status Full health report docker exec tor-relay status
health JSON health docker exec tor-relay health
refresh Validate and reload torrc without restarting Tor docker exec tor-relay refresh
fingerprint Show fingerprint docker exec tor-relay fingerprint
bridge-line obfs4 line docker exec tor-relay bridge-line --address 203.0.113.42
gen-auth Credentials for Nyx docker exec tor-relay gen-auth
gen-family Happy Family key gen docker exec tor-relay gen-family MyRelays
# Full health report with emojis
docker exec tor-relay status

# JSON output for automation/monitoring
docker exec tor-relay health

# After editing torrc: validate and reload without replacing the Tor process
docker exec tor-relay refresh

Example JSON:

{
  "status": "up",
  "pid": 1,
  "uptime": "01:00:00",
  "bootstrap": 100,
  "reachable": "true",
  "errors": 0,
  "nickname": "MyRelay",
  "fingerprint": "1234567890ABCDEF"
}

๐Ÿ“– Complete reference: See Tools Documentation for all 9 tools with examples, safety checks, JSON schema, and integration guides.


๐Ÿ“Š Monitoring and Observability

Real-time CLI monitoring and external observability are supported for minimal image size and maximum security.

Real-Time Monitoring (Nyx)

You can connect Nyx (formerly arm) to your relay securely using the Control Port.

  1. Generate credentials: docker exec tor-relay gen-auth
  2. Add the hash to your config
  3. Connect via local socket or TCP

๐Ÿ“– Full Setup: See the Control Port Guide for step-by-step Nyx configuration.

JSON Health API

The health tool provides JSON output for monitoring integration:

# Get health status (raw JSON)
docker exec tor-relay health

# Parse with jq (requires jq installed on HOST machine)
docker exec tor-relay health | jq .

# Example cron-based monitoring
*/5 * * * * docker exec tor-relay health | jq -e '.liveness and .config_valid and .readiness and .fresh' >/dev/null || alert

Note: jq must be installed on your HOST machine (apt install jq / brew install jq), NOT in the container.

๐Ÿ“– Complete guide: See Monitoring Documentation for Prometheus, Grafana, alert integration, and observability setup.


๐ŸŽฏ Key Features

Security & Reliability

  • โœ… Non-root execution (runs as tor user)
  • โœ… Ultra-minimal Alpine Linux base (~variant-dependent image size)
  • โœ… Busybox-only tools (no bash/python dependencies)
  • โœ… Automatic permission healing on startup
  • โœ… Configuration validation before start
  • โœ… Tini init for proper signal handling
  • โœ… Graceful shutdown with cleanup

Operations & Automation

  • โœ… 9 POSIX shell tools (status, doctor, config, health, refresh, fingerprint, bridge-line, gen-auth, gen-family)
  • โœ… PID-preserving torrc reloads with validation before SIGHUP
  • โœ… JSON health API for monitoring integration
  • โœ… Multi-mode support (guard, exit, bridge with obfs4)
  • โœ… Happy Family support (Tor 0.4.9.2-alpha or later, using key-based relay families)
  • โœ… ENV-based config (TOR_RELAY_MODE, TOR_NICKNAME, TOR_FAMILY_ID, etc.)
  • โœ… Multi-architecture builds (AMD64, ARM64)
  • โœ… Weekly security rebuilds via GitHub Actions
  • โœ… Docker Compose templates for single/multi-relay
  • โœ… Cosmos Cloud support with one-click deploy
  • โœ… Registry Maintenance: Evidence-backed retention preserves current, original-release, rollback and deployed images; automatic cleanup waits 14 days after the published notice and runs at most every 14 days with fresh protection

Developer Experience

  • โœ… Comprehensive documentation (8 guides)
  • โœ… Example configurations included
  • โœ… GitHub issue templates
  • โœ… Automated dependency updates (Renovate)
  • โœ… CI/CD validation and testing
  • โœ… Multi-arch support (same command, any platform)

๐Ÿ–ผ๏ธ Gallery

Cosmos Cloud Dashboard
Docker Logs (Bootstrapping)
Tor Guard Relay in the Cosmos Cloud dashboard Tor relay Docker logs showing bootstrap progress
Relay Status Tool
obfs4 Bridge Line
Relay status tool output for a running Tor exit relay Generated obfs4 client bridge line and sharing guidance
Nyx Bandwidth Monitoring
Nyx bandwidth monitoring for a running Tor exit relay

๐Ÿ“š Documentation

Comprehensive documentation organized by topic:

Getting Started

Technical Reference

Legal & Community

Project Info

๐Ÿ’ก Tip: Start with the FAQ for quick answers or Documentation Index for complete navigation.


๐Ÿ› ๏ธ Configuration

Minimal Configuration

Nickname MyTorRelay
ContactInfo email:your-email[]example.com url:https://example.com proof:uri-familyid-ed25519 ciissversion:3
ORPort 9001
ORPort [::]:9001
DirPort 0
ExitRelay 0
SocksPort 0
DataDirectory /var/lib/tor
Log notice file /var/log/tor/notices.log

๐Ÿ“ ContactInfo format: We recommend the ContactInfo Information Sharing Specification (CIISS) v3, a machine-readable format that replaces @ with [] and includes structured fields like email:, url:, proof:, pgp:, hoster:, and more. Use the CIISS Generator to create yours.

Production Configuration

RelayBandwidthRate 50 MBytes
RelayBandwidthBurst 100 MBytes
NumCPUs 2
MaxMemInQueues 512 MB
ORPort [::]:9001

Example Configurations

Examples are found in the examples/ directory for complete, annotated configuration files:

  • relay-guard.conf - Recommended production config
  • Additional examples for specific use cases

๐Ÿ“– Configuration help: See Deployment Guide for complete reference.

Happy Family (Tor 0.4.9.2-alpha or Later)

Tor 0.4.9.2-alpha introduced Happy Families, a cryptographic key-based replacement for MyFamily. Instead of listing every relay fingerprint in every relay's config, all relays in a family share one secret key.

Why upgrade?

  • Reduces the descriptor overhead caused by repeated MyFamily lists
  • Simpler to maintain - one key file instead of Nร—N fingerprint entries

Quick setup:

# 1. Generate a family key (run on any ONE relay container)
docker exec tor-relay gen-family MyRelays

# 2. Copy the key to other relay containers
docker cp tor-relay:/var/lib/tor/keys/MyRelays.secret_family_key .
docker cp MyRelays.secret_family_key other-relay:/var/lib/tor/keys/

# 3. Fix permissions inside the target container
docker exec -u 0 other-relay chown 100:101 /var/lib/tor/keys/MyRelays.secret_family_key
docker exec -u 0 other-relay chmod 600 /var/lib/tor/keys/MyRelays.secret_family_key

# 4. Add FamilyId to each relay's torrc, then reload each Tor process
docker exec tor-relay refresh
docker exec other-relay refresh

Torrc configuration:

During the transition period, configure both FamilyId and MyFamily:

# Happy Family (Tor 0.4.9.2-alpha or later)
FamilyId wweKJrJxUDs1EdtFFHCDtvVgTKftOC/crUl1mYJv830

# MyFamily (legacy - keep during transition)
MyFamily 9A2B5C7D8E1F3A4B6C8D0E2F4A6B8C0D2E4F6A8B
MyFamily 1F3E5D7C9B0A2F4E6D8C0B2A4F6E8D0C2B4A6F8E

The Tor Project will announce when MyFamily can be removed.

ENV-based config (alternative to mounted torrc):

TOR_FAMILY_ID accepts the exact 43-character unpadded base64 value generated by Tor.

environment:
  TOR_FAMILY_ID: "wweKJrJxUDs1EdtFFHCDtvVgTKftOC/crUl1mYJv830"
  TOR_MY_FAMILY: "FINGERPRINT1,FINGERPRINT2,FINGERPRINT3"

โš ๏ธ Treat the .secret_family_key like a private key. Anyone with this file can claim their relay belongs to your family. Back it up securely - losing it means regenerating for all relays.

๐Ÿ“– Full guide with troubleshooting: See Deployment Guide | Official docs: Tor Happy Family Guide


๐Ÿ” Monitoring Your Relay

Check Bootstrap Status

# Quick status
docker exec tor-relay status

# JSON output for automation (raw)
docker exec tor-relay health

# Parse specific field with jq (requires jq on host)
docker exec tor-relay health | jq .bootstrap

View on Tor Metrics

After 1-2 hours, find your relay:

๐Ÿ”— Tor Metrics Relay Search

Search by:

  • Nickname (e.g., "MyTorRelay")
  • Fingerprint (get with docker exec tor-relay fingerprint)
  • IP address

Expected Timeline

Milestone Time What to Expect
Bootstrap Complete 10-30 min Logs show "Bootstrapped 100%"
Appears in Consensus 1-3 hours Relay visible in Tor Metrics search
Bandwidth Cap Lifted ~3 days bwauths measure you; 20 KB/s cap removed, traffic ramps up
First Statistics 24-48 hours Bandwidth graphs appear on Tor Metrics
Guard Flag 8+ days Eligible for entry guard selection by clients

๐Ÿ—ณ๏ธ How relay flags work: Tor has 9 Directory Authorities (DAs) that vote every hour to update the consensus. A consensus document is valid if more than half of the authorities signed it, meaning 5 of 9 must agree for a flag to appear. This is why flags take time: your relay must prove itself to a majority of independent, geographically distributed authorities.

To receive the Guard flag, three criteria must all be met:

  • Bandwidth - must have a sufficient consensus weight as measured by bandwidth authorities
  • Weighted Fractional Uptime (WFU) - must demonstrate consistent, reliable uptime
  • Time Known - you're first eligible for the Guard flag on day eight

The Stable flag is a prerequisite for Guard. Only stable and reliable relays can be used as guards.

โš ๏ธ Expect a traffic dip after getting Guard: Once you get the Guard flag, all the rest of the clients back off from using you for middle hops, because when they see the Guard flag, they assume you already have plenty of load from clients using you as their first hop. This is normal, traffic will recover as clients rotate you in as their guard node.

๐Ÿ“– Detailed monitoring: See Monitoring Guide for complete observability setup with Prometheus and Grafana.


๐Ÿ› Troubleshooting

Quick Diagnostics

# Check overall status
docker exec tor-relay status

# Check JSON health (raw)
docker exec tor-relay health

# After changing torrc: validate and reload without a restart
docker exec tor-relay refresh

# View fingerprint
docker exec tor-relay fingerprint

# For bridge mode: Get bridge line
docker exec tor-relay bridge-line --address 203.0.113.42

# Generate Control Port hash
docker exec tor-relay gen-auth

# Generate/view Happy Family key
docker exec tor-relay gen-family MyRelays
docker exec tor-relay gen-family --show

Common Issues

Problem Quick Fix
Container won't start Check logs: docker logs tor-relay
Permission / ownership errors See Deployment Guide
ORPort not reachable Verify firewall: sudo ufw allow 9001/tcp
Not on Tor Metrics Wait 24h, verify bootstrap complete
Low/no traffic Normal for new relays (2-8 weeks to build reputation)

๐Ÿ“– Full troubleshooting: See Tools Documentation for detailed diagnostic procedures.


๐Ÿข Architecture and Design

๐Ÿ“ See the complete Architecture Documentation for detailed technical design with Mermaid diagrams covering:

  • Container lifecycle and initialization flow (6 phases)
  • ENV compatibility layer and configuration priority
  • Config generation for guard/exit/bridge modes with Happy Family support
  • OBFS4V security validation
  • Diagnostic tools architecture
  • Signal handling and graceful shutdown

Why Host Network Mode?

This project uses --network host for important reasons:

  • โœ… IPv6 Support - Direct access to host's IPv6 stack
  • โœ… No NAT - Tor binds directly to ports without translation
  • โœ… Better Performance - Eliminates network overhead
  • โœ… Tor Recommended - Follows Tor Project best practices

Security: The container still runs as non-root with restricted permissions. Host networking is standard for Tor relays.

Multi-Architecture Support

Docker automatically pulls the correct architecture:

# Same command works on:
# - x86_64 servers (pulls amd64)
# - Raspberry Pi (pulls arm64)
# - AWS Graviton (pulls arm64)
docker pull r3bo0tbx1/onion-relay:latest

Verify what you got:

docker exec tor-relay cat /build-info.txt | grep Architecture

๐Ÿค Contributing

Contributions are welcome.

  • ๐Ÿ› Report bugs via GitHub Issues
  • ๐Ÿ’ก Suggest features or improvements
  • ๐Ÿ“– Improve documentation (typos, clarity, examples)
  • ๐Ÿ”ง Submit pull requests (code, configs, workflows)
  • โญ Star the repository to show support
  • ๐Ÿง… Run a relay and strengthen the network!

Development Setup

# Clone repository
git clone https://github.com/r3bo0tbx1/tor-guard-relay.git
cd tor-guard-relay

# Build locally
docker build -t tor-relay:dev .

# Test
docker run --rm tor-relay:dev status

See Contributing Guide for detailed instructions.


๐Ÿ” Security

โš ๏ธ Version Deprecation Notice

Security baseline introduced in v2.0.0. That release addressed Alpine/OpenSSL package exposure (including CVE-2026-31789, fix range openssl >= 3.5.6-r0) and clarified host-kernel guidance for Copy Fail / CVE-2026-31431. Container updates reduce image dependency risk, but CVE-2026-31431 requires host kernel patching by your OS/cloud vendor.

Version policy for v2.0.0 and later: only the latest released version receives updates. When a new version is released, all previous versions automatically become unsupported and no longer receive maintenance, security fixes, or scheduled rebuild updates. Historical Git tags remain available for source reproducibility, while older container versions and tags are pruned according to the registry cleanup policy.

Recommended upgrade path:

docker pull r3bo0tbx1/onion-relay:latest

Best Practices

โœ… Store relay.conf with restricted permissions (chmod 600)
โœ… Never commit configs with sensitive info to Git
โœ… Use CIISS v3 format in ContactInfo for verification
โœ… Regularly update Docker image for security patches
โœ… Monitor logs for suspicious activity
โœ… Configure firewall properly

Security Policy

Found a vulnerability? See our Security Policy for responsible disclosure.

Updates

The shared workflow rebuilds both variants for AMD64 and ARM64 every Sunday at 18:30 UTC and on days 1, 4, 7, โ€ฆ of each month at 12:00 UTC. Each run captures an immutable main commit, validates all four candidates, then publishes their exact images.

Stable Variant (:latest)

  • Schedule: Both shared schedules above
  • Includes: Reviewed Tor source pin + Alpine 3.25.0 library updates
  • Strategy: Rebuilds the captured main source and authenticated Tor package with updated runtime libraries
  • Tags Updated: :latest and the current release version in both registries

Edge Variant (:edge)

  • Schedule: Both shared schedules above
  • Includes: The same reviewed Tor source pin + Alpine edge library updates
  • Strategy: Rebuilds the same captured main source against Alpine edge
  • Tags Updated: Docker Hub :edge; GHCR :edge and the current release's -edge tag

A newer reviewed Tor pin merged into main queues a validated rebuild. Pull the published image and recreate the relay to use the new binary. For a manual rebuild, select main, leave source_tag empty and enable publish. An explicit source_tag rebuilds that exact release. See the release procedure for validation and publication details.

The six-hour ๐Ÿ”’๐Ÿง… upstream watch detects stable Tor releases and retains authenticated proposed pins for review. After a compatible Tor update is merged and validated, rebuild the current project version without moving its Git tag. Scheduled rebuilds never adopt an unreviewed floating Tor version. See Tor source maintenance.


๐ŸŒ Resources

Container Registries

Official Tor Project

This Project


๐Ÿ“Š Project Status

Docker Pulls GitHub Stars Open Issues

Source Version: v2.2.1
Image Size: variant-dependent image size
Registry Cleanup: Retention review โ€ข Explicit tag-only maintenance โ€ข Rollback manifests preserved
Registries: Docker Hub โ€ข GHCR


๐Ÿ“„ License

Project is licensed under the MIT License.
See License for full details.


๐Ÿ™ Acknowledgments

  • The Tor Project for maintaining the global privacy network
  • Alpine Linux for a minimal and secure base image
  • azukaar for Cosmos Cloud
  • All relay operators supporting privacy and anti-censorship worldwide

๐Ÿ’– Support the Project

Running public Tor infrastructure means recurring server, bandwidth, monitoring, and maintenance costs. If this project has been useful to you, a contribution helps keep that infrastructure online and supports continued open-source development.

Donations are always optional. They do not purchase support, priority, influence, or access. They help cover work already being done in public.

Bitcoin (BTC) Monero (XMR)
Bitcoin donation QR code Monero donation QR code

Bitcoin (BTC)

bc1q25xa47uknfeekm8xze06kfv7tjz4crcqqfpcuu

Monero (XMR)

49eiKhJd3uFdRerHk87wx3YCzb3yWQ8kSKTuMc7QjJphY4dG89HAFd8CcKswWn8oUhBJLu4kbjywSX46DwvtGNUV9qLCrVW

Check before sending: Cryptocurrency transactions cannot be reversed. Confirm the network and compare the full address with the QR payload before sending funds.

For additional information, visit the full donation page.

Other Ways to Support

  • โญ Star the repo
  • ๐Ÿ› Report bugs
  • ๐Ÿ’ก Suggest features
  • ๐Ÿ“– Improve documentation
  • ๐Ÿค Submit patches
  • ๐Ÿง… Run a relay

Made with ๐Ÿ’œ for a freer, uncensored internet

Protecting privacy, one relay at a time ๐Ÿ”๐Ÿง…โœจ

โญ Star this repo if you find it useful!

๐ŸŒ Support Internet Freedom
๐Ÿ“š Documentation
โฌ† Back to top

ๆŽข็ดข็›ธๅ…ณ้กน็›ฎ

ๅŠ ่ฝฝไธญโ€ฆ