48 definitions stop naming /var/lib/mesh/<module>: the directory says `place: "mesh"`, the two
subdirectories beneath it (gitea's runtime state, anthropic-manager's output) state their path
beneath it, and every credential, binding, merged file and mount names it as ${dir:mesh-state}.
Resolved on the default root, every definition names exactly the paths it named before —
TestPlacedDirectoriesKeepTheirPaths in mesh-controller, run over both checkouts. Needs the
controller that knows the word (mesh-controller, same branch) one release ahead.
169 lines
4.2 KiB
JSON
169 lines
4.2 KiB
JSON
{
|
|
"module": "mosquitto",
|
|
"version": "1",
|
|
"slug": "mosq",
|
|
"provides": [
|
|
{
|
|
"name": "mqtt-topic",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"capabilities": [
|
|
"container-runtime"
|
|
],
|
|
"emits": [
|
|
"topic.provisioned",
|
|
"topic.deprovisioned"
|
|
],
|
|
"consumes": [
|
|
"mosquitto.topic.provisioned",
|
|
"mosquitto.topic.deprovisioned"
|
|
],
|
|
"serves": {
|
|
"mqtt-topic": {
|
|
"scheme": "mqtt",
|
|
"port": 1883
|
|
}
|
|
},
|
|
"receives": {
|
|
"mqtt-topic": "${dir:grants}/mesh.json"
|
|
},
|
|
"grants": {
|
|
"mqtt-topic": "${dir:grants}"
|
|
},
|
|
"own-secrets": {
|
|
"admin": "${dir:mesh-state}/admin",
|
|
"broker": "${dir:mesh-state}/broker"
|
|
},
|
|
"listens": [
|
|
{
|
|
"name": "mqtt",
|
|
"port": 1883,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "modules on any machine that were granted a topic namespace"
|
|
},
|
|
{
|
|
"name": "mqtt-websockets",
|
|
"port": 8081,
|
|
"protocol": "tcp",
|
|
"from": "mesh",
|
|
"why": "the same broker over MQTT-on-WebSockets, for browser clients"
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "mesh-state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "mesh"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"place": "."
|
|
},
|
|
{
|
|
"id": "grants",
|
|
"type": "directory",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "data",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "1883:1883"
|
|
},
|
|
{
|
|
"id": "server-conf",
|
|
"type": "file",
|
|
"path": "${dir:state}/mosquitto.conf",
|
|
"mode": "0600",
|
|
"owner": "1883:1883",
|
|
"content": "persistence true\npersistence_location /mosquitto/data\n\nlog_dest stdout\nlog_type warning\nlog_type error\nlog_type notice\n\n# Every client authenticates; identities and their per-topic ACLs are managed\n# at runtime by the dynamic security plugin, whose store the plugin itself owns.\nallow_anonymous false\nplugin /usr/lib/mosquitto_dynamic_security.so\nplugin_opt_config_file /mosquitto/data/dynamic-security.json\n\n# MQTT listener\nlistener 1883\n\n# MQTT-over-WebSockets listener\nlistener 8081\nprotocol websockets\n"
|
|
},
|
|
{
|
|
"id": "net",
|
|
"type": "network",
|
|
"name": "mosquitto"
|
|
},
|
|
{
|
|
"id": "bootstrap",
|
|
"type": "container",
|
|
"name": "mosquitto-bootstrap",
|
|
"run-once": true,
|
|
"volumes": [
|
|
"${dir:data}:/mosquitto/data",
|
|
"${dir:mesh-state}/admin:/run/secrets/admin:ro"
|
|
],
|
|
"env": {
|
|
"MESH_PROVISION_MQTT": "mosquitto:1883",
|
|
"MESH_PROVISION_ADMIN_USER": "mesh-admin",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/admin",
|
|
"MESH_DYNSEC_FILE": "/mosquitto/data/dynamic-security.json"
|
|
},
|
|
"args": [
|
|
"run",
|
|
"/app/modules/mosquitto/dist/bootstrap/index.js"
|
|
],
|
|
"artifact": "runtime"
|
|
},
|
|
{
|
|
"id": "server",
|
|
"type": "container",
|
|
"name": "mosquitto",
|
|
"image": "eclipse-mosquitto@sha256:38c0da4f2ef84284d47b3b3eeea1cb3bdeabe81ee10caf0cd5c5ff61ee3ea408",
|
|
"network": "mosquitto",
|
|
"ports": [
|
|
"1883",
|
|
"8081"
|
|
],
|
|
"volumes": [
|
|
"${dir:data}:/mosquitto/data",
|
|
"${dir:state}/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro"
|
|
]
|
|
},
|
|
{
|
|
"id": "runtime",
|
|
"type": "container",
|
|
"name": "mesh-mosquitto",
|
|
"network": "mosquitto",
|
|
"volumes": [
|
|
"${dir:mesh-state}/broker:/run/secrets/broker:ro",
|
|
"${dir:grants}:${dir:grants}:ro",
|
|
"${dir:mesh-state}/admin:/run/secrets/admin:ro"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_RECEIVES": "${dir:grants}/mesh.json",
|
|
"MESH_PROVISION_MQTT": "mosquitto:1883",
|
|
"MESH_PROVISION_ADMIN_USER": "mesh-admin",
|
|
"MESH_PROVISION_PASSWORD_FILE": "/run/secrets/admin"
|
|
},
|
|
"artifact": "runtime"
|
|
}
|
|
],
|
|
"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"
|
|
}
|
|
]
|
|
}
|
|
}
|