feat(peering): admin enable/disable from the panel (#134) #135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/peering-enable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #134.
Makes peering something an admin turns on and off from the running instance, instead of a deploy-time config decision.
Two-level gating, resolved.
peering.statePathnow defaults to/data/.cairn/peering.json(config.go), so the subsystem is always mounted — the admin panel, key issuance and peer registration work on every instance. The runtimepeeringEnabledsetting decides whether the transport actually answers.Server.
PeeringSendAPIgains anEnabled func() boolgate (nil = ungated, so existing tests are unchanged).send/peers/transfersreturn503when peering is off.main.gowires the existingpeerOnclosure (settingsStore.Get().PeeringEnabled). Because the send UI feature-probesGET /peering/peers, the 503 makes the send surface auto-hide until an admin turns peering on. New test:TestSendSurfaceUnavailableWhenPeeringOff.UI. A labelled enable/disable switch at the top of the Instance-peering panel, bound to
serverSettings.peeringEnabled. Toggling it re-PUTs the full settings object with the flag flipped — no new endpoint. i18n for all four locales; a quiet notice explaining what "off" means.No new server endpoint; reuses
GET/PUT /api/v1/settings. Green on the branch: gofmt/vet clean, fullgo test ./...pass,go build ./...clean, both JS blocks passnode --check.