gb/start-and-unseal.sh
Rodrigo Rodriguez 68cd0d6bf3
Some checks are pending
BotServer CI / build (push) Waiting to run
Update submodule references
- botserver: Fix notify dependency and source files
- botbook: Update PROMPT.md
- botui: Update UI components and themes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 22:31:59 +00:00

26 lines
763 B
Bash
Executable file

#!/bin/bash
set -e
echo "🔓 Unsealing Vault..."
UNSEAL_KEY="$(cat botserver-stack/conf/vault/init.json | grep -o '"unseal_keys_b64":\["[^"]*"' | cut -d'"' -f4)"
# Wait for Vault to start
for i in {1..30}; do
if curl -sfk --cacert botserver-stack/conf/system/certificates/ca/ca.crt \
https://localhost:8200/v1/sys/health > /dev/null 2>&1; then
echo "✅ Vault is running"
break
fi
echo "⏳ Waiting for Vault... ($i/30)"
sleep 1
done
# Unseal Vault
echo "🔓 Unsealing..."
curl -s --cacert botserver-stack/conf/system/certificates/ca/ca.crt \
-X POST \
-H "X-Vault-Token: hvs.JjKHlEzycO2jvKdhhlRAoODu" \
-d "{\"key\": \"$UNSEAL_KEY\"}" \
https://localhost:8200/v1/sys/unseal
echo "✅ Vault unsealed"