From 13e98d1229d521183aa68856672942329756378e Mon Sep 17 00:00:00 2001 From: Will Song Date: Wed, 16 Jul 2025 00:00:01 -0500 Subject: [PATCH] Automated backup - 20250716_000001 --- silly/README.md | 63 +++++++++++++++++++++++++++++++++ silly/docker-compose.yml | 34 ++++++++++++++++++ silly/init_apis.sh | 76 ++++++++++++++++++++++++++++++++++++++++ tokens.txt | 3 ++ 4 files changed, 176 insertions(+) create mode 100644 silly/README.md create mode 100644 silly/docker-compose.yml create mode 100755 silly/init_apis.sh diff --git a/silly/README.md b/silly/README.md new file mode 100644 index 0000000..ae4ef1e --- /dev/null +++ b/silly/README.md @@ -0,0 +1,63 @@ +# SillyTavern Docker Setup + +This directory contains Docker configuration for SillyTavern, a frontend for AI chat. + +## Quick Start + +1. Ensure the Caddy network exists: + ```bash + docker network create caddy-network + ``` + +2. Start SillyTavern: + ```bash + docker-compose up -d + ``` + +3. Access SillyTavern: + - Local: http://localhost:8000 + - Domain: https://silly.will123song.xyz (via Caddy reverse proxy) + +## Configuration + +- **API Keys**: Pre-configured with tokens from `~/docker/tokens.txt` +- **Reverse Proxy**: Configured in Caddy for `silly.will123song.xyz` +- **Persistent Data**: All user data, characters, and chats are stored in local volumes + +## Volumes + +- `./config` - SillyTavern configuration files +- `./characters` - Character definitions +- `./chats` - Chat history +- `./groups` - Group chats +- `./worlds` - World info +- `./themes` - Custom themes +- `./avatars` - User avatars +- `./backups` - Automatic backups + +## API Support + +Configured with the following AI APIs: +- OpenAI (GPT models) +- Anthropic Claude +- DeepSeek +- Kimi (Moonshot) +- Google Gemini +- Alpha Vantage (for financial data) + +## Management + +```bash +# View logs +docker-compose logs -f + +# Restart service +docker-compose restart + +# Stop service +docker-compose down + +# Update image +docker-compose pull +docker-compose up -d +``` \ No newline at end of file diff --git a/silly/docker-compose.yml b/silly/docker-compose.yml new file mode 100644 index 0000000..9afb649 --- /dev/null +++ b/silly/docker-compose.yml @@ -0,0 +1,34 @@ +services: + sillytavern: + image: ghcr.io/sillytavern/sillytavern:latest + container_name: sillytavern + restart: unless-stopped + expose: + - "8000" + volumes: + - ./data:/home/node/app/data + - ./config:/home/node/app/config + - ./characters:/home/node/app/public/characters + - ./chats:/home/node/app/public/chats + - ./groups:/home/node/app/public/groups + - ./worlds:/home/node/app/public/worlds + - ./themes:/home/node/app/public/themes + - ./avatars:/home/node/app/public/User Avatars + - ./backups:/home/node/app/backups + - ./user:/home/node/app/public/user + env_file: + - .env + environment: + - SILLYTAVERN_PORT=8000 + - SILLYTAVERN_HOST=0.0.0.0 + networks: + - caddy_caddy-network + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000"] + interval: 30s + timeout: 10s + retries: 3 + +networks: + caddy_caddy-network: + external: true \ No newline at end of file diff --git a/silly/init_apis.sh b/silly/init_apis.sh new file mode 100755 index 0000000..924c2fb --- /dev/null +++ b/silly/init_apis.sh @@ -0,0 +1,76 @@ +#!/bin/bash + +# 创建API配置目录 +mkdir -p /home/will/docker/silly/config/api_configs + +# 创建各个API提供商的配置文件 +cat > /home/will/docker/silly/config/api_configs/openai.json << 'EOF' +{ + "name": "OpenAI", + "type": "openai", + "url": "https://api.openai.com/v1", + "models": [ + "gpt-4o", + "gpt-4o-mini", + "gpt-4-turbo", + "gpt-3.5-turbo" + ], + "default_model": "gpt-4o-mini" +} +EOF + +cat > /home/will/docker/silly/config/api_configs/claude.json << 'EOF' +{ + "name": "Claude", + "type": "claude", + "url": "https://api.anthropic.com/v1", + "models": [ + "claude-3-5-sonnet-20241022", + "claude-3-haiku-20240307", + "claude-3-opus-20240229" + ], + "default_model": "claude-3-haiku-20240307" +} +EOF + +cat > /home/will/docker/silly/config/api_configs/deepseek.json << 'EOF' +{ + "name": "DeepSeek", + "type": "openai", + "url": "https://api.deepseek.com/v1", + "models": [ + "deepseek-chat", + "deepseek-coder" + ], + "default_model": "deepseek-chat" +} +EOF + +cat > /home/will/docker/silly/config/api_configs/kimi.json << 'EOF' +{ + "name": "Kimi", + "type": "openai", + "url": "https://api.moonshot.cn/v1", + "models": [ + "moonshot-v1-8k", + "moonshot-v1-32k", + "moonshot-v1-128k" + ], + "default_model": "moonshot-v1-8k" +} +EOF + +cat > /home/will/docker/silly/config/api_configs/gemini.json << 'EOF' +{ + "name": "Gemini", + "type": "openai", + "url": "https://generativelanguage.googleapis.com/v1beta", + "models": [ + "gemini-pro", + "gemini-pro-vision" + ], + "default_model": "gemini-pro" +} +EOF + +echo "API configurations created successfully!" \ No newline at end of file diff --git a/tokens.txt b/tokens.txt index 8574183..cfddfa1 100644 --- a/tokens.txt +++ b/tokens.txt @@ -14,6 +14,9 @@ alphavantage_API=H1TNEAN9JONTFCY6 VaultWarden_ADMIN_TOKEN=U2WwYJYRprFMpqxZdTpj6afU8VfBoGU0JSLvHE30WkbNMpAijHccDU1GPEI0/Bff kimi_API=sk-xA6IE4AJTzXQh3MerrlAuriX3jhUDjRW4idMrIWfFteEahPe kimi_API_Base_URL=https://api.moonshot.ai/anthropic +Gemeni_API=AIzaSyBZvm_cr5iHgPUpiDTZ7j_r4vYL8yW-tKw + + # Discord Bot 邀请链接 (添加到其他服务器用)