Bootstrap tree for the media box Linux conversion
Autoinstall lays down a thin base (sshd, key, DHCP, Docker CE, /srv) and hands
off to this repo on first boot. Everything interesting stays in git so it is
reviewable and re-runnable, rather than frozen onto a USB nobody can diff.
Stages, all idempotent:
00-preflight asserts hardware/BIOS state, changes nothing. Catches a BIOS
update having silently re-enabled Secure Boot, which would stop
the NVIDIA DKMS module loading on a box with no keyboard.
10-secrets ADD-ONLY seeder for /srv/secrets/stacks.env. Never overwrites an
existing key. Verified against a pre-populated file: existing
values, unrelated keys, the operator tier and existing manifest
lines all survive byte-for-byte; a second run is a no-op.
20-cifs the 8 shares Plex actually uses (Share is excluded, it is not a
library root). \040 escaping, nofail + x-systemd.automount +
_netdev. Managed-block rewrite verified not to duplicate or to
drop the root fstab entry.
30-nvidia nvidia-driver-580 explicitly: 580 is the LAST branch supporting
Pascal, and the -open modules need Turing+. Pins against newer
branches. Not in late-commands because DKMS needs the installed
kernel, not the installer's.
40-shell-mcp builds the native MCP locally for amd64; refuses to finish
unless /sse returns 401 without a token.
50-plex run by hand: PLEX_CLAIM expires in 4 minutes. Refuses to start
against missing mounts and disables autoEmptyTrash, which with
read-write NAS credentials is the most dangerous default here.
shell-mcp was built on arm64 originally. It builds clean on amd64 (whole dep
tree resolves to prebuilt manylinux x86_64 wheels, no compiler needed), but
dependencies are now pinned - the original installed mcp/starlette/uvicorn
unpinned and starlette has since gone 1.x. Port moved to 8103 so NPM host 42
can simply be repointed, and the tool description now says media box rather
than arrsstack.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
services:
|
||||
plex:
|
||||
image: lscr.io/linuxserver/plex:latest
|
||||
container_name: plex
|
||||
restart: unless-stopped
|
||||
|
||||
# NOT OPTIONAL. Plex's local discovery (GDM), DLNA and the Plex-for-client
|
||||
# "found a local server" path all rely on broadcast traffic that a bridge
|
||||
# network silently eats. This is why Plex does not sit behind NPM the way
|
||||
# every other service here does — NPM proxy host 17 already points
|
||||
# plex.thewichersfamily.com at 10.0.1.20:32400 and needs no change.
|
||||
network_mode: host
|
||||
|
||||
environment:
|
||||
- PUID=3000 # MUST match uid= on the CIFS mounts
|
||||
- PGID=3000 # MUST match gid= on the CIFS mounts
|
||||
- TZ=${TZ:-America/New_York}
|
||||
- VERSION=docker
|
||||
# PLEX_CLAIM is intentionally absent from this file. Claim tokens expire
|
||||
# four minutes after they are issued, so one can never be committed to a
|
||||
# repo, written to a USB, or baked into an image. It is injected at first
|
||||
# start by 50-plex.sh and never persisted.
|
||||
- PLEX_CLAIM=${PLEX_CLAIM:-}
|
||||
- ADVERTISE_IP=${PLEX_ADVERTISE_URL:-http://10.0.1.20:32400}
|
||||
|
||||
devices:
|
||||
# Quick Sync. The i7-8700K's UHD 630 is the transcode target: no session
|
||||
# cap, and better HDR tone mapping than the Pascal-era NVENC on the 1070.
|
||||
- /dev/dri:/dev/dri
|
||||
|
||||
group_add:
|
||||
# The render node is root:render, and PGID 3000 is not in that group.
|
||||
# Resolved from the live host by 50-plex.sh — do not hardcode, the gid
|
||||
# differs between distro releases.
|
||||
- "${RENDER_GID:-993}"
|
||||
|
||||
volumes:
|
||||
# Config lives on the SSD, deliberately. The Plex SQLite database is the
|
||||
# most latency-sensitive thing on this box; it does not belong on the
|
||||
# 3TB spinner.
|
||||
- /srv/plex/config:/config
|
||||
|
||||
# NAS media, read-write per the account scope. Mounted read-only INTO the
|
||||
# container for every library that Plex has no business writing to.
|
||||
- /mnt/nas/audiobooks:/media/audiobooks:ro
|
||||
- /mnt/nas/education-videos:/media/education-videos:ro
|
||||
- /mnt/nas/health:/media/health:ro
|
||||
- /mnt/nas/home-movies:/media/home-movies:ro
|
||||
- /mnt/nas/media:/media/media:ro
|
||||
- /mnt/nas/music-organized:/media/music-organized:ro
|
||||
- /mnt/nas/pictures:/media/pictures:ro
|
||||
- /mnt/nas/radio-shows:/media/radio-shows:ro
|
||||
|
||||
tmpfs:
|
||||
# Transcodes are throwaway. Keeping them in RAM saves a great deal of
|
||||
# SSD write wear. 4G of the box's 16G, capped so a pathological transcode
|
||||
# cannot pressure the rest of the system.
|
||||
- /transcode:rw,size=4g,mode=1777
|
||||
Reference in New Issue
Block a user