init --no-phrase: an identity without a recovery phrase

For bootstrap nodes and other unattended setups: nothing is shown or logged,
and the data directory is marked so later messages do not point to
'allmende recover', which cannot work. The identity lasts the certificate
lifetime (a year) and then has to be replaced; the node says so.

The Kubernetes StatefulSet now initialises itself on first start with it,
so no manual exec step is left.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 12:25:54 +01:00
co-authored by Claude Sonnet 5.5
parent 4b6b3726af
commit 7120959cb8
6 changed files with 108 additions and 37 deletions
+10 -16
View File
@@ -1,9 +1,8 @@
# One node, with its keys and database on a volume. Keep it at one replica: a
# second pod would be a second node with its own identity, not a copy.
#
# The identity is created by hand, once, because it shows a recovery phrase
# that must never end up in a log. Until you do, the pod waits:
# kubectl -n allmende exec -it allmende-0 -- allmende init
# The identity is created on the first start, without a recovery phrase (so
# nothing secret is logged). It lasts a year; see k8s/README.md.
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -31,16 +30,15 @@ spec:
- name: allmende
image: allmende
imagePullPolicy: IfNotPresent
# Wait for 'allmende init' (it writes admin.token last), then run as a
# bootstrap node: --public serves the DHT and relays for nodes behind
# a NAT, --announce names the address the router forwards.
# First start: create the identity without a recovery phrase (a
# bootstrap node has nothing to recover; its identity is its peer ID,
# which lives on the volume). Then run as a bootstrap node: --public
# serves the DHT and relays for nodes behind a NAT, --announce names
# the address the router forwards.
command: ["/bin/sh", "-c"]
args:
- |
until [ -f /data/admin.token ]; do
echo "not set up yet: run kubectl -n allmende exec -it allmende-0 -- allmende init"
sleep 10
done
[ -f /data/admin.token ] || allmende init --no-phrase
exec allmende run \
--public \
--no-default-bootstrap \
@@ -67,21 +65,17 @@ spec:
- name: http
containerPort: 8080
protocol: TCP
# Ready once the node answers; before 'init' it never does, which keeps
# a half-set-up node out of the Services without restarting it.
readinessProbe:
httpGet:
path: /api/v1/status
port: http
periodSeconds: 10
# Only judge it dead after the first start succeeded (the wait for
# 'init' may take as long as you need).
startupProbe:
httpGet:
path: /api/v1/status
port: http
periodSeconds: 10
failureThreshold: 360
periodSeconds: 5
failureThreshold: 60
livenessProbe:
httpGet:
path: /api/v1/status