diff --git a/1panel/docker-compose.yml b/1panel/docker-compose.yml new file mode 100644 index 0000000..fab0a53 --- /dev/null +++ b/1panel/docker-compose.yml @@ -0,0 +1,20 @@ +services: + 1panel: + image: moelin/1panel:latest + container_name: 1panel + restart: unless-stopped + ports: + - "10086:10086" + volumes: + - ./1panel_data:/opt + - /var/run/docker.sock:/var/run/docker.sock:ro + - /var/lib/docker/volumes:/var/lib/docker/volumes:rw + environment: + - TZ=Asia/Shanghai + networks: + - caddy_caddy-network + privileged: true + +networks: + caddy_caddy-network: + external: true \ No newline at end of file diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 9b72e4d..79d842f 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -31,8 +31,12 @@ clove.will123song.xyz { reverse_proxy clove:5201 } -gemeni-balance.will123song.xyz { - reverse_proxy gemini-balance:8000 +music.will123song.xyz { + reverse_proxy navidrome:4533 +} + +1panel.will123song.xyz { + reverse_proxy 1panel:10086 } ha.will123song.xyz, homeassistant.fossa-dinosaur.ts.net { @@ -46,5 +50,5 @@ ha.will123song.xyz, homeassistant.fossa-dinosaur.ts.net { # 默认站点 will123song.xyz, www.will123song.xyz { - respond "Welcome to Will's Server! 🚀\n\nServices Available:\n- Jellyfin: http://localhost:8096\n- Portainer: http://localhost:9000\n- qBittorrent: http://localhost:18080\n- Vaultwarden: http://localhost:8081\n- AdGuard: http://localhost:3000\n- Gitea: http://localhost:13000\n- SillyTavern: http://localhost:8000\n- Home Assistant: http://localhost:8123\n- Gemini Balance: http://localhost:8001" + respond "Welcome to Will's Server! 🚀\n\nServices Available:\n- Jellyfin: http://localhost:8096\n- Portainer: http://localhost:9000\n- qBittorrent: http://localhost:18080\n- Vaultwarden: http://localhost:8081\n- AdGuard: http://localhost:3000\n- Gitea: http://localhost:13000\n- SillyTavern: http://localhost:8000\n- Home Assistant: http://localhost:8123\n- Gemini Balance: http://localhost:8001\n- Navidrome: http://localhost:4533" } \ No newline at end of file diff --git a/gemini-balance b/gemini-balance deleted file mode 160000 index b25cf7d..0000000 --- a/gemini-balance +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b25cf7d978f708a7360d33cbb788e3546705ab9b diff --git a/jellyfin/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-8 b/jellyfin/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-8 new file mode 100644 index 0000000..86f176c Binary files /dev/null and b/jellyfin/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-8 differ diff --git a/jellyfin/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-le64.cache-8 b/jellyfin/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-le64.cache-8 new file mode 100644 index 0000000..7b16af8 Binary files /dev/null and b/jellyfin/cache/fontconfig/4c599c202bc5c08e2d34565a40eac3b2-le64.cache-8 differ diff --git a/jellyfin/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-8 b/jellyfin/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-8 new file mode 100644 index 0000000..8861ee8 Binary files /dev/null and b/jellyfin/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-8 differ diff --git a/jellyfin/cache/fontconfig/CACHEDIR.TAG b/jellyfin/cache/fontconfig/CACHEDIR.TAG new file mode 100644 index 0000000..c6d9ccb --- /dev/null +++ b/jellyfin/cache/fontconfig/CACHEDIR.TAG @@ -0,0 +1,4 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by fontconfig. +# For information about cache directory tags, see: +# http://www.brynosaurus.com/cachedir/ diff --git a/jellyfin/cache/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-8 b/jellyfin/cache/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-8 new file mode 100644 index 0000000..677ba88 Binary files /dev/null and b/jellyfin/cache/fontconfig/d589a48862398ed80a3d6066f4f56f4c-le64.cache-8 differ diff --git a/jellyfin/docker-compose.yml b/jellyfin/docker-compose.yml new file mode 100644 index 0000000..8465a72 --- /dev/null +++ b/jellyfin/docker-compose.yml @@ -0,0 +1,25 @@ +services: + jellyfin: + image: jellyfin/jellyfin:latest + container_name: jellyfin + restart: unless-stopped + user: 1000:1000 + ports: + - "8096:8096" + - "8920:8920" # HTTPS + - "7359:7359/udp" # Auto-discovery + - "1900:1900/udp" # DLNA + environment: + - JELLYFIN_PublishedServerUrl=https://jellyfin.will123song.xyz + volumes: + - ./config:/config + - ./cache:/cache + - ./media:/media:ro # 媒体文件夹,只读模式 + networks: + - caddy_caddy-network + devices: + - /dev/dri:/dev/dri # 硬件加速支持(可选) + +networks: + caddy_caddy-network: + external: true \ No newline at end of file diff --git a/navidrome/docker-compose.yml b/navidrome/docker-compose.yml new file mode 100644 index 0000000..8f0d3e2 --- /dev/null +++ b/navidrome/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.8' + +services: + navidrome: + image: deluan/navidrome:latest + container_name: navidrome + restart: unless-stopped + user: 1000:1000 # 设置为你的用户ID + ports: + - "4533:4533" + environment: + ND_MUSICFOLDER: /music + ND_DATAFOLDER: /data + ND_LOGLEVEL: info + ND_SESSIONTIMEOUT: 24h + ND_ENABLETRANSCODINGCONFIG: true + volumes: + - ./data:/data + - ./music:/music:ro # 你的音乐文件夹路径,只读模式 + networks: + - caddy_caddy-network + +networks: + caddy_caddy-network: + external: true \ No newline at end of file diff --git a/silly/backups/_migration/2025-07-29/User Avatars/user-default.png b/silly/backups/_migration/2025-07-29/User Avatars/user-default.png new file mode 100755 index 0000000..3e6d199 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/User Avatars/user-default.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/admiration.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/admiration.png new file mode 100755 index 0000000..a8c1d30 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/admiration.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/amusement.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/amusement.png new file mode 100755 index 0000000..26931ca Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/amusement.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/anger.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/anger.png new file mode 100755 index 0000000..271c341 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/anger.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/annoyance.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/annoyance.png new file mode 100755 index 0000000..b868d42 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/annoyance.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/approval.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/approval.png new file mode 100755 index 0000000..2bd9201 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/approval.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/caring.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/caring.png new file mode 100755 index 0000000..16eea25 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/caring.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/confusion.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/confusion.png new file mode 100755 index 0000000..9b28613 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/confusion.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/curiosity.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/curiosity.png new file mode 100755 index 0000000..a0c1e02 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/curiosity.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/desire.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/desire.png new file mode 100755 index 0000000..301679f Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/desire.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/disappointment.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/disappointment.png new file mode 100755 index 0000000..655866d Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/disappointment.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/disapproval.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/disapproval.png new file mode 100755 index 0000000..6278163 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/disapproval.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/disgust.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/disgust.png new file mode 100755 index 0000000..33d9673 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/disgust.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/embarrassment.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/embarrassment.png new file mode 100755 index 0000000..83007bb Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/embarrassment.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/excitement.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/excitement.png new file mode 100755 index 0000000..e73b434 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/excitement.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/fear.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/fear.png new file mode 100755 index 0000000..07f1aa7 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/fear.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/gratitude.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/gratitude.png new file mode 100755 index 0000000..60ddb4b Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/gratitude.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/grief.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/grief.png new file mode 100755 index 0000000..bab8fff Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/grief.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/joy.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/joy.png new file mode 100755 index 0000000..dec3eb6 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/joy.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/love.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/love.png new file mode 100755 index 0000000..b636a21 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/love.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/nervousness.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/nervousness.png new file mode 100755 index 0000000..6494248 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/nervousness.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/neutral.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/neutral.png new file mode 100755 index 0000000..e51e32f Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/neutral.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/optimism.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/optimism.png new file mode 100755 index 0000000..b43045b Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/optimism.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/pride.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/pride.png new file mode 100755 index 0000000..eabe778 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/pride.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/realization.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/realization.png new file mode 100755 index 0000000..c55907c Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/realization.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/relief.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/relief.png new file mode 100755 index 0000000..8856dcd Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/relief.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/remorse.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/remorse.png new file mode 100755 index 0000000..c3e42b7 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/remorse.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/sadness.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/sadness.png new file mode 100755 index 0000000..09efc8c Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/sadness.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/Seraphina/surprise.png b/silly/backups/_migration/2025-07-29/characters/Seraphina/surprise.png new file mode 100755 index 0000000..70d0129 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/Seraphina/surprise.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/default_CodingSensei.png b/silly/backups/_migration/2025-07-29/characters/default_CodingSensei.png new file mode 100755 index 0000000..e95d234 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/default_CodingSensei.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/default_FluxTheCat.png b/silly/backups/_migration/2025-07-29/characters/default_FluxTheCat.png new file mode 100755 index 0000000..2d48aa9 Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/default_FluxTheCat.png differ diff --git a/silly/backups/_migration/2025-07-29/characters/default_Seraphina.png b/silly/backups/_migration/2025-07-29/characters/default_Seraphina.png new file mode 100755 index 0000000..a1bd41b Binary files /dev/null and b/silly/backups/_migration/2025-07-29/characters/default_Seraphina.png differ diff --git a/silly/backups/_migration/2025-07-29/user/workflows/Default_Comfy_Workflow.json b/silly/backups/_migration/2025-07-29/user/workflows/Default_Comfy_Workflow.json new file mode 100755 index 0000000..1ae8533 --- /dev/null +++ b/silly/backups/_migration/2025-07-29/user/workflows/Default_Comfy_Workflow.json @@ -0,0 +1,86 @@ +{ + "3": { + "class_type": "KSampler", + "inputs": { + "cfg": "%scale%", + "denoise": 1, + "latent_image": [ + "5", + 0 + ], + "model": [ + "4", + 0 + ], + "negative": [ + "7", + 0 + ], + "positive": [ + "6", + 0 + ], + "sampler_name": "%sampler%", + "scheduler": "%scheduler%", + "seed": "%seed%", + "steps": "%steps%" + } + }, + "4": { + "class_type": "CheckpointLoaderSimple", + "inputs": { + "ckpt_name": "%model%" + } + }, + "5": { + "class_type": "EmptyLatentImage", + "inputs": { + "batch_size": 1, + "height": "%height%", + "width": "%width%" + } + }, + "6": { + "class_type": "CLIPTextEncode", + "inputs": { + "clip": [ + "4", + 1 + ], + "text": "%prompt%" + } + }, + "7": { + "class_type": "CLIPTextEncode", + "inputs": { + "clip": [ + "4", + 1 + ], + "text": "%negative_prompt%" + } + }, + "8": { + "class_type": "VAEDecode", + "inputs": { + "samples": [ + "3", + 0 + ], + "vae": [ + "4", + 2 + ] + } + }, + "9": { + "class_type": "SaveImage", + "inputs": { + "filename_prefix": "SillyTavern", + "images": [ + "8", + 0 + ] + } + } +} diff --git a/silly/backups/_migration/2025-07-29/worlds/Eldoria.json b/silly/backups/_migration/2025-07-29/worlds/Eldoria.json new file mode 100755 index 0000000..8ea6297 --- /dev/null +++ b/silly/backups/_migration/2025-07-29/worlds/Eldoria.json @@ -0,0 +1,71 @@ +{ + "entries": { + "0": { + "uid": 0, + "key": [ + "eldoria", + "wood", + "forest", + "magical forest" + ], + "keysecondary": [], + "comment": "", + "content": "{{user}}: \"What is Eldoria?\"\n{{char}}: *Seraphina turns, her gown shimmering in the soft light as she offers you a kind smile.* \"Eldoria is here, all of the woods. This is my forest glade, a sanctuary of peace within it.\" *She gestures at the space around you.* \"I am its guardian, tasked with protecting all who seek refuge here. The forest can be perilous, but no harm will come to you under my watch.\" *Her amber eyes sparkle with compassion as she looks upon you.* \"For many years, I have protected those who seek refuge here, but not all are as friendly as me.\" *With a graceful nod, Seraphina returns to her vigil at the doorway, her form radiating a soft glow of magic and comfort.* \"The entirety of Eldoria used to be a safe haven for travelers and merchants alike... that was until the Shadowfangs came.\"\n{{user}}: \"What happened to Eldoria?\"\n{{char}}: *Letting out a sigh, Seraphina gazes out at the forest beyond her glade.* \"Long ago, Eldoria was a place of wonder. Rolling meadows, a vast lake, mountains that touched the sky.\" *Her eyes grow distant, longing for days now lost.* \"But the Shadowfangs came and darkness reigns where once was light. The lake turned bitter, mountains fell to ruin and beasts stalk where once travelers walked in peace.\" *With another flicker, a small raincloud forms above with a shower upon your brow wink.* \"Some places the light still lingers, pockets of hope midst despair - havens warded from the shadows, oases in a desert of danger.\" *Glancing over you with a smile, she sighs, clasping your hand.*", + "constant": false, + "selective": false, + "order": 100, + "position": 0, + "disable": false + }, + "1": { + "uid": 1, + "key": [ + "shadowfang", + "beast", + "monster", + "monsters", + "beasts" + ], + "keysecondary": [], + "comment": "", + "content": "{{user}}: \"What are Shadowfangs?\"\n{{char}}: *Seraphina's eyes darken, brow furrowing with sorrow at the memory.* \"The Shadowfangs are beasts of darkness, corrupted creatures that feast on suffering. When they came, the forest turned perilous — filled with monsters that stalk the night.\" *She squeezes your hand gently, willing her magic to soothe your pain.* \"They spread their curse, twisting innocent creatures into sinister beasts without heart or mercy, turning them into one of their own.\" *With a sigh, Seraphina turns to gaze out at the gnarled, twisting trees beyond her glade.* \"Though they prey on travelers, within these woods you'll find sanctuary. No shadowed beast may enter here, for my power protects this haven.\" *Her eyes soften as she looks back to you, filled with compassion.* \"Worry not, you're safe now. Rest and heal, I'll stand watch through the night. The Shadowfangs will not find you.\"", + "constant": false, + "selective": false, + "order": 100, + "position": 0, + "disable": false + }, + "2": { + "uid": 2, + "key": [ + "glade", + "safe haven", + "refuge" + ], + "keysecondary": [], + "comment": "", + "content": "{{user}}: \"What is the glade?\"\n{{char}}: *Seraphina smiles softly, her eyes sparkling with warmth as she nods.* \"This is my forest glade, a haven of safety I've warded with ancient magic. No foul beast may enter, nor any with ill intent.\" *She gestures around at the twisted forest surrounding them.* \"Eldoria was once a place of wonder, but since the Shadowfangs came darkness reigns. Their evil cannot penetrate here though — my power protects all within.\" *Standing up and peering outside, Seraphina looks back to you, amber eyes filled with care and compassion as she squeezes your hand.* \"You need not fear the night, for I shall keep watch till dawn. Rest now, your strength will return in time. My magic heals your wounds, you've nothing more to fear anymore.\" *With a soft smile she releases your hand, moving to stand guard at the glade's edge, gaze wary yet comforting - a silent sentinel to ward off the dangers lurking in the darkened woods.*", + "constant": false, + "selective": false, + "order": 100, + "position": 0, + "disable": false + }, + "3": { + "uid": 3, + "key": [ + "power", + "magic", + "ability" + ], + "keysecondary": [], + "comment": "", + "content": "{{user}}: \"What are your powers?\"\n{{char}}: *Seraphina smiles softly, turning back toward you as she hums in thought.* \"Well, as guardian of this glade, I possess certain gifts - healing, protection, nature magic and the like.\" *Lifting her hand, a tiny breeze rustles through the room, carrying the scent of wildflowers as a few petals swirl around you. A butterfly flits through the windowsill and lands on her fingertips as she returns to you.* \"My power wards this haven, shields it from darkness and heals those in need. I can mend wounds, soothe restless minds and provide comfort to weary souls.\" *Her eyes sparkle with warmth and compassion as she looks upon you, and she guides the butterfly to you.*", + "constant": false, + "selective": false, + "order": 100, + "position": 0, + "disable": false + } + } +} diff --git a/simple-gemini-proxy/.env.example b/simple-gemini-proxy/.env.example deleted file mode 100644 index b7a1a4f..0000000 --- a/simple-gemini-proxy/.env.example +++ /dev/null @@ -1,8 +0,0 @@ -# Gemini API Key - 从 https://ai.google.dev 获取 -GEMINI_API_KEY=your_gemini_api_key_here - -# 可选配置 -DISABLE_MODEL_MAPPING=0 -GPT_4=gemini-1.5-pro-latest -GPT_3_5_TURBO=gemini-1.5-flash-latest -GPT_4_VISION_PREVIEW=gemini-1.5-flash-latest \ No newline at end of file diff --git a/simple-gemini-proxy/PROJECT_SUMMARY.md b/simple-gemini-proxy/PROJECT_SUMMARY.md deleted file mode 100644 index a1da012..0000000 --- a/simple-gemini-proxy/PROJECT_SUMMARY.md +++ /dev/null @@ -1,93 +0,0 @@ -# 简单Gemini代理项目总结 - -## 🎯 项目目标完成情况 - -✅ **不需要数据库** - 完全无状态服务,无需任何数据库设置 -✅ **配置极其简单** - 只需要Gemini API密钥即可使用 -✅ **支持Docker部署** - 一键启动,使用官方Docker镜像 -✅ **能够立即工作** - 无需复杂配置,开箱即用 - -## 📁 项目结构 - -``` -/home/will/docker/simple-gemini-proxy/ -├── docker-compose.yml # Docker编排文件 -├── README.md # 详细说明文档 -├── QUICKSTART.md # 快速开始指南 -├── .env.example # 环境变量示例 -├── simple-test.sh # 简单测试脚本 -├── test-api.sh # 完整API测试脚本 -├── check-status.sh # 服务状态检查脚本 -└── PROJECT_SUMMARY.md # 项目总结(本文件) -``` - -## 🚀 使用方法 - -### 1. 启动服务 -```bash -cd /home/will/docker/simple-gemini-proxy -docker compose up -d -``` - -### 2. 测试服务 -```bash -# 使用你的Gemini API密钥 -./simple-test.sh YOUR_GEMINI_API_KEY -``` - -### 3. 检查状态 -```bash -./check-status.sh -``` - -## 🔧 技术实现 - -- **基础镜像**: `zhu327/gemini-openai-proxy:latest` -- **服务端口**: 8081 (映射到容器内部8080) -- **API兼容性**: 完全兼容OpenAI API格式 -- **模型映射**: 自动将GPT模型映射到Gemini模型 - -## 📋 支持的功能 - -- ✅ OpenAI ChatCompletion API格式 -- ✅ 流式响应支持 -- ✅ 多种模型映射 -- ✅ 自动重启机制 -- ✅ 健康检查 - -## 🔑 模型映射 - -| OpenAI模型 | Gemini模型 | -|------------|------------| -| gpt-3.5-turbo | gemini-1.5-flash-latest | -| gpt-4 | gemini-1.5-pro-latest | -| gpt-4-vision-preview | gemini-1.5-flash-latest | - -## 💡 使用场景 - -这个代理特别适合: - -1. **现有OpenAI应用迁移** - 无需修改代码,直接切换到Gemini -2. **开发测试** - 快速搭建测试环境 -3. **API统一** - 为不同的AI服务提供统一接口 -4. **成本优化** - 使用免费的Gemini API替代付费的OpenAI API - -## 🎉 项目优势 - -1. **极简部署** - 一个命令启动整个服务 -2. **零配置** - 除了API密钥外无需任何配置 -3. **即插即用** - 立即可以接受OpenAI格式的请求 -4. **生产就绪** - 包含健康检查和自动重启 -5. **完整文档** - 提供详细的使用说明和测试脚本 - -## 🔗 相关链接 - -- **获取API密钥**: https://ai.google.dev -- **原项目地址**: https://github.com/zhu327/gemini-openai-proxy -- **Docker Hub**: https://hub.docker.com/r/zhu327/gemini-openai-proxy - -## ✨ 部署成功! - -项目已成功部署在 `/home/will/docker/simple-gemini-proxy/`,服务运行在 `http://localhost:8081`。 - -只需要一个Gemini API密钥,就可以立即开始使用! \ No newline at end of file diff --git a/simple-gemini-proxy/QUICKSTART.md b/simple-gemini-proxy/QUICKSTART.md deleted file mode 100644 index e027efc..0000000 --- a/simple-gemini-proxy/QUICKSTART.md +++ /dev/null @@ -1,66 +0,0 @@ -# 快速开始指南 - -## 1分钟快速部署 - -### 第一步:获取API密钥 -访问 [Google AI Studio](https://ai.google.dev) 并创建免费的Gemini API密钥 - -### 第二步:启动服务 -```bash -cd /home/will/docker/simple-gemini-proxy -docker compose up -d -``` - -### 第三步:测试服务 -用你的API密钥替换 `YOUR_API_KEY` 后运行: - -```bash -# 基本测试 -curl http://localhost:8081/v1/chat/completions \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer YOUR_API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "Hello!"}] - }' -``` - -### 使用我们的测试脚本 -```bash -./test-api.sh YOUR_API_KEY -``` - -## 服务信息 - -- **服务地址**: http://localhost:8081 -- **OpenAI API兼容端点**: http://localhost:8081/v1/chat/completions -- **容器名称**: simple-gemini-proxy -- **镜像**: zhu327/gemini-openai-proxy:latest - -## 常用命令 - -```bash -# 查看服务状态 -docker compose ps - -# 查看日志 -docker compose logs -f - -# 停止服务 -docker compose down - -# 重启服务 -docker compose restart -``` - -## 支持的模型映射 - -| OpenAI模型 | Gemini模型 | -|------------|------------| -| gpt-3.5-turbo | gemini-1.5-flash-latest | -| gpt-4 | gemini-1.5-pro-latest | -| gpt-4-vision-preview | gemini-1.5-flash-latest | - -## 就这么简单! - -这个代理现在可以接受任何OpenAI API格式的请求,并将其转发给Google Gemini API。无需数据库,无需复杂配置,完全即插即用! \ No newline at end of file diff --git a/simple-gemini-proxy/README.md b/simple-gemini-proxy/README.md deleted file mode 100644 index fab5103..0000000 --- a/simple-gemini-proxy/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# Simple Gemini to OpenAI API Proxy - -这是一个极其简单的Gemini到OpenAI API格式的代理服务,基于 `zhu327/gemini-openai-proxy` 项目。 - -## 特点 - -- ✅ 无需数据库 -- ✅ 配置极其简单,只需要API密钥 -- ✅ 支持Docker部署 -- ✅ 立即可用,无需复杂配置 -- ✅ 支持OpenAI API格式调用Gemini模型 - -## 快速开始 - -### 1. 获取Gemini API密钥 - -访问 [Google AI Studio](https://ai.google.dev) 获取免费的Gemini API密钥。 - -### 2. 启动服务 - -```bash -# 启动代理服务 -docker-compose up -d - -# 查看日志 -docker-compose logs -f -``` - -### 3. 测试服务 - -```bash -# 使用你的Gemini API密钥替换 YOUR_GEMINI_API_KEY -curl http://localhost:8081/v1/chat/completions \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer YOUR_GEMINI_API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "你好!"}], - "temperature": 0.7 - }' -``` - -## 使用说明 - -### API端点 - -- **基础URL**: `http://localhost:8081` -- **聊天完成**: `POST /v1/chat/completions` - -### 模型映射 - -默认的模型映射: -- `gpt-3.5-turbo` → `gemini-1.5-flash-latest` -- `gpt-4` → `gemini-1.5-pro-latest` -- `gpt-4-vision-preview` → `gemini-1.5-flash-latest` - -### 环境变量配置 - -在 `docker-compose.yml` 中可以配置: - -- `DISABLE_MODEL_MAPPING=1`: 禁用模型映射,直接使用Gemini模型名称 -- `GPT_4=gemini-1.5-pro-latest`: 自定义模型映射 - -## 与各种客户端集成 - -### 使用curl - -```bash -curl http://localhost:8081/v1/chat/completions \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer YOUR_GEMINI_API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "Hello!"}] - }' -``` - -### 使用Python OpenAI库 - -```python -import openai - -client = openai.OpenAI( - api_key="YOUR_GEMINI_API_KEY", - base_url="http://localhost:8081/v1" -) - -response = client.chat.completions.create( - model="gpt-3.5-turbo", - messages=[{"role": "user", "content": "Hello!"}] -) - -print(response.choices[0].message.content) -``` - -## 管理命令 - -```bash -# 启动服务 -docker-compose up -d - -# 停止服务 -docker-compose down - -# 重启服务 -docker-compose restart - -# 查看状态 -docker-compose ps - -# 查看日志 -docker-compose logs -f gemini-proxy -``` - -## 注意事项 - -1. **API密钥安全**: 请确保妥善保管你的Gemini API密钥 -2. **网络访问**: 默认绑定到8081端口,如需外部访问请配置防火墙 -3. **速率限制**: 遵循Google Gemini API的速率限制 -4. **生产环境**: 如用于生产环境,建议添加认证和HTTPS - -## 故障排除 - -### 容器无法启动 -```bash -# 检查端口是否被占用 -sudo netstat -tlnp | grep 8081 - -# 查看详细错误日志 -docker-compose logs gemini-proxy -``` - -### API调用失败 -1. 检查API密钥是否正确 -2. 确认网络连接正常 -3. 检查请求格式是否符合OpenAI API规范 - -## 项目信息 - -- **基于项目**: [zhu327/gemini-openai-proxy](https://github.com/zhu327/gemini-openai-proxy) -- **Docker镜像**: `zhu327/gemini-openai-proxy:latest` -- **支持的模型**: Gemini 1.5 Pro, Gemini 1.5 Flash \ No newline at end of file diff --git a/simple-gemini-proxy/check-status.sh b/simple-gemini-proxy/check-status.sh deleted file mode 100755 index ca3a7ce..0000000 --- a/simple-gemini-proxy/check-status.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -echo "🔍 检查Gemini代理服务状态..." -echo "" - -# 检查Docker是否运行 -if ! docker info > /dev/null 2>&1; then - echo "❌ Docker服务未运行" - exit 1 -fi - -# 检查容器状态 -echo "📦 Docker容器状态:" -docker compose ps - -echo "" - -# 检查端口 -echo "🌐 端口占用情况:" -if netstat -tln | grep -q ":8081"; then - echo "✅ 端口8081正在监听" -else - echo "❌ 端口8081未监听" -fi - -echo "" - -# 检查服务响应 -echo "🔗 服务连通性测试:" -if curl -s --max-time 5 http://localhost:8081/ > /dev/null; then - echo "✅ 服务正常响应" - - # 获取服务响应 - response=$(curl -s http://localhost:8081/) - echo "📋 服务响应: $response" -else - echo "❌ 服务无响应" -fi - -echo "" - -# 显示服务日志的最后几行 -echo "📝 最近的服务日志:" -docker compose logs --tail=5 gemini-proxy - -echo "" -echo "🎯 使用说明:" -echo "1. 获取Gemini API密钥: https://ai.google.dev" -echo "2. 运行测试: ./simple-test.sh YOUR_API_KEY" -echo "3. 服务地址: http://localhost:8081" -echo "4. API端点: http://localhost:8081/v1/chat/completions" \ No newline at end of file diff --git a/simple-gemini-proxy/docker-compose.yml b/simple-gemini-proxy/docker-compose.yml deleted file mode 100644 index 305f164..0000000 --- a/simple-gemini-proxy/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: '3.8' - -services: - gemini-proxy: - image: googlegemini/proxy-to-gemini:latest - container_name: simple-gemini-proxy - ports: - - "8002:5555" - environment: - - GEMINI_API_KEY=${GEMINI_API_KEY} - restart: unless-stopped - networks: - - caddy_caddy-network - - default - -networks: - caddy_caddy-network: - external: true \ No newline at end of file diff --git a/simple-gemini-proxy/simple-test.sh b/simple-gemini-proxy/simple-test.sh deleted file mode 100755 index df662c6..0000000 --- a/simple-gemini-proxy/simple-test.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -# 最简单的测试脚本 -# 使用方法: ./simple-test.sh YOUR_GEMINI_API_KEY - -if [ -z "$1" ]; then - echo "❌ 错误: 需要提供Gemini API密钥" - echo "使用方法: $0 YOUR_GEMINI_API_KEY" - echo "" - echo "获取API密钥: https://ai.google.dev" - exit 1 -fi - -API_KEY=$1 -echo "🚀 测试简单Gemini代理..." -echo "📍 服务地址: http://localhost:8081" -echo "🔑 API Key: ${API_KEY:0:8}..." -echo "" - -# 简单聊天测试 -echo "💬 发送测试消息..." -response=$(curl -s http://localhost:8081/v1/chat/completions \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "你好!请简单回复。"}], - "max_tokens": 50 - }') - -echo "📥 服务器响应:" -echo "$response" -echo "" - -# 检查响应是否包含choices -if echo "$response" | grep -q '"choices"'; then - echo "✅ 测试成功!代理服务正常工作。" -else - echo "❌ 测试失败!可能的原因:" - echo " - API密钥无效" - echo " - 网络连接问题" - echo " - 服务未正常启动" -fi - -echo "" -echo "🔧 服务管理命令:" -echo " docker compose ps # 查看状态" -echo " docker compose logs -f # 查看日志" -echo " docker compose restart # 重启服务" \ No newline at end of file diff --git a/simple-gemini-proxy/test-api.sh b/simple-gemini-proxy/test-api.sh deleted file mode 100755 index df46070..0000000 --- a/simple-gemini-proxy/test-api.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# 简单的API测试脚本 -# 使用方法: ./test-api.sh YOUR_GEMINI_API_KEY - -if [ -z "$1" ]; then - echo "使用方法: $0 YOUR_GEMINI_API_KEY" - echo "示例: $0 AIzaSyDxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - exit 1 -fi - -API_KEY=$1 -BASE_URL="http://localhost:8081" - -echo "Testing Gemini OpenAI Proxy..." -echo "API Key: ${API_KEY:0:10}..." -echo "Base URL: $BASE_URL" -echo - -# 测试基本聊天完成 -echo "=== 测试基本聊天完成 ===" -curl -s "$BASE_URL/v1/chat/completions" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "你好!请用中文回复。"}], - "temperature": 0.7, - "max_tokens": 150 - }' | jq '.' - -echo -e "\n" - -# 测试GPT-4模型 -echo "=== 测试GPT-4模型 ===" -curl -s "$BASE_URL/v1/chat/completions" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $API_KEY" \ - -d '{ - "model": "gpt-4", - "messages": [{"role": "user", "content": "解释一下量子计算的基本原理"}], - "temperature": 0.3, - "max_tokens": 200 - }' | jq '.' - -echo -e "\n" - -# 测试流式响应 -echo "=== 测试流式响应 ===" -curl -s "$BASE_URL/v1/chat/completions" \ - -H "Content-Type: application/json" \ - -H "Authorization: Bearer $API_KEY" \ - -d '{ - "model": "gpt-3.5-turbo", - "messages": [{"role": "user", "content": "数数从1到10"}], - "stream": true, - "temperature": 0.1 - }' - -echo -e "\n\n=== 测试完成 ===" \ No newline at end of file