Ten definitions name each access by id; the path stays as the default an assignment may replace,
and the host side of every mount says ${access:<id>}. Resolved with no placement, every definition
names exactly the paths it named before (TestPlacedDirectoriesKeepTheirPaths, extended). On an
adopted machine the assignment now says `accesses: {<id>: <path>}` and the mount follows.
Needs the controller that knows an access id (mesh-controller #176); the running one refuses the
field at registration.
138 lines
3.0 KiB
JSON
138 lines
3.0 KiB
JSON
{
|
|
"module": "plex",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"playback.started",
|
|
"playback.stopped",
|
|
"item.added"
|
|
],
|
|
"consumes": [
|
|
"*.download.completed"
|
|
],
|
|
"own-secrets": {
|
|
"broker": "${dir:mesh-state}/broker",
|
|
"token": "${dir:mesh-state}/token"
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "stream",
|
|
"port": 32400,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "streaming and the app; reaching it from outside is a route grant later"
|
|
}
|
|
],
|
|
"accesses": [
|
|
{
|
|
"id": "movies",
|
|
"path": "/services/media/movies",
|
|
"mode": "read"
|
|
},
|
|
{
|
|
"id": "series",
|
|
"path": "/services/media/series",
|
|
"mode": "read"
|
|
},
|
|
{
|
|
"id": "anime",
|
|
"path": "/services/media/anime",
|
|
"mode": "read"
|
|
},
|
|
{
|
|
"id": "music",
|
|
"path": "/services/media/music",
|
|
"mode": "read"
|
|
},
|
|
{
|
|
"id": "audiobooks",
|
|
"path": "/services/media/audiobooks",
|
|
"mode": "read"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"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": "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",
|
|
"${access:movies}:/movies",
|
|
"${access:series}:/series",
|
|
"${access:anime}:/anime",
|
|
"${access:music}:/music",
|
|
"${access:audiobooks}:/audiobooks"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-plex",
|
|
"network": "host",
|
|
"volumes": [
|
|
"${dir:mesh-state}/broker:/run/secrets/broker:ro",
|
|
"${dir:mesh-state}/token:/run/secrets/token: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_TOKEN_FILE": "/run/secrets/token",
|
|
"MESH_PLEX_DATA_DIR": "/var/lib/plex"
|
|
},
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"build": {
|
|
"on": [
|
|
{
|
|
"arg": "BUILD_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "build"
|
|
},
|
|
{
|
|
"arg": "RUNTIME_BASE",
|
|
"module": "mesh-tools",
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"artifacts": [
|
|
{
|
|
"name": "runtime",
|
|
"kind": "image",
|
|
"from": "Dockerfile"
|
|
}
|
|
]
|
|
}
|
|
}
|