The tools were TypeScript; the mesh's modules are Go. The write to /etc/hosts is now staged and moved into place rather than written over the live file.
42 lines
1.0 KiB
JSON
42 lines
1.0 KiB
JSON
{
|
|
"module": "hosts",
|
|
"version": "1",
|
|
"claims": [
|
|
{
|
|
"name": "node-hosts-file",
|
|
"scope": "node",
|
|
"serves": [
|
|
"entries",
|
|
"add",
|
|
"remove"
|
|
]
|
|
}
|
|
],
|
|
"resources": [
|
|
{
|
|
"id": "own",
|
|
"type": "file",
|
|
"path": "/etc/hosts",
|
|
"mode": "0644",
|
|
"into": "block",
|
|
"at": "start",
|
|
"content": "# The machine's own names (module hosts, novox/hq ADR 0199). Every line outside this block is the\n# operator's: kept across every push, changed through the node-hosts-file verbs add and remove, and\n# given back when this module goes. The mesh's names are not here: the mesh's resolver answers them.\n127.0.0.1\tlocalhost\n::1\tlocalhost\n127.0.1.1\t${machine:name}\n"
|
|
}
|
|
],
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/hosts-tools",
|
|
"binary": "hosts-tools",
|
|
"loads": [
|
|
"hosts-tools"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|