lidarr reached its download clients as nzbget:6789 and qbittorrent:8112 and its indexers through jackett:9117 or indexers.zurag.be - HAL container names and a public route, typed into its database by hand. Nothing on the mesh answers those names. It now requires nzbget-api, qbittorrent-api and jackett-api. A run-once step (downloads/, declared last, restart-on its bindings, credentials and settings) writes host, port, TLS, base path, user and credential into lidarr through lidarr's own API: - A download client is the mesh's when its name is downloads.<provision>.name and its kind the provider's; it is registered when missing. A jackett feed is the mesh's when its host is the bound one, one the step bound before, or one in downloads.jackett-api.adopt-hosts; the jackett indexers in downloads.jackett-api.indexers are registered when missing. Every other entry is left alone, and nothing is ever deleted. - Only connection fields, only when they differ. The stored password is masked, so the app tests the entry with the credential it holds; only if that fails is the delivered one written. Categories, priorities and "enabled" are never touched. - Each credential is tried against its provider first. A minted value (nothing accepted yet) is never written; the step exits 1 naming the exact secret accept. The step is byte-identical in sonarr, radarr, lidarr and bookshelf (the same Servarr API, v3 or v1): each module builds from its own directory, so each carries a copy, and test/downloads.test.ts fails if a sibling's copy differs. Verified: strict typecheck, the Dockerfile build, 14 unit tests; and the compiled step against fresh pinned sonarr/radarr/lidarr/bookshelf with throwaway nzbget, qBittorrent and jackett - minted credentials refused with nothing written, accepted ones registered and tested by the app, a migration-shaped radarr repointed, reruns unchanged.
213 lines
5.4 KiB
JSON
213 lines
5.4 KiB
JSON
{
|
|
"module": "lidarr",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "lidarr-api",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"serves": {
|
|
"lidarr-api": {
|
|
"scheme": "http",
|
|
"port": 8686,
|
|
"url-base": ""
|
|
}
|
|
},
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"album.grabbed",
|
|
"download.completed"
|
|
],
|
|
"consumes": [],
|
|
"own-secrets": {
|
|
"broker": "/var/lib/mesh/lidarr/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "web",
|
|
"port": 8686,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "managing music"
|
|
}
|
|
],
|
|
"accesses": [
|
|
{
|
|
"path": "/services/media/music",
|
|
"mode": "read-write"
|
|
},
|
|
{
|
|
"path": "/services/media/downloads",
|
|
"mode": "read-write"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/lidarr",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"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": "server",
|
|
"type": "container",
|
|
"name": "lidarr",
|
|
"image": "lscr.io/linuxserver/lidarr@sha256:8ab0fd370b604ae034d9a9c261a9d8d873bece33d9736852e7ce4f3566e4a35d",
|
|
"env": {
|
|
"PUID": "1000",
|
|
"PGID": "1000",
|
|
"TZ": "Etc/UTC"
|
|
},
|
|
"ports": [
|
|
"8686"
|
|
],
|
|
"volumes": [
|
|
"${dir:config}:/config",
|
|
"${dir:custom-cont-init}:/custom-cont-init.d",
|
|
"${dir:custom-services}:/custom-services.d",
|
|
"/services/media/music:/music",
|
|
"/services/media/downloads:/downloads"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-lidarr",
|
|
"network": "host",
|
|
"volumes": [
|
|
"/var/lib/mesh/lidarr/broker:/run/secrets/broker:ro",
|
|
"${dir:config}:/var/lib/lidarr/config: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"
|
|
},
|
|
"artifact": "runtime"
|
|
},
|
|
{
|
|
"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"
|
|
],
|
|
"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"
|
|
},
|
|
"secrets": {
|
|
"nzbget-api": "${dir:state}/nzbget-api.secret",
|
|
"qbittorrent-api": "${dir:state}/qbittorrent-api.secret",
|
|
"jackett-api": "${dir:state}/jackett-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"
|
|
}
|
|
]
|
|
}
|
|
}
|