📖 Story Mode: The Lifecycle of a Request
Below traces the technical journey of a media request, detailing the handshakes, protocols, and file operations that occurs from the moment a user clicks "Request" to the moment they press "Play."
Chapter 1: The Request (HTTPS & Reverse Proxy)
User Action: You open your phone and visit https://requests.mydomain.xyz.
- DNS Resolution: Your phone queries Cloudflare DNS. Cloudflare sees the record is "Grey Clouded" (DNS Only) and returns your Home Public IP.
- The Handshake: Your phone sends a
TCP SYNpacket to your home router on Port443. - The Doorman (Caddy): Your router forwards the packet to the CachyOS Host, which passes it to the Caddy Container (
172.20.0.23). - The Security Check:
- GeoIP: Caddy checks your IP against
GeoLite2-Country.mmdb. Result:SG. Pass. - CrowdSec: Caddy asks the CrowdSec API (
http://crowdsec:8080). Result: "Clean IP". Pass.
- GeoIP: Caddy checks your IP against
- The Handoff: Caddy terminates the SSL connection and opens a new, unencrypted HTTP connection internally to Seerr at
http://172.20.0.12:5055. - The UI: Seerr renders the interface. You search for "Inception" and click Request.
Chapter 2: The Hunt (API & Indexers)
System Action: Seerr needs to find the movie.
- API Call: Seerr sends a
POSTrequest via HTTP to Radarr (http://172.20.0.13:7878/api/v3/movie). - The Search: Radarr sees the new movie. It triggers a "Search" command. It talks to Prowlarr (
http://172.20.0.20:9696) using the Torznab protocol. - The Proxy: Prowlarr has a list of indexers. If an indexer is protected by Cloudflare, Prowlarr forwards the request to FlareSolverr (
http://172.20.0.21:8191), which solves the JavaScript challenge and returns the cookies. - The Grab: Radarr receives a list of releases. It evaluates them against Selected Quality Settings and Custom Formats (synced by Profilarr). It picks the best release (e.g., a 5GB 1080 Efficient).
Chapter 3: The Download (VPN & BitTorrent)
System Action: Downloading the file securely.
- The Dispatch: Radarr sends the
.torrentfile (or magnet link) to qBittorrent via HTTP API (http://172.20.0.1:8080). It attaches the categoryradarr. - The Tunnel: qBit receives the job. However, qBit has no direct internet access. It lives inside the Gluetun container's network stack.
- Encapsulation: qBit initiates a P2P connection. Gluetun intercepts this traffic, encrypts it into WireGuard packets, and shoots it out of the
tun0interface to the AirVPN server in the Netherlands. - The Swarm: To the outside world, the traffic looks like it's coming from the AirVPN server. The file chunks start flying in, landing in the temporary folder
/media/downloads/incomplete.
Chapter 4: The Atomic Move (Storage & Hardlinks)
System Action: The download finishes.
- Assembly: qBit reassembles the chunks into
Inception.mkv. It moves the file to the "Completed" folder:/media/downloads/radarr/Inception (2010)/. - The Signal: Radarr (which has been polling qBit) sees the status change to "Completed."
- The Magic Trick (Hardlink):
- Radarr looks at the file path reported by qBi:
/media/downloads/radarr/... - Radarr knows its library path is:
/media/movies/Inception (2010)/ - Because both paths start with
/media(which maps to the same LVM volume/mnt/pool01/media), Radarr performs a Hardlink (link()). - Result: The file system creates a new "pointer" in the
moviesfolder pointing to the exact same physical data blocks on the NVMe drive. - Speed: Instant (0.01 seconds).
- Space Used: 0 bytes extra.
- Radarr looks at the file path reported by qBi:
Chapter 5: The Premiere (Playback)
System Action: You sit down to watch.
- Notification: Radarr sends a "Download Complete" webhook to Jellyfin (
http://172.20.0.10:8096), telling it to scan the folder. - Discovery: Jellyfin sees the new inode in
/media/movies. It scrapes metadata (posters, actors) and adds it to the library. - Playback: You press "Play" on your TV.
- Direct Stream: Since you are on the local network, your TV connects directly to Jellyfin. Jellyfin opens the file at
/media/movies/Inception.mkvand streams the bits directly to your screen.
Profit.