Which zone, domain and ingress are a mesh's facts, not the module's — so they are settings merged into a config file the mesh manages, read by fromEnv, rather than the empty env placeholders I wrongly baked in. The token stays the one own-secret. The module now describes a Cloudflare registrar; which zone is a setting, so the same description serves every mesh. Typechecks; manifest parses.
69 lines
1.7 KiB
JSON
69 lines
1.7 KiB
JSON
{
|
|
"module": "cloudflare-dns",
|
|
"version": "1",
|
|
"provides": [
|
|
{
|
|
"name": "public-dns",
|
|
"scope": "mesh"
|
|
}
|
|
],
|
|
"serves": {
|
|
"public-dns": {}
|
|
},
|
|
"grants": {
|
|
"public-dns": "/var/lib/cloudflare-dns/grants"
|
|
},
|
|
"receives": {
|
|
"public-dns": "/var/lib/cloudflare-dns/grants/mesh.json"
|
|
},
|
|
"own-secrets": {
|
|
"token": "/var/lib/cloudflare-dns/token",
|
|
"broker": "/var/lib/cloudflare-dns/broker"
|
|
},
|
|
"emits": [
|
|
"module.cloudflare-dns.record.created",
|
|
"module.cloudflare-dns.record.removed"
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"path": "/var/lib/cloudflare-dns",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "grants",
|
|
"type": "directory",
|
|
"path": "/var/lib/cloudflare-dns/grants",
|
|
"mode": "0700"
|
|
},
|
|
{
|
|
"id": "config",
|
|
"type": "file",
|
|
"path": "/var/lib/cloudflare-dns/config.json",
|
|
"merge": "json",
|
|
"content": "{}",
|
|
"mode": "0600"
|
|
},
|
|
{
|
|
"id": "provisioner",
|
|
"type": "container",
|
|
"name": "mesh-provision-cloudflare-dns",
|
|
"image": "mesh-provision-cloudflare-dns@sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
"network": "host",
|
|
"env": {
|
|
"GRANTS": "/grants",
|
|
"MESH_CLOUDFLARE_TOKEN_FILE": "/run/secrets/token",
|
|
"MESH_BROKER_FILE": "/run/secrets/broker",
|
|
"MESH_CLOUDFLARE_CONFIG_FILE": "/run/config/config.json"
|
|
},
|
|
"volumes": [
|
|
"/var/lib/cloudflare-dns/config.json:/run/config/config.json:ro",
|
|
"/var/lib/cloudflare-dns/grants:/grants",
|
|
"/var/lib/cloudflare-dns/token:/run/secrets/token:ro",
|
|
"/var/lib/cloudflare-dns/broker:/run/secrets/broker:ro"
|
|
]
|
|
}
|
|
]
|
|
}
|