ombi: reach plex through the mesh, in the same step as the Servarr apps
ombi reached plex at its public name, typed into its settings screen, so it depended on plex's public route and on nobody moving plex. ombi now requires plex-api, and the run-once step that writes its Servarr connections writes its Plex one too - renamed from `servarr` to `connections`, since it is no longer only that. ombi keeps several Plex servers. The entry this provision names is found by the server's own machineIdentifier (plex answers it at /identity, and ombi stored it when the server was loaded), and only its host, port, TLS, base path and token are written, only when they differ. Another server's entry, the selected libraries, whether Plex is enabled and every other choice are left alone. An ombi with no entry for the server gets one. The token is tried against plex first. Until the operator accepts the server's X-Plex-Token for this pair the mesh delivers a value it minted, which plex refuses (401, or 400 on a network it trusts); refused, nothing is written and the step fails naming the secret accept, so a working token in ombi is never replaced by a dead one. Tests import the compiled step, as keycloak's do: the step imports its sibling with the .js specifier the build needs, which type stripping does not resolve. `npm test` builds first.
This commit is contained in:
+20
-13
@@ -87,28 +87,30 @@
|
||||
"artifact": "runtime"
|
||||
},
|
||||
{
|
||||
"id": "servarr",
|
||||
"id": "connections",
|
||||
"type": "container",
|
||||
"name": "mesh-ombi-servarr",
|
||||
"name": "mesh-ombi-connections",
|
||||
"network": "host",
|
||||
"run-once": true,
|
||||
"volumes": [
|
||||
"/var/lib/mesh/ombi/api-key:/run/secrets/api-key:ro",
|
||||
"${dir:state}/sonarr-api.json:/run/servarr/sonarr-api.json:ro",
|
||||
"${dir:state}/sonarr-api.secret:/run/servarr/sonarr-api.secret:ro",
|
||||
"${dir:state}/radarr-api.json:/run/servarr/radarr-api.json:ro",
|
||||
"${dir:state}/radarr-api.secret:/run/servarr/radarr-api.secret:ro",
|
||||
"${dir:state}/lidarr-api.json:/run/servarr/lidarr-api.json:ro",
|
||||
"${dir:state}/lidarr-api.secret:/run/servarr/lidarr-api.secret:ro"
|
||||
"${dir:state}/sonarr-api.json:/run/connections/sonarr-api.json:ro",
|
||||
"${dir:state}/sonarr-api.secret:/run/connections/sonarr-api.secret:ro",
|
||||
"${dir:state}/radarr-api.json:/run/connections/radarr-api.json:ro",
|
||||
"${dir:state}/radarr-api.secret:/run/connections/radarr-api.secret:ro",
|
||||
"${dir:state}/lidarr-api.json:/run/connections/lidarr-api.json:ro",
|
||||
"${dir:state}/lidarr-api.secret:/run/connections/lidarr-api.secret:ro",
|
||||
"${dir:state}/plex-api.json:/run/connections/plex-api.json:ro",
|
||||
"${dir:state}/plex-api.secret:/run/connections/plex-api.secret:ro"
|
||||
],
|
||||
"env": {
|
||||
"MESH_OMBI_URL": "http://127.0.0.1:${port:3579}",
|
||||
"MESH_OMBI_API_KEY_FILE": "/run/secrets/api-key",
|
||||
"MESH_SERVARR_DIR": "/run/servarr"
|
||||
"MESH_CONNECTIONS_DIR": "/run/connections"
|
||||
},
|
||||
"args": [
|
||||
"run",
|
||||
"/app/modules/ombi/dist/servarr/index.js"
|
||||
"/app/modules/ombi/dist/connections/index.js"
|
||||
],
|
||||
"restart-on": [
|
||||
"bound-sonarr-api",
|
||||
@@ -116,13 +118,16 @@
|
||||
"bound-radarr-api",
|
||||
"secret-radarr-api",
|
||||
"bound-lidarr-api",
|
||||
"secret-lidarr-api"
|
||||
"secret-lidarr-api",
|
||||
"bound-plex-api",
|
||||
"secret-plex-api"
|
||||
],
|
||||
"artifact": "runtime"
|
||||
}
|
||||
],
|
||||
"requires": [
|
||||
"lidarr-api",
|
||||
"plex-api",
|
||||
"radarr-api",
|
||||
"route",
|
||||
"sonarr-api"
|
||||
@@ -137,12 +142,14 @@
|
||||
"route": "${dir:state}/route.json",
|
||||
"sonarr-api": "${dir:state}/sonarr-api.json",
|
||||
"radarr-api": "${dir:state}/radarr-api.json",
|
||||
"lidarr-api": "${dir:state}/lidarr-api.json"
|
||||
"lidarr-api": "${dir:state}/lidarr-api.json",
|
||||
"plex-api": "${dir:state}/plex-api.json"
|
||||
},
|
||||
"secrets": {
|
||||
"sonarr-api": "${dir:state}/sonarr-api.secret",
|
||||
"radarr-api": "${dir:state}/radarr-api.secret",
|
||||
"lidarr-api": "${dir:state}/lidarr-api.secret"
|
||||
"lidarr-api": "${dir:state}/lidarr-api.secret",
|
||||
"plex-api": "${dir:state}/plex-api.secret"
|
||||
},
|
||||
"build": {
|
||||
"on": [
|
||||
|
||||
Reference in New Issue
Block a user