Files
mesh-catalog/modules/plex/module.json
T
jschoubben 6615b5e3b3 plex, redis: module runtime containers + declare self-consumed events (ADR 0052/0046)
plex gains a broker-bound tools/events runtime container (mesh-runtime-plex)
alongside its server, and a never-throwing plex_reachable health probe. redis and
postgres subscribe to their own lifecycle events in index.ts but declared no
consumes — so the substrate never made the queue the runtime binds and it crashed
on start (404). Declare the consume, as ADR 0046 requires. Proven end-to-end in the
mesh-lab: assigned-plex and assigned-redis both green.

Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
2026-09-04 22:29:41 +02:00

121 lines
2.9 KiB
JSON

{
"module": "plex",
"version": "1",
"capabilities": [
"container-runtime"
],
"emits": [
"module.plex.playback.started",
"module.plex.playback.stopped",
"module.plex.item.added"
],
"consumes": [
"module.*.download.completed"
],
"own-secrets": {
"broker": "/var/lib/mesh/plex/broker"
},
"listens": [
{
"port": 32400,
"protocol": "tcp",
"from": "mesh",
"why": "streaming and the app; reaching it from outside is a route grant later"
}
],
"resources": [
{
"id": "mesh-state",
"type": "directory",
"path": "/var/lib/mesh/plex",
"mode": "0700"
},
{
"id": "config",
"type": "directory",
"path": "/services/plex/config",
"mode": "0700",
"owner": "1000:1000"
},
{
"id": "transcode",
"type": "directory",
"path": "/services/plex/transcode",
"mode": "0700",
"owner": "1000:1000"
},
{
"id": "media-movies",
"type": "directory",
"path": "/services/media/movies",
"mode": "0755",
"owner": "1000:1000"
},
{
"id": "media-series",
"type": "directory",
"path": "/services/media/series",
"mode": "0755",
"owner": "1000:1000"
},
{
"id": "media-anime",
"type": "directory",
"path": "/services/media/anime",
"mode": "0755",
"owner": "1000:1000"
},
{
"id": "media-music",
"type": "directory",
"path": "/services/media/music",
"mode": "0755",
"owner": "1000:1000"
},
{
"id": "media-audiobooks",
"type": "directory",
"path": "/services/media/audiobooks",
"mode": "0755",
"owner": "1000:1000"
},
{
"id": "server",
"type": "container",
"name": "plex",
"image": "plexinc/pms-docker@sha256:83a425ae9e133b1cb2cc3b809556e01c61cd8ff65c582e41b4374bc2210bac9e",
"network": "host",
"env": {
"PLEX_UID": "1000",
"PLEX_GID": "1000",
"TZ": "Etc/UTC"
},
"volumes": [
"/services/plex/config:/config",
"/services/plex/transcode:/transcode",
"/services/media/movies:/movies",
"/services/media/series:/series",
"/services/media/anime:/anime",
"/services/media/music:/music",
"/services/media/audiobooks:/audiobooks"
]
},
{
"id": "runtime",
"type": "container",
"name": "mesh-plex",
"image": "mesh-runtime-plex@sha256:0000000000000000000000000000000000000000000000000000000000000000",
"network": "host",
"volumes": [
"/var/lib/mesh/plex/broker:/run/secrets/broker:ro",
"/services/plex/config:/var/lib/plex/config:ro"
],
"env": {
"MESH_BROKER_FILE": "/run/secrets/broker",
"MESH_PLEX_URL": "http://127.0.0.1:32400",
"MESH_PLEX_DATA_DIR": "/var/lib/plex"
}
}
]
}