summaryrefslogtreecommitdiff
path: root/secrets/ready.sh
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-11-18 14:02:09 +0000
committerIgor Soarez <igor@soarez.org>2026-11-18 14:02:09 +0000
commit8f818a64f2f0f3a833fc842d52a675358ec64c9c (patch)
treeeac13a48cada4595c9073d62060c1145189c6344 /secrets/ready.sh
parent6444d6a508cdfdcf52cc6c83bab1e29a7e2a2e10 (diff)
szecret: buckets beside the old store -- get/has/put/mv/rekey/list/check/enrol, admins from SZECRET_ADMINS_COMMAND; rotate retired (fleet hardening 12)
A bucket is a directory of secrets with one set of readers: its recipients file plus the admins, the full set recorded in .szecret by rekey. put refuses when the readers or admins drift from that set, or with no admins; a plain put of a new name goes to admin-only, one still in the old store is rewritten there. The old store keeps working throughout. link/claude.sh leaves out an MCP server whose secret is in a bucket this host doesn't read. Design: cloud-setup docs/proposal-secret-roles.md.
Diffstat (limited to 'secrets/ready.sh')
-rwxr-xr-xsecrets/ready.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/secrets/ready.sh b/secrets/ready.sh
index dee2f86..2760ec4 100755
--- a/secrets/ready.sh
+++ b/secrets/ready.sh
@@ -6,15 +6,16 @@ if [[ "$#" -gt 0 && ("$1" == "-h" || "$1" == "--help") ]]; then
cat <<EOF
ready: Check if the secret management system is ready for use
-Tests whether the age private key is properly configured and available
-for secret operations. Exits with status 0 if ready, non-zero if not.
+Ready means a store (buckets, or the old store) and an identity to read it
+with: this machine's own (szecret enrol), or the old key. Exits with status 0
+if ready, non-zero if not.
Usage:
ready
ready -h|--help
The command will:
-1. Check if the private key exists and is readable
+1. Check for this machine's identity, or the old private key
2. Perform any necessary legacy key migration
3. Exit with appropriate status code
@@ -27,5 +28,7 @@ this_dir="$(cd "$(dirname "$(realpath "$0")")" && pwd)"
szecret_quiet=1
source "${this_dir}/common.sh"
-private_key_is_setup
-
+if [[ -r "${identity}" ]]; then
+ exit 0
+fi
+[[ -n "${store}" ]] && private_key_is_setup