Builds: design 47 G A-274 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
322 lines
8.7 KiB
JSON
322 lines
8.7 KiB
JSON
{
|
|
"module": "mesh-recovery",
|
|
"version": "0.1",
|
|
"runs-as": "mesh-recovery",
|
|
"claims": [
|
|
{
|
|
"name": "mesh-recovery",
|
|
"scope": "mesh",
|
|
"serves": [
|
|
"snapshot-kept",
|
|
"restore-kept",
|
|
"kept-points",
|
|
"restore-aside",
|
|
"cancel",
|
|
"take",
|
|
"restore",
|
|
"retry",
|
|
"aside",
|
|
"discard-aside",
|
|
"expire-points"
|
|
]
|
|
}
|
|
],
|
|
"tools": [
|
|
"recovery_kept_points",
|
|
"recovery_take",
|
|
"recovery_restore",
|
|
"recovery_retry",
|
|
"recovery_aside",
|
|
"recovery_discard_aside",
|
|
"recovery_restore_aside",
|
|
"recovery_cancel",
|
|
"recovery_expire_points"
|
|
],
|
|
"consumes": [
|
|
"node-backup.item-started",
|
|
"node-backup.item-ended",
|
|
"node-engine.running",
|
|
"mesh-broker.snapshot-restored",
|
|
"mesh-broker.recreated",
|
|
"mesh-broker.dropped",
|
|
"mesh-conditions.findings-asked",
|
|
"mesh-catalog.seat-definition-changed",
|
|
"mesh-catalog.seat-definition-removed"
|
|
],
|
|
"invokes": [
|
|
"seat:mesh-catalog.seat-definitions",
|
|
"seat:mesh-catalog.entry",
|
|
"seat:mesh-module-assigner.assignments",
|
|
"seat:mesh-hand-acts.hand-act",
|
|
"seat:mesh-broker.show",
|
|
"seat:mesh-broker.snapshot-get",
|
|
"seat:mesh-broker.snapshot-restore",
|
|
"seat:mesh-broker.snapshot-restore-cancel",
|
|
"seat:node-backup.restore",
|
|
"seat:mesh-recovery.kept-points",
|
|
"seat:mesh-recovery.restore-aside",
|
|
"seat:mesh-recovery.cancel",
|
|
"seat:mesh-recovery.take",
|
|
"seat:mesh-recovery.restore",
|
|
"seat:mesh-recovery.retry",
|
|
"seat:mesh-recovery.aside",
|
|
"seat:mesh-recovery.discard-aside",
|
|
"seat:mesh-recovery.expire-points"
|
|
],
|
|
"requires": [
|
|
{
|
|
"name": "digests",
|
|
"storage": "key-value",
|
|
"template": "state"
|
|
},
|
|
{
|
|
"name": "findings",
|
|
"storage": "key-value",
|
|
"template": "state"
|
|
},
|
|
{
|
|
"name": "bounds",
|
|
"storage": "key-value",
|
|
"template": "state",
|
|
"options": {
|
|
"key-ttl": true
|
|
}
|
|
},
|
|
{
|
|
"name": "finding-events",
|
|
"storage": "stream",
|
|
"template": "events",
|
|
"options": {
|
|
"events": [
|
|
"finding-written.*",
|
|
"finding-cleared.*",
|
|
"findings-stated.*"
|
|
],
|
|
"max-age-days": 7,
|
|
"max-mib": 16
|
|
}
|
|
}
|
|
],
|
|
"config": {
|
|
"points-cap": {
|
|
"type": "number",
|
|
"description": "bytes the points directory may hold; an act that would pass it ends failed, naming it, before it removes anything (design 47 G section 564).",
|
|
"minimum": 1,
|
|
"trusted": false,
|
|
"default": 10737418240
|
|
},
|
|
"points-filling-mark": {
|
|
"type": "number",
|
|
"description": "percent of the cap past which the finding points-filling is written (design 47 G section 564).",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"trusted": false,
|
|
"default": 80
|
|
},
|
|
"point-keep-days": {
|
|
"type": "number",
|
|
"description": "days after which a restore point is removed, the newest of its kept data never (design 47 G sections 551, 557).",
|
|
"minimum": 0.01,
|
|
"maximum": 3650,
|
|
"trusted": false,
|
|
"default": 90
|
|
},
|
|
"dump-wait-minutes": {
|
|
"type": "number",
|
|
"description": "minutes an act waits on the dump of the bus's item before recovery-waits is written (design 47 G sections 561, 557).",
|
|
"minimum": 0.01,
|
|
"maximum": 10080,
|
|
"trusted": false,
|
|
"default": 60
|
|
},
|
|
"snapshot-restore-wait-minutes": {
|
|
"type": "number",
|
|
"description": "minutes a restore in place of a protected keeper's snapshot is waited on, and once more after its cancel (design 47 G section 681, A-138, A-140).",
|
|
"minimum": 0.01,
|
|
"maximum": 10080,
|
|
"trusted": false,
|
|
"default": 90
|
|
},
|
|
"expire-every-hours": {
|
|
"type": "number",
|
|
"description": "hours between two removals of the points past their keep days, beside the one at the start and at each snapshot-kept; timed by a bound key of the state bounds (design 47 G sections 551, 557, A-138).",
|
|
"minimum": 0.01,
|
|
"maximum": 8760,
|
|
"trusted": false,
|
|
"default": 24
|
|
}
|
|
},
|
|
"data": {
|
|
"own": [
|
|
{
|
|
"id": "points",
|
|
"path": "${dir:points}",
|
|
"class": "valuable",
|
|
"why": "the restore points taken of modules' kept data before a form change, and the asides of live data set aside before a restore (design 47 G sections 516, 554)"
|
|
}
|
|
]
|
|
},
|
|
"own-secrets": {
|
|
"broker": "${dir:state}/broker"
|
|
},
|
|
"secrets-owner": "mesh-recovery",
|
|
"resources": [
|
|
{
|
|
"id": "account",
|
|
"type": "user",
|
|
"name": "mesh-recovery",
|
|
"shell": "/usr/bin/nologin",
|
|
"home": "/var/lib/mesh-recovery"
|
|
},
|
|
{
|
|
"id": "state",
|
|
"type": "directory",
|
|
"mode": "0700",
|
|
"owner": "mesh-recovery",
|
|
"place": ".",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "points",
|
|
"type": "directory",
|
|
"path": "/var/lib/mesh-recovery/points",
|
|
"mode": "0700",
|
|
"owner": "mesh-recovery",
|
|
"unknown": "program"
|
|
},
|
|
{
|
|
"id": "cap",
|
|
"type": "file",
|
|
"path": "${dir:state}/points-cap",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/points-cap"
|
|
},
|
|
{
|
|
"id": "mark",
|
|
"type": "file",
|
|
"path": "${dir:state}/points-filling-mark",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/points-filling-mark"
|
|
},
|
|
{
|
|
"id": "keep-days",
|
|
"type": "file",
|
|
"path": "${dir:state}/point-keep-days",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/point-keep-days"
|
|
},
|
|
{
|
|
"id": "dump-wait",
|
|
"type": "file",
|
|
"path": "${dir:state}/dump-wait-minutes",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/dump-wait-minutes"
|
|
},
|
|
{
|
|
"id": "restore-wait",
|
|
"type": "file",
|
|
"path": "${dir:state}/snapshot-restore-wait-minutes",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/snapshot-restore-wait-minutes"
|
|
},
|
|
{
|
|
"id": "expire-every",
|
|
"type": "file",
|
|
"path": "${dir:state}/expire-every-hours",
|
|
"owner": "mesh-recovery",
|
|
"mode": "0600",
|
|
"template": "files/expire-every-hours"
|
|
},
|
|
{
|
|
"id": "recovery",
|
|
"type": "process",
|
|
"name": "mesh-recovery",
|
|
"artifact": "program",
|
|
"run": [
|
|
"./mesh-recovery"
|
|
],
|
|
"env": {
|
|
"MESH_BROKER_FILE": "${dir:state}/broker",
|
|
"MESH_RECOVERY_POINTS": "${dir:points}",
|
|
"MESH_RECOVERY_POINTS_CAP_FILE": "${dir:state}/points-cap",
|
|
"MESH_RECOVERY_FILLING_MARK_FILE": "${dir:state}/points-filling-mark",
|
|
"MESH_RECOVERY_KEEP_DAYS_FILE": "${dir:state}/point-keep-days",
|
|
"MESH_RECOVERY_DUMP_WAIT_FILE": "${dir:state}/dump-wait-minutes",
|
|
"MESH_RECOVERY_RESTORE_WAIT_FILE": "${dir:state}/snapshot-restore-wait-minutes",
|
|
"MESH_RECOVERY_EXPIRE_EVERY_FILE": "${dir:state}/expire-every-hours"
|
|
},
|
|
"user": "mesh-recovery",
|
|
"serves": [
|
|
"seat:mesh-recovery.snapshot-kept",
|
|
"seat:mesh-recovery.restore-kept",
|
|
"seat:mesh-recovery.kept-points",
|
|
"seat:mesh-recovery.restore-aside",
|
|
"seat:mesh-recovery.cancel",
|
|
"seat:mesh-recovery.take",
|
|
"seat:mesh-recovery.restore",
|
|
"seat:mesh-recovery.retry",
|
|
"seat:mesh-recovery.aside",
|
|
"seat:mesh-recovery.discard-aside",
|
|
"seat:mesh-recovery.expire-points"
|
|
],
|
|
"bus": {
|
|
"invokes": [
|
|
"seat:mesh-catalog.seat-definitions",
|
|
"seat:mesh-catalog.entry",
|
|
"seat:mesh-module-assigner.assignments",
|
|
"seat:mesh-hand-acts.hand-act",
|
|
"seat:mesh-broker.show",
|
|
"seat:mesh-broker.snapshot-get",
|
|
"seat:mesh-broker.snapshot-restore",
|
|
"seat:mesh-broker.snapshot-restore-cancel",
|
|
"seat:node-backup.restore"
|
|
]
|
|
},
|
|
"health": {
|
|
"kind": "unit"
|
|
}
|
|
}
|
|
],
|
|
"runtime-health": {
|
|
"kind": "tool",
|
|
"tool": "recovery_kept_points",
|
|
"interval": "60s",
|
|
"timeout": "10s",
|
|
"looks": 2,
|
|
"grace": "180s"
|
|
},
|
|
"build": {
|
|
"artifacts": [
|
|
{
|
|
"name": "program",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/mesh-recovery",
|
|
"binary": "mesh-recovery"
|
|
},
|
|
{
|
|
"name": "tools",
|
|
"kind": "bundle",
|
|
"language": "go",
|
|
"system": "arch",
|
|
"from": "cmd/mesh-recovery-tools",
|
|
"binary": "mesh-recovery-tools",
|
|
"loads": [
|
|
"mesh-recovery-tools"
|
|
]
|
|
},
|
|
{
|
|
"name": "files",
|
|
"kind": "archive",
|
|
"from": "files"
|
|
}
|
|
]
|
|
}
|
|
}
|