I've been a long time Jellyfin user since the Emby days. The server as well as clients are well-designed and do the job most of the time. The latest version irons out quite a few long-standing issues. So, out of no real necessity, I began thinking - "What's the lightest, most performant media streaming server I could run for devices on the LAN?"

So I did the following:

  1. A folder on the Raspberry Pi that contains all media files is mounted on my laptop using SSHFS. This can be accessed on Android devices using Solid Explorer's SFTP plugin. Ingestion is by copying files over the LAN
  2. A simple zx shell script watches the folder for changes and automatically dumps thumbnails is a predefined "meta" directory. Flat structure, dupes be damned. And no fancy metadata lookup required
  3. Use Caddy for simple, efficient, lightweight HTTP/2 streaming. Caddy's built-in file-server combined with Basic Auth and directory indexing goes a long way
  4. Rude surprise: HTTP/2 is HTTPS by default. Okay, let's do this the right way:
    a.  Use a subdomain on an already purchased public domain ('A' record points to public IP only)
    b.  Use acme.sh with ZeroSSL and DNS API w/ Cloudflare DNS (enable API access) to generate certificates for a subdomain
    c.  Script to copy generated certs from acme.sh home to Raspberry PI
    d.  Configure Caddyfile to use tls <cert> <keyfile>
    e.  Configure Pi-Hole, which was already my local network DNS resolver, to have a DNS override pointing the subdomain to the Raspberry Pi LAN IP
    f.  Took longer than I thought. All for a tiny boost in network streaming perf. Phew!
  5. Web Client
    a.  Frontend client is basically a Caddy directory listing parser w/ video.js player (could've done a JSON API, but this was quite simple)
    b.  Thin endpoint API in Caddy that does some rewrite URL stuff to lookup media thumbnails in the right location
    c.  Search function: all done in the frontend. Media files are organized in folders, but thumbnails are dumped into a single predefined meta directory (dupe handling is ignored). Search loads the entire metadata file list and does a fuzzy lookup