Compare commits
27 commits
66f54677bf
...
3ea4c562e1
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ea4c562e1 | |||
| cae2dda8ee | |||
| 3a133e10d4 | |||
| c54b7333d2 | |||
| a0ef7d8488 | |||
| 8fc44928a6 | |||
| 9fa5058470 | |||
| 03ec4c301c | |||
| c15b194ade | |||
| a2a6e53bcb | |||
| 5ff03af1a6 | |||
| 52b54ffae5 | |||
| c909db7aaf | |||
| 613db5748e | |||
| 1d46122dc5 | |||
| c10c2e0b78 | |||
| 8c5ee3f3e3 | |||
| 5226c771f8 | |||
| e496ac11e2 | |||
| 704bbb22a5 | |||
| 375c3780c2 | |||
| e5bf8ec75a | |||
| ae8b830773 | |||
| 5cab98b459 | |||
| 027c7c77b8 | |||
| c6b21149b1 | |||
| 68cd0d6bf3 |
4 changed files with 87 additions and 2 deletions
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8257d4996739379a6d608230d18047569559864b
|
Subproject commit dec3a086abd2df28452f44f8f8986a3e3ae27005
|
||||||
2
botui
2
botui
|
|
@ -1 +1 @@
|
||||||
Subproject commit 9b417bf4f23f540b5c8cace81e50c37729844e06
|
Subproject commit 4f654dd95daeb8e21c7977f6f4762fdac392b2d3
|
||||||
59
restart.sh
Executable file
59
restart.sh
Executable file
|
|
@ -0,0 +1,59 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "🛑 Stopping existing processes..."
|
||||||
|
pkill -f "botserver --noconsole" || true
|
||||||
|
pkill -f botui || true
|
||||||
|
pkill -f rustc || true
|
||||||
|
# Note: PostgreSQL, Vault, and Valkey are managed by botserver bootstrap, don't kill them
|
||||||
|
|
||||||
|
echo "🧹 Cleaning logs..."
|
||||||
|
rm -f botserver.log botui.log
|
||||||
|
|
||||||
|
echo "🔨 Building botserver..."
|
||||||
|
cargo build -p botserver
|
||||||
|
|
||||||
|
echo "🔨 Building botui..."
|
||||||
|
cargo build -p botui
|
||||||
|
|
||||||
|
echo "🗄️ Starting PostgreSQL..."
|
||||||
|
./botserver-stack/bin/tables/bin/postgres -D botserver-stack/data/tables/pgdata -c config_file=botserver-stack/conf/postgresql.conf > botserver-stack/logs/tables/postgres.log 2>&1 &
|
||||||
|
echo " PostgreSQL PID: $!"
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
echo "🔑 Starting Valkey (cache)..."
|
||||||
|
./botserver-stack/bin/cache/valkey-server --daemonize no --dir botserver-stack/data/cache > /dev/null 2>&1 &
|
||||||
|
echo " Valkey started"
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
echo "🚀 Starting botserver..."
|
||||||
|
export VAULT_ADDR="https://localhost:8200"
|
||||||
|
export VAULT_TOKEN="hvs.JjKHlEzycO2jvKdhhlRAoODu"
|
||||||
|
export VAULT_CACERT="./botserver-stack/conf/system/certificates/ca/ca.crt"
|
||||||
|
export VAULT_CACHE_TTL="300"
|
||||||
|
RUST_LOG=info ./target/debug/botserver --noconsole > botserver.log 2>&1 &
|
||||||
|
BOTSERVER_PID=$!
|
||||||
|
|
||||||
|
echo "⏳ Waiting for Vault to start (unsealing in background)..."
|
||||||
|
(
|
||||||
|
sleep 8
|
||||||
|
echo "🔓 Unsealing Vault..."
|
||||||
|
UNSEAL_KEY=$(python3 -c "import json; print(json.load(open('botserver-stack/conf/vault/init.json'))['unseal_keys_b64'][0])" 2>/dev/null)
|
||||||
|
if [ -n "$UNSEAL_KEY" ]; then
|
||||||
|
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 2>/dev/null && echo "✅ Vault unsealed" || echo "⚠️ Unseal failed"
|
||||||
|
else
|
||||||
|
echo "⚠️ Could not extract unseal key"
|
||||||
|
fi
|
||||||
|
) &
|
||||||
|
|
||||||
|
echo "🚀 Starting botui..."
|
||||||
|
BOTSERVER_URL="https://localhost:8088" ./target/debug/botui > botui.log 2>&1 &
|
||||||
|
BOTUI_PID=$!
|
||||||
|
|
||||||
|
echo "✅ Started botserver (PID: $BOTSERVER_PID) and botui (PID: $BOTUI_PID)"
|
||||||
|
echo "📊 Monitor with: tail -f botserver.log botui.log"
|
||||||
|
echo "🌐 Access at: http://localhost:3000"
|
||||||
26
start-and-unseal.sh
Executable file
26
start-and-unseal.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
||||||
|
#!/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"
|
||||||
Loading…
Add table
Reference in a new issue