Skip to content

Commit 1e2fa90

Browse files
committed
Chore: Update Doc + Restart Recovery
1 parent 687e98e commit 1e2fa90

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

vault-manager/README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ vault-manager/
4747

4848
```bash
4949
cd vault-manager
50-
go run ./cmd/vault-manager --vault-addr=http://localhost:8200
50+
go run ./cmd/main.go --vault-addr=http://localhost:8200
5151
```
5252

5353
On first run against an uninitialized Vault, the unseal key and root token
@@ -56,14 +56,14 @@ afterward. On subsequent runs against an already-initialized Vault, set
5656
`VAULT_ROOT_TOKEN` in the environment instead:
5757

5858
```bash
59-
VAULT_ROOT_TOKEN=hvs.xxxxx go run ./cmd/vault-manager --vault-addr=http://localhost:8200
59+
VAULT_ROOT_TOKEN=hvs.xxxxx go run ./cmd/main.go --vault-addr=http://localhost:8200
6060
```
6161

6262
To provision once with root and then drop root privileges for the life of
6363
the process:
6464

6565
```bash
66-
go run ./cmd/vault-manager --vault-addr=http://localhost:8200 --secure
66+
go run ./cmd/main.go --vault-addr=http://localhost:8200 --secure
6767
```
6868

6969
## CLI flags
@@ -78,6 +78,7 @@ go run ./cmd/vault-manager --vault-addr=http://localhost:8200 --secure
7878
| `--manager-role` | `vault-manager-bootstrap` | AppRole name used for the `--secure` bootstrap handoff |
7979
| `--manager-policy` | `vault-manager-bootstrap-policy` | ACL policy name for the bootstrap manager AppRole |
8080
| `--services` | `persys-gateway,persys-scheduler,persysctl,compute-agent,persys-forgery,persys-services,persys-automation,persys-intelligence,persys-sdk` | Comma-separated list of services to provision |
81+
| `--bootstrap-file` | `/var/lib/persys/vault/bootstrap.json` | Persistent recovery credentials (unseal keys + auth) |
8182
| `--secure` | `false` | Provision a bootstrap AppRole and revoke the root token after setup |
8283

8384
## Environment variables
@@ -125,6 +126,27 @@ logs (method, status code, duration, and any error) for each call.
125126
In docker compose, this is used by the `vault-manager` profile in
126127
`infra/docker/docker-compose.yml`.
127128

129+
130+
## Restart / recovery
131+
132+
Unseal keys and auth credentials are written to `--bootstrap-file`
133+
(default `/var/lib/persys/vault/bootstrap.json`) on first init.
134+
135+
After `docker compose down` (without `-v`) and `up` again:
136+
137+
1. Vault comes back **sealed**.
138+
2. vault-manager loads the bootstrap file from the `vault_manager_data` volume.
139+
3. It unseals Vault with the stored keys, then authenticates (manager AppRole or root token).
140+
141+
**Requirements:**
142+
143+
- Named volume mounted at `/var/lib/persys/vault/` (as in compose).
144+
- Do **not** use `docker compose down -v` unless you intend to wipe recovery state.
145+
- The image entrypoint chowns the volume so the non-root `app` user can write `bootstrap.json`.
146+
147+
If the bootstrap file is missing on an already-initialized Vault, set
148+
`VAULT_ROOT_TOKEN` once; after a successful run the file is rewritten.
149+
128150
## Operational notes
129151

130152
- Single key-share initialization (`secret_shares: 1`, `secret_threshold:

0 commit comments

Comments
 (0)