Some checks failed
BotServer CI / build (push) Failing after 9s
- botserver: Fix tool call handling across multiple LLM response chunks - botserver: Add SELECT/CASE to match expression conversion - Add restart.sh: Automated botserver and botui startup script - Add start-and-unseal.sh: Vault startup and unsealing script Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 lines
763 B
Bash
Executable file
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"
|