Give each settings-config runtime a mergeable config file with its own id (runtime-config) — the previous "config" collided with modules that already own a config directory, so ten runtimes mounted a config file no resource declared. Point each runtime's restart-on at it, so a settings change recreates the runtime and it re-reads the new value (needs the mesh-host container restart-on fix on issue/009-container-restart-on). Proven: runtime-restart-on-config e2e green. Claude-Session: https://claude.ai/code/session_01LrgweAeERJYBg88c5cKDzF
86 lines
2.2 KiB
JSON
86 lines
2.2 KiB
JSON
{
|
|
"module": "icecast",
|
|
"version": "1",
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"module.icecast.stream.started",
|
|
"module.icecast.stream.stopped"
|
|
],
|
|
"own-secrets": {
|
|
"source": "/var/lib/icecast-module/source.secret",
|
|
"admin": "/var/lib/icecast-module/admin.secret",
|
|
"relay": "/var/lib/icecast-module/relay.secret",
|
|
"broker": "/var/lib/mesh/icecast/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"port": 8000,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "streams in from sources and out to listeners"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh/icecast",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/icecast-module",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "server-env",
|
|
"type": "file",
|
|
"path": "/var/lib/icecast-module/server.env",
|
|
"mode": "0600",
|
|
"content": "ICECAST_SOURCE_PASSWORD=${secret:source}\nICECAST_ADMIN_PASSWORD=${secret:admin}\nICECAST_RELAY_PASSWORD=${secret:relay}\nICECAST_ADMIN_USERNAME=admin\n"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "icecast",
|
|
"image": "infiniteproject/icecast@sha256:cd506cf3dfe31ce05fd37d7e672dbd1213e7255cc93d28ecf5a3b547af4e162c",
|
|
"env-file": [
|
|
"/var/lib/icecast-module/server.env"
|
|
],
|
|
"ports": [
|
|
"8000"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "/var/lib/mesh/icecast/config.json",
|
|
"mode": "0600",
|
|
"content": "{}\n",
|
|
"merge": "json"
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-icecast",
|
|
"image": "mesh-runtime-icecast@sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
"network": "host",
|
|
"volumes": [
|
|
"/var/lib/mesh/icecast/broker:/run/secrets/broker:ro",
|
|
"/var/lib/mesh/icecast/config.json:/run/config/config.json:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_ICECAST_URL": "http://127.0.0.1:8000",
|
|
"MESH_ICECAST_CONFIG_FILE": "/run/config/config.json"
|
|
},
|
|
"restart-on": [
|
|
"runtime-config"
|
|
]
|
|
}
|
|
]
|
|
}
|