150 lines
3.3 KiB
JSON
150 lines
3.3 KiB
JSON
{
|
|
"module": "icecast",
|
|
"version": "1",
|
|
"requires": [
|
|
"route",
|
|
"secret"
|
|
],
|
|
"contributes": {
|
|
"route": {
|
|
"label": "icecast",
|
|
"endpoint": "stream"
|
|
}
|
|
},
|
|
"binds": {
|
|
"route": "${dir:state}/route.json"
|
|
},
|
|
"secrets": {
|
|
"secret": {
|
|
"source": "${dir:state}/source.secret",
|
|
"admin": "${dir:state}/admin.secret",
|
|
"relay": "${dir:state}/relay.secret"
|
|
}
|
|
},
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"stream.started",
|
|
"stream.stopped"
|
|
],
|
|
"listens": [
|
|
{
|
|
"name": "stream",
|
|
"port": 8000,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "streams in from sources (HTTP PUT) and out to listeners, plus the status and admin pages; a public name is its route"
|
|
}
|
|
],
|
|
"data": {
|
|
"own": [
|
|
{
|
|
"id": "logs",
|
|
"path": "${dir:logs}",
|
|
"class": "cache",
|
|
"why": "the streaming server's logs"
|
|
}
|
|
]
|
|
},
|
|
"config": {
|
|
"url": {
|
|
"type": "string",
|
|
"description": "The address the module's tools reach Icecast at, as a URL; unset, the code falls back to its environment, else this machine's Icecast on its port.",
|
|
"trusted": true,
|
|
"default": ""
|
|
},
|
|
"user": {
|
|
"type": "string",
|
|
"description": "The Icecast admin account the module's tools sign in as; unset, the code falls back to its environment, else admin.",
|
|
"trusted": true,
|
|
"default": ""
|
|
}
|
|
},
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "logs",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "100:101"
|
|
},
|
|
{
|
|
"id": "server-conf",
|
|
"type": "file",
|
|
"path": "${dir:state}/icecast.xml",
|
|
"mode": "0600",
|
|
"template": "files/icecast.xml"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "icecast"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "icecast",
|
|
"image": "infiniteproject/icecast@sha256:cd506cf3dfe31ce05fd37d7e672dbd1213e7255cc93d28ecf5a3b547af4e162c",
|
|
"network": "icecast",
|
|
"ports": [
|
|
"8000"
|
|
],
|
|
"volumes": [
|
|
"${dir:state}/icecast.xml:/etc/icecast.xml:ro",
|
|
"${dir:logs}:/var/log/icecast"
|
|
],
|
|
"restart-on": [
|
|
"server-conf"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime-config",
|
|
"type": "file",
|
|
"path": "${dir:mesh-state}/config.json",
|
|
"mode": "0600",
|
|
"template": "files/config.json",
|
|
"merge": "json",
|
|
"takes-config": ["url", "user"]
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "code",
|
|
"kind": "bundle",
|
|
"language": "typescript",
|
|
"entrypoints": [
|
|
"index.js",
|
|
"tools/index.js"
|
|
],
|
|
"loads": [
|
|
"index.js",
|
|
"tools/index.js"
|
|
],
|
|
"env": {
|
|
"MESH_ICECAST_URL": "http://127.0.0.1:${port:8000}",
|
|
"MESH_ICECAST_CONFIG_FILE": "${dir:mesh-state}/config.json",
|
|
"MESH_ICECAST_ADMIN_PASSWORD_FILE": "${dir:state}/admin.secret"
|
|
}
|
|
},
|
|
{
|
|
"name": "files",
|
|
"kind": "archive",
|
|
"from": "files"
|
|
}
|
|
]
|
|
}
|
|
}
|