-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-api-key.sh
More file actions
executable file
·39 lines (32 loc) · 1.21 KB
/
Copy pathsetup-api-key.sh
File metadata and controls
executable file
·39 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# 快速配置 API Key 脚本
echo "🔑 配置 right.codes API Key"
echo "================================"
echo ""
echo "这个脚本将帮助你配置 Cloudflare Worker 的 API Key。"
echo ""
echo "请确保你已经有 right.codes 的 API Key。"
echo "如果没有,请访问:https://right.codes 获取"
echo ""
# 检查是否已输入 API Key
if [ -z "$RIGHT_CODES_API_KEY" ]; then
echo "请输入你的 right.codes API Key:"
read -s API_KEY
export RIGHT_CODES_API_KEY="$API_KEY"
fi
# 设置 Cloudflare API Token
export CLOUDFLARE_API_TOKEN="L9j0jM6Qv8knfqjQrD2gTgE3rhbkVm7MSSoCiofO"
echo ""
echo "正在配置密钥到 Cloudflare Worker..."
# 使用 wrangler 设置密钥
echo "$RIGHT_CODES_API_KEY" | wrangler secret put RIGHT_CODES_API_KEY --api-token "$CLOUDFLARE_API_TOKEN"
echo ""
echo "✅ 配置完成!"
echo ""
echo "现在你可以访问应用:"
echo "🌐 https://video-script-gen.asryandf777.workers.dev"
echo ""
echo "测试 API:"
echo "curl -X POST https://video-script-gen.asryandf777.workers.dev/api/generate \\"
echo " -H 'Content-Type: application/json' \\"
echo " -d '{\"industry\":\"beauty\",\"topic\":\"春季底妆\",\"style\":\"专业\",\"duration\":\"medium\"}'"