Files
miku-discord/setup.sh
koko210Serve 8d09a8a52f Implement comprehensive config system and clean up codebase
Major changes:
- Add Pydantic-based configuration system (bot/config.py, bot/config_manager.py)
- Add config.yaml with all service URLs, models, and feature flags
- Fix config.yaml path resolution in Docker (check /app/config.yaml first)
- Remove Fish Audio API integration (tested feature that didn't work)
- Remove hardcoded ERROR_WEBHOOK_URL, import from config instead
- Add missing Pydantic models (LogConfigUpdateRequest, LogFilterUpdateRequest)
- Enable Cheshire Cat memory system by default (USE_CHESHIRE_CAT=true)
- Add .env.example template with all required environment variables
- Add setup.sh script for user-friendly initialization
- Update docker-compose.yml with proper env file mounting
- Update .gitignore for config files and temporary files

Config system features:
- Static configuration from config.yaml
- Runtime overrides from config_runtime.yaml
- Environment variables for secrets (.env)
- Web UI integration via config_manager
- Graceful fallback to defaults

Secrets handling:
- Move ERROR_WEBHOOK_URL from hardcoded to .env
- Add .env.example with all placeholder values
- Document all required secrets
- Fish API key and voice ID removed from .env

Documentation:
- CONFIG_README.md - Configuration system guide
- CONFIG_SYSTEM_COMPLETE.md - Implementation summary
- FISH_API_REMOVAL_COMPLETE.md - Removal record
- SECRETS_CONFIGURED.md - Secrets setup record
- BOT_STARTUP_FIX.md - Pydantic model fixes
- MIGRATION_CHECKLIST.md - Setup checklist
- WEB_UI_INTEGRATION_COMPLETE.md - Web UI config guide
- Updated readmes/README.md with new features
2026-02-15 19:51:00 +02:00

60 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# ============================================
# Miku Discord Bot - Setup Script
# ============================================
# This script helps you set up the configuration
set -e
echo "🎵 Miku Discord Bot - Configuration Setup"
echo "========================================"
echo ""
# Check if .env exists
if [ -f ".env" ]; then
echo "⚠️ .env file already exists."
read -p "Do you want to backup it and create a new one? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
mv .env .env.backup.$(date +%Y%m%d_%H%M%S)
echo "✅ Old .env backed up"
else
echo "❌ Setup cancelled. Using existing .env"
exit 0
fi
fi
# Copy .env.example to .env
if [ -f ".env.example" ]; then
cp .env.example .env
echo "✅ Created .env from .env.example"
else
echo "❌ .env.example not found!"
exit 1
fi
echo ""
echo "📝 Please edit .env and add your values:"
echo " - DISCORD_BOT_TOKEN (required)"
echo " - OWNER_USER_ID (optional, defaults to existing value)"
echo " - ERROR_WEBHOOK_URL (optional)"
echo ""
# Check if config.yaml exists
if [ ! -f "config.yaml" ]; then
echo "❌ config.yaml not found!"
echo " This file should have been created with the config system."
exit 1
else
echo "✅ config.yaml found"
fi
echo ""
echo "📚 Next steps:"
echo " 1. Edit .env and add your API keys and tokens"
echo " 2. (Optional) Edit config.yaml to customize settings"
echo " 3. Run: docker compose up -d"
echo ""
echo "✅ Setup complete!"