The library search returned title, year, status and monitored. It now returns every field the app keeps (file on disk, quality, size, path, counts, ratings, genres, added…), and each module binds plex-api so the first ten hits carry Plex's view: rating key, library, resolution, added, watched, and a link that opens the item in Plex.
257 lines
7.6 KiB
JSON
257 lines
7.6 KiB
JSON
{
|
|
"module": "lidarr",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "lidarr-api",
|
|
"scope": "mesh",
|
|
"credential": {
|
|
"own": "api-key"
|
|
}
|
|
}
|
|
],
|
|
"serves": {
|
|
"lidarr-api": {
|
|
"scheme": "http",
|
|
"port": 8686,
|
|
"url-base": ""
|
|
}
|
|
},
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"album.grabbed",
|
|
"download.completed"
|
|
],
|
|
"consumes": [],
|
|
"own-secrets": {
|
|
"broker": "${dir:mesh-state}/broker",
|
|
"api-key": {
|
|
"path": "${dir:mesh-state}/api-key",
|
|
"taken": "at-start"
|
|
}
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "web",
|
|
"port": 8686,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "managing music"
|
|
}
|
|
],
|
|
"accesses": [
|
|
{
|
|
"id": "music",
|
|
"path": "/services/media/music",
|
|
"mode": "read-write"
|
|
},
|
|
{
|
|
"id": "downloads",
|
|
"path": "/services/media/downloads",
|
|
"mode": "read-write"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "1000:1000"
|
|
},
|
|
{
|
|
"id": "custom-cont-init",
|
|
"type": "directory",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "custom-services",
|
|
"type": "directory",
|
|
"mode": "0755"
|
|
},
|
|
{
|
|
"id": "identity",
|
|
"type": "file",
|
|
"path": "${dir:state}/identity.env",
|
|
"mode": "0644",
|
|
"content": "# The identity this module's process runs as on THIS machine: the owner of its\n# data here, which the definition may not know (novox/hq ADR 0112, issue 153). Set puid and\n# pgid on the assignment \u2014 the mesh-wide layer carries the image's default, a node's its own.\nPUID=${setting:puid}\nPGID=${setting:pgid}\n"
|
|
},
|
|
{
|
|
"id": "api-key-init",
|
|
"type": "file",
|
|
"path": "${dir:custom-cont-init}/00-mesh-api-key.sh",
|
|
"mode": "0755",
|
|
"content": "#!/bin/bash\n# Written by the mesh (ADR 0158): this module's one credential is the vault's, shared with every\n# consumer; the file is applied here, before the service starts, on every start.\nset -euo pipefail\nCONF=/config/config.xml\nKEY=$(cat /run/secrets/api-key)\nif [ -s \"$CONF\" ] && grep -q '<ApiKey>' \"$CONF\"; then\n sed -i -E \"s#<ApiKey>[^<]*</ApiKey>#<ApiKey>$KEY</ApiKey>#\" \"$CONF\"\nelif [ -s \"$CONF\" ]; then\n sed -i -E \"s#</Config># <ApiKey>$KEY</ApiKey>\\n</Config>#\" \"$CONF\"\nelse\n printf '<Config>\\n <ApiKey>%s</ApiKey>\\n</Config>\\n' \"$KEY\" > \"$CONF\"\nfi\necho \"[mesh] API key set from the vault's credential\"\n"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "lidarr",
|
|
"image": "lscr.io/linuxserver/lidarr@sha256:8ab0fd370b604ae034d9a9c261a9d8d873bece33d9736852e7ce4f3566e4a35d",
|
|
"env": {
|
|
"TZ": "Etc/UTC"
|
|
},
|
|
"ports": [
|
|
"8686"
|
|
],
|
|
"volumes": [
|
|
"${dir:config}:/config",
|
|
"${dir:custom-cont-init}:/custom-cont-init.d",
|
|
"${dir:custom-services}:/custom-services.d",
|
|
"${access:music}:/music",
|
|
"${access:downloads}:/downloads",
|
|
"${dir:mesh-state}/api-key:/run/secrets/api-key:ro"
|
|
],
|
|
"env-file": [
|
|
"${dir:state}/identity.env"
|
|
],
|
|
"restart-on": [
|
|
"identity",
|
|
"needs-api-key",
|
|
"api-key-init"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-lidarr",
|
|
"network": "host",
|
|
"volumes": [
|
|
"${dir:mesh-state}/broker:/run/secrets/broker:ro",
|
|
"${dir:config}:/var/lib/lidarr/config:ro",
|
|
"${dir:mesh-state}/api-key:/run/secrets/api-key:ro",
|
|
"${dir:state}/plex-api.json:/run/plex/plex-api.json:ro",
|
|
"${dir:state}/plex-api.secret:/run/plex/plex-api.secret:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_LIDARR_URL": "http://127.0.0.1:${port:8686}",
|
|
"MESH_LIDARR_CONFIG_DIR": "/var/lib/lidarr/config",
|
|
"MESH_LIDARR_API_KEY_FILE": "/run/secrets/api-key",
|
|
"MESH_PLEX_BIND_FILE": "/run/plex/plex-api.json",
|
|
"MESH_PLEX_TOKEN_FILE": "/run/plex/plex-api.secret"
|
|
},
|
|
"artifact": "runtime",
|
|
"restart-on": [
|
|
"needs-api-key",
|
|
"bound-plex-api",
|
|
"secret-plex-api"
|
|
]
|
|
},
|
|
{
|
|
"id": "downloads-config",
|
|
"type": "file",
|
|
"path": "${dir:state}/downloads.json",
|
|
"mode": "0600",
|
|
"content": "{\n \"node\": \"${machine:name}\",\n \"downloads\": {\n \"nzbget-api\": {\n \"name\": \"nzbget\"\n },\n \"qbittorrent-api\": {\n \"name\": \"qbittorrent\"\n },\n \"jackett-api\": {\n \"adopt-hosts\": [],\n \"indexers\": []\n }\n }\n}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "downloads-memory",
|
|
"type": "directory",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "downloads",
|
|
"type": "container",
|
|
"name": "mesh-lidarr-downloads",
|
|
"network": "host",
|
|
"run-once": true,
|
|
"volumes": [
|
|
"${dir:state}/downloads.json:/run/downloads/downloads.json:ro",
|
|
"${dir:state}/nzbget-api.json:/run/downloads/nzbget-api.json:ro",
|
|
"${dir:state}/nzbget-api.secret:/run/downloads/nzbget-api.secret:ro",
|
|
"${dir:state}/qbittorrent-api.json:/run/downloads/qbittorrent-api.json:ro",
|
|
"${dir:state}/qbittorrent-api.secret:/run/downloads/qbittorrent-api.secret:ro",
|
|
"${dir:state}/jackett-api.json:/run/downloads/jackett-api.json:ro",
|
|
"${dir:state}/jackett-api.secret:/run/downloads/jackett-api.secret:ro",
|
|
"${dir:config}:/var/lib/lidarr/config:ro",
|
|
"${dir:downloads-memory}:/var/lib/downloads"
|
|
],
|
|
"env": {
|
|
"MESH_DOWNLOADS_APP": "lidarr",
|
|
"MESH_DOWNLOADS_API": "v1",
|
|
"MESH_DOWNLOADS_APP_URL": "http://127.0.0.1:${port:8686}",
|
|
"MESH_DOWNLOADS_APP_CONFIG": "/var/lib/lidarr/config/config.xml",
|
|
"MESH_DOWNLOADS_DIR": "/run/downloads",
|
|
"MESH_DOWNLOADS_SETTINGS": "/run/downloads/downloads.json",
|
|
"MESH_DOWNLOADS_MEMORY": "/var/lib/downloads/memory.json"
|
|
},
|
|
"args": [
|
|
"run",
|
|
"/app/modules/lidarr/dist/downloads/index.js"
|
|
],
|
|
"restart-on": [
|
|
"downloads-config",
|
|
"bound-nzbget-api",
|
|
"secret-nzbget-api",
|
|
"bound-qbittorrent-api",
|
|
"secret-qbittorrent-api",
|
|
"bound-jackett-api",
|
|
"secret-jackett-api"
|
|
],
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"requires": [
|
|
"jackett-api",
|
|
"nzbget-api",
|
|
"qbittorrent-api",
|
|
"route",
|
|
"plex-api"
|
|
],
|
|
"contributes": {
|
|
"route": {
|
|
"label": "lidarr",
|
|
"endpoint": "web"
|
|
}
|
|
},
|
|
"binds": {
|
|
"route": "${dir:state}/route.json",
|
|
"nzbget-api": "${dir:state}/nzbget-api.json",
|
|
"qbittorrent-api": "${dir:state}/qbittorrent-api.json",
|
|
"jackett-api": "${dir:state}/jackett-api.json",
|
|
"plex-api": "${dir:state}/plex-api.json"
|
|
},
|
|
"secrets": {
|
|
"nzbget-api": "${dir:state}/nzbget-api.secret",
|
|
"qbittorrent-api": "${dir:state}/qbittorrent-api.secret",
|
|
"jackett-api": "${dir:state}/jackett-api.secret",
|
|
"plex-api": "${dir:state}/plex-api.secret"
|
|
},
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|