Implement Phase 1.2: Database with encryption at rest and core infrastructure

Co-authored-by: southseact-3d <217551146+southseact-3d@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-09 19:33:00 +00:00
parent 95a2d1b98d
commit 650d849ad2
17 changed files with 2716 additions and 0 deletions

View File

@@ -285,6 +285,26 @@ cleanup() {
# Set up traps for common signals
trap cleanup SIGTERM SIGINT SIGQUIT SIGHUP
# Initialize database before starting chat service
log "=== DATABASE INITIALIZATION ==="
if [ -f "$CHAT_APP_DIR/scripts/init-database.js" ]; then
log "Running database initialization..."
if CHAT_DATA_ROOT=$REPO_DIR node "$CHAT_APP_DIR/scripts/init-database.js"; then
log "Database initialization successful"
else
log "WARNING: Database initialization failed, but continuing startup"
fi
elif [ -f "$CHAT_APP_FALLBACK/scripts/init-database.js" ]; then
log "Running database initialization from fallback location..."
if CHAT_DATA_ROOT=$REPO_DIR node "$CHAT_APP_FALLBACK/scripts/init-database.js"; then
log "Database initialization successful"
else
log "WARNING: Database initialization failed, but continuing startup"
fi
else
log "Database initialization script not found, skipping..."
fi
if [ -f "$CHAT_APP_DIR/server.js" ]; then
log "Launching chat service on ${CHAT_HOST}:${CHAT_PORT} from $CHAT_APP_DIR"
log "Environment: CHAT_PORT=${CHAT_PORT} CHAT_HOST=${CHAT_HOST} CHAT_DATA_ROOT=${REPO_DIR} CHAT_REPO_ROOT=${REPO_DIR}"