How to Share OSS OS via Torrent [with VPNs]
TL;DR
P2P is not just about crypto stuff, like:
A decentralized bitcoin exchange network
It can be a way to share with others what you found useful.
+++ and a chance to get better with VPNs
Intro
P2P is all about sharing.
And it can power also web3 websites via IPFS + UD’s.
But this post is all about how to share open source software.
First of all: Why sharing Raspberry Pi OS via .torrent?
I got some incompatibility issues with some IoT Projects and the latest Pi Images (bookworm, DEBIAN12).
So want to make sure that the projects that I place effort on will continue to work.
We can get Legacy images from here
But what if at some point they wont be available?
The raspberry team provides for each image a .torrent
file so that any of us will become P2P keepers of the OS history.
How to Setup Torrents for a Raspberry Pi
I have been collecting some similar interesting Services to spin with Docker.
You have many alternatives, among them: QBittorrent, Transmission,…
Qbittorrent with the Raspberry Pi
You need this docker-compose config file:
Thanks to this guide and this one for Transmission
Transmission with the Pi
How to Torrent with a VPN
Here I want to show you have to do it using the VPN you just setup.
But you can do similarly with 3rd party VPNs: https://protonvpn.com/support/bittorrent-vpn/
Choose one and use your wg0
network interface from the wireguard client:
Key Points to understand:
network_mode: "host"
- This allows the container to share the host network stack directly, including the
wg0
interface.
- This allows the container to share the host network stack directly, including the
No Port Mapping
- When using
network_mode: "host"
, port mapping (ports:
) is unnecessary since the container uses the host’s network stack.
- When using
Ensure
wg0
is Active- Before starting the container, ensure that your WireGuard interface (
wg0
) is active and routes traffic properly. Use the following command to check:
- Before starting the container, ensure that your WireGuard interface (
wg show
- Routing Through WireGuard
- Verify that your host system routes the necessary traffic through the WireGuard tunnel. For example, you may need to ensure that the
qBittorrent
container traffic follows the correctwg0
routing rules.
- Verify that your host system routes the necessary traffic through the WireGuard tunnel. For example, you may need to ensure that the
Verify the Setup After starting the container with docker-compose up -d
:
- Access the
qBittorrent
Web UI athttp://<host-ip>:6011
. - Verify the external IP of your
qBittorrent
traffic to confirm it uses the WireGuard tunnel:- Check your IP address via a tracker (e.g., ipleak.net) or using the tracker settings in
qBittorrent
.
- Check your IP address via a tracker (e.g., ipleak.net) or using the tracker settings in
#docker exec -it qbittorrent sh
curl -sS https://ipinfo.io/json #the command to use
#wget -qO- https://ipinfo.io/json
#for windows you would use
#powershell -Command "(Invoke-WebRequest -Uri https://ipinfo.io/json).Content"
Conclusions
So thats it for now.
You you can improve software availability and resilience all with torrents and P2P.
Kind of share your work, but with the sense of…share what you’ve saved?
For example, if you are keeping stored a copy of the F/OSS Debian ISO, you can share it with any other person interested to bring it to their PCs.
At least, Ill keep a copy of Raspberry Pi OS (Debian 11) for the Pi.
Why that one? Because I use it for some IoT Projects
And probably some good Armbian for the Orange Pi 5
FAQ
VPN Providers
There are many VPN providers, I have tried these:
Setup a VPN with Wireguard on a VPS
How to use Gluetun
How to check IPs
curl -sS https://ipinfo.io/json #the command to use
curl -sS http://ip-api.com/json/ #provides info about country, ISP, ...
curl -6 ifconfig.me #ipv6 info