Shame I had to scroll this far to find PRQL
Shame I had to scroll this far to find PRQL
This is how I torrent over Mullvad. I have no hesitation to recommend Mullvad - but I am not a crypto or security expert.
The main image fails closed - if the VPN goes down, transmission disconnects.
This setup also includes a SOCKS server that proxies your traffic over the same VPN. I use a separate browser (librewolf) and set the SOCKS proxy to :2020 including sending DNS over SOCKS. That’s because my country blocks piracy-related sites at the DNS level. If you don’t need this, you can delete the socks section of the docker-compose file.
On my ubuntu laptop, I install transmission-remote-gtk
in order to click on a magnet link and have it added. Otherwise you have to browse to the container’s web interface, which gets tiresome.
I have this installed as a systemd service so it runs on boot. I use the systemd state and credential features as a safeguard against my own mistakes with permissions, but my long-term goal is to encrypt these files on disk. Linux can be pwned - I have read that around 35% of botnet nodes are linux (although these are presumably mostly weak IoT devices). The secondary benefit of the LoadCredential
/CREDENTIALS_DIRECTORY
mechanism is that it doesn’t expose secrets as environment variables.
The p2p.service file needs to be in that path, but you can put the other files wherever you want.
/root/.secrets/mullvad
:
123456789
""
For mullvad, there is no password, only an account number. I believe that the empty quotes are necessary. This file should be owned by root and chmod 600; containing dir should be 700. Replace the account number with your own account, obvs!
/etc/systemd/system/p2p.service
:
[Unit]
Description=p2p
Requires=docker.service multi-user.target
After=docker.service network-online.target dhcpd.service
[Service]
Restart=always
RemainAfterExit=yes
WorkingDirectory=/usr/local/bin/p2p
ExecStart=docker compose up --remove-orphans
ExecStop=docker compose down
LoadCredential=mullvad:/root/.secrets/mullvad
DynamicUser=yes
SupplementaryGroups=docker
StateDirectory=p2p
StateDirectoryMode=700
[Install]
WantedBy=multi-user.target
/usr/local/bin/p2p/docker-compose.yml
:
---
version: "3.7"
services:
p2p:
restart: always
container_name: p2p
image: haugene/transmission-openvpn # see also: https://www.nickkjolsing.com/posts/dockermullvadvpn/
cap_add:
- NET_ADMIN
sysctls:
- "net.ipv6.conf.all.disable_ipv6=0" # ipv6 must be enabled for Mullvad to work
volumes:
- ${STATE_DIRECTORY:-./config/}:/config # dir managed by systemd - but defaults to ./config if running interactively
- ${CREDENTIALS_DIRECTORY:-.}/mullvad:/config/openvpn-credentials.txt:ro # var populated by LoadCredential - but defaults to ./mullvad if running interactively
- transmission:/data
- transmission_incomplete:/data/incomplete
- /my/directory/Downloads:/data/completed
environment:
- OPENVPN_PROVIDER=MULLVAD
- OPENVPN_CONFIG=se_all # sweden
- LOCAL_NETWORK=192.168.1.0/24 # put your own LAN network here - in most cases it should end in .0/24
- TRANSMISSION_WEB_UI=flood-for-transmission # optional
ports:
- 9091:9091
- 80:9091
- 2020:2020
socks:
restart: always
container_name: socks
image: lthn/dante
network_mode: "service:p2p"
volumes:
- ./sockd.conf:/etc/sockd.conf
depends_on:
- p2p
volumes:
transmission:
external: false
transmission_completed:
external: false
transmission_incomplete:
external: false
/usr/local/bin/p2p/sockd.conf
:
logoutput: stderr
# debug: 2
internal: 0.0.0.0 port = 2020
external: tun0
external.rotation: route
clientmethod: none
socksmethod: username none
user.privileged: root
user.notprivileged: nobody
user.unprivileged: sockd
# Allow everyone to connect to this server.
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error # disconnect
}
# Allow all operations for connected clients on this server.
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bind connect udpassociate
log: error # connect disconnect iooperation
#socksmethod: username
}
# Allow all inbound packets.
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bindreply udpreply
log: error # connect disconnect iooperation
}
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable p2p
sudo systemctl start p2p
systemctl status p2p
sudo systemd-run -P --wait -p LoadCredential=mullvad:/root/.secrets/mullvad docker compose up --remove-orphans
/usr/local/bin/p2p
and run docker compose pull
to update the images.Hmm. I run mine off a usb3 ssd and it’s faster, but still slow.
It’s OK, but I’d suggest:
Atom > arm64 > arm32
I ran on a Pi 4, but switched to a PC for jellyfin. The pi can’t transcode for shit. It was slow to boot and slow over SSH.
Look for a NUC - they’re designed for desktop use, so they have more poke than a Pi. The N6005 CPU is a good choice, the N5105 is ok. These are x64, so you’ll have the widest range of packages. 4GB will do, if its upgradeable later. NUCs usually take SODIMMs, which you can pick up on ebay for peanuts.
Bear in mind that network chipset will be your bottleneck in some use cases. If it has a “gigabit port” but only a cheap chipset, and you use it as a router, you might max out at ADSL speeds… in that case you’ll wish you’d gone for a box designed for soft routing, which are a fair bit pricier.
Pi is not the only SoC, merely the best-known.
I’d earn anyone thinking of buying a Pi for a home server: ARM is widely supported, but you might regret investing in arm32. Atom is a safer choice.
They don’t supply PoE, mind.
I’m planning an ubiquiti deployment:
The R86S is the same price as the dream machine, but good luck running pihole on the DM.
I considered Mikrotik, but my mum would have to call me every time there was an issue, and it would only be marginally cheaper. I expect any competent local tech to be able to support unifi and opnsense.
There are many similar. The best is GoWin R86S
…or MIPS…
Big fan of Mikrotik, but it helps to have some experience.
Haven’t tried hex, but RB2011 would be my default recommendation, and I’ve seen RB4009 for ~£120 (bargain of the century!)
Agreed, although I prefer pihole on a separate device. DNS blocking is best blocking.
Adware can detect that crap isn’t loaded, but it is indistinguishable from the crap server being down. Normal page blocking is a lot more detectable, so assume pages then instruct you to disable your blocker.
Also, DNS blocking saves you bandwidth.
Tailscale ftw!
I use tailscale as a mullvad client. Really happy with both.
Ugh, a Magic String (I call it that whatever the type)
FACILITY_MAX_PRESSURES = {
"Durham": 1000,
"Ipswich": 500,
"Calne": 750,
}
max_pressure = list(sorted(
FACILITY_MAX_PRESSURES.values()
))[-1]
if water_pressure > max_pressure:
blah
Obviously it should really pull from facility management, but that’s a bunch of moving parts where a constant is how you’d prefer the code to work
Tbh it starts to look better to just define a constant and comment it.
I have an always-on vpn container and a transmission server container on my home server. Then I use transmission as a client on my laptop and I don’t need to continually connect and disconnect.
Any interest in a how-to guide? I won’t get to it for at least two weeks, mind.
Your concern about this is misguided. Inter-process communication always has to cross a barrier, by definition.
I take it http also feels wrong to you?
Binary protocols do exist, e.g. gRPC, but they incur costs of their own.