self-claimable tor web hosting in a docker container.
  • Shell 67.4%
  • Dockerfile 32.6%
Find a file
2026-11-02 05:18:43 +01:00
etc chore: harden configs, fix watch.sh polling, and rewrite README 2026-11-02 05:12:50 +01:00
.gitignore initial commit 2026-11-02 05:10:48 +01:00
docker-compose.yml fuck the tories 2026-11-02 05:18:43 +01:00
Dockerfile chore: harden configs, fix watch.sh polling, and rewrite README 2026-11-02 05:12:50 +01:00
README.md chore: harden configs, fix watch.sh polling, and rewrite README 2026-11-02 05:12:50 +01:00
watch.sh fix: harden watch.sh with atomic writes, key validation, and timeouts 2026-11-02 05:13:58 +01:00

Claim This Site

Deploy a website to a Tor onion address. The site is served over HTTP and files are uploaded via SFTP over SSH, both tunneled through Tor.

How It Works

  1. A Tor hidden service exposes ports 80 (nginx) and 22 (sshd).
  2. You curl the /claim endpoint through Tor, sending your SSH public key as the User-Agent header.
  3. A background watcher (watch.sh) detects the key and installs it into the site user's authorized_keys.
  4. You scp your website files to the onion address.
  5. nginx serves the files at the onion URL.

Prerequisites

  • Docker (or a compatible container runtime)
  • netcat (/usr/bin/nc) for the SSH proxy
  • tor running locally (or use the container's tor)
  • curl
  • ssh client (ssh-keygen, scp)

Quick Start

  1. Build and start the container:

    docker compose up -d
    
  2. Wait a few seconds, then grab the onion address:

    docker compose exec site1 cat /var/lib/tor/hidden_service/hostname
    
  3. Claim the site (sends your public key to the server):

    TOR_ADDRESS=127.0.0.1:9050
    ONION=<paste-onion-address>.onion
    http_proxy=socks5h://${TOR_ADDRESS} \
      curl -H "User-Agent: $(cat ~/.ssh/id_ed25519.pub)" \
      ${ONION}/claim
    
  4. Upload your site:

    scp -r -o StrictHostKeyChecking=no \
      -o ProxyCommand="nc -X 5 -x ${TOR_ADDRESS} %h %p" \
      /path/to/local/website/ site@${ONION}:/site/
    
  5. Visit your site:

    http_proxy=socks5h://${TOR_ADDRESS} curl ${ONION}/
    

Configuration

All configuration lives under etc/:

  • etc/tor/torrc - Tor hidden service and SOCKS port
  • etc/nginx/http.d/default.conf - nginx vhost
  • etc/ssh/sshd_config - SSH daemon (SFTP-only, key auth)
  • etc/supervisord.conf - process manager for all services

Docker

The Dockerfile builds an Alpine image with supervisor managing nginx, sshd, and tor. The docker-compose.yml file handles the build and a persistent volume for Tor's data directory so the onion address survives container restarts.

Security Notes

  • The site user is chrooted to /var/www/html and forced into internal-sftp. No shell access is possible.
  • Password authentication is disabled. Only key-based auth works.
  • The /claim endpoint returns 404 by design; it only exists to trigger the key-installation watcher.
  • nginx version is hidden (server_tokens off).