Tor Mirror and Updates
Published on 2023-12-12 by Kevin Zarate
Well, I did it. This abstrate art of a website is finally mirrored on an .onion link. However, I guess anyone actually interested in reading this anonymously should use the Tor browser, so I’ll link that too here.
Tor connects to .onion links bouncing around encrypted pathways. When a user accesses a .onion link through the Tor network, the request travels through multiple volunteer-operated relays, encrypting and redirecting the traffic. This process helps in preserving anonymity by preventing direct tracing of the user’s IP address.
Since I love docker, I just slapped tor onto my docker-compose.yml that hosts this website (and my reverse proxy).
services:
kevinzarate.dev:
image: joseluisq/static-web-server:2-alpine
volumes:
- /mnt/22TB/websites/kevinzarate.dev/:/public/
restart: unless-stopped
container_name: kevinzarate.dev-site
labels:
- traefik.enable=true
- traefik.http.routers.personal-site-1.rule=Host(`kevinzarate.dev`)
- traefik.http.routers.personal-site-1.entrypoints=https
- traefik.http.routers.personal-site-1.tls=true
- traefik.http.routers.personal-site-1.tls.certresolver=porkbun
- traefik.http.services.personal-site-1.loadbalancer.server.port=80
networks:
- traefik-proxy
- websites-and-tor
tor:
container_name: kevinzarate.dev-onion
image: peterdavehello/tor-socks-proxy:latest
ports:
- 9050:9050
- 9051:9051
restart: always
depends_on:
- kevinzarate.dev
stop_grace_period: 1m
volumes:
- /home/kevin/docker-data/tor/torrc:/etc/tor/torrc
- /home/kevin/docker-data/tor/hidden_service:/var/lib/tor/hidden_service
networks:
- websites-and-tor
networks:
websites-and-tor: {}
traefik-proxy:
external: true
In my Docker setup, my Traefik reverse proxy manages web traffic. The kevinzarate.dev-site container hosts static web content while Tor hosts a hidden service as specified in the /etc/torrc file.
############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80 kevinzarate.dev-site:80
I used mkp224o to generate a vanity url and then mounted a folder as /var/lib/tor/hidden_service so I could keep the same url after restarting the container and use a custom one at the same time.
Update 2024-06-27
Updated the docker-compose.yaml to reflect changes in my setup and I’ve since moved on to Hugo to manage my website instead of text files with HTML