📚 Encyclopedia

Servers & Hosting · updated 2026-11-23

videos.jhampton.io (private video site architecture)

videophpobject-storageencryptionapachejustinahampton

videos.jhampton.io is Justin's personal video site: series of phone clips (cat diaries, car clips, Snapchat exports), some public, some hidden, some encrypted. It is a small PHP app designed so the 1 GB server never touches the video bytes. Source ~/dev/justinahampton/videos/ (ops doc videos/README.md), deploy tools/deploy-videos.sh.

Architecture

URLs

Private (encrypted) videos

Private videos are encrypted in the browser with a passphrase that exists only in Justin's head and browser; there is no reset and no recovery. Service-worker decryption plays them back. - Standing rule: back up a private video locally before it is encrypted and uploaded, through any channel (admin UI, CLI, script). The browser path writes the original to a chosen folder with the File System Access API (falling back to a plain download) and refuses to encrypt if the backup fails. "It is already on his disk because he picked it from there" does not count; the copy must be deliberate and reported. - Encryption is not a visibility setting: bulk visibility changes skip encrypted videos, and they never get a blur placeholder. - As of 2026-10 no encrypted video had been uploaded end to end, so the vault path is untested against real footage.

Native clients (TV app API)

/api/tv.php (2026-11) serves the Android TV app (Android TV / Google TV apps (Compose for TV, Media3, sideloading)): GET returns the catalog the index would show this viewer (series, episodes with signed poster and source URLs, locked, encrypted, rotate, expires); POST action=login returns the PHP session id as a token that the app sends back as the site's session cookie (logout ends it). Locked videos carry no URLs; encrypted ones are listed but unplayable, since only the web's service worker can decrypt them. A failed login sleeps 2 s. It is a real file, so FallbackResource never shadows it. The same site also hosts generated tutorial series (Generating narrated screencast tutorials from a script (PIL + Piper TTS + ffmpeg)).

Installing vhost changes

Diff the live vhost against the repo copy (videos/server/httpd-videos.justinahampton.conf) first, then scp, sudo cp, apachectl configtest, systemctl reload httpd. Never pipe a script to sudo -S on stdin; sudo eats it.

See also

Linked from

Sources: justinahampton memory (videos-subdomain-plan, videos-urls-and-previews, videos-catalog-state, private-videos-backup-first, videos-crt-theme), justinahampton memory (videos-drop-links), tldr post #1913