Media Server, Pt 2 - Directory Structure

The various components making up a media server by necessity interact. There'll be PVR applications to manage movies, serialized shows, music, and electronic books; downloaders to obtain content - only that my dear readers are licensed to obtain, of course; and the media servers themselves to enable the consumption of those. They all need, to varying degrees, access to each other's files. Docker containers can enforce some separation. To that end, since I don't want to get into managing POSIX ACLs (yet, I suppose), an initial file system layout will involve a shared group with write access, and access to parts of the file system being controlled by what is visible where.

The primary division is between downloaders, medis managers, and consumers. Downloaders will have access ONLY to their respective storage areas. Managers will have full access to both the downloader folders to pick up new content, and the actual libraries they manage. Consumers, or media servers, will be limited to reading from the libraries. To the last, there may be some exceptions to allow media servers to manage their own metadata in addition to what the media managers provide.

A possible structure like that can be created with the following commands.

$ mkdir -p /srv/data/shared/{media,torrent,usenet}/{books,movies,music,tv}
$ mkdir -p /srv/data/shared/{torrent,usenet}/incomplete
$ sudo chgrp -R 10002 /srv/data/shared/*
$ sudo chmod -R g+w  /srv/data/shared/*

Subscribe to Homelab Adventures

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe