chore: add .env.example template and clean up deploy messages
Introduce a tracked .env.example file documenting all required environment variables (app env, API/WebSocket base URLs, timeouts, Google/Facebook OAuth credentials, Cloudflare CDN zone/token). Update .gitignore to allow this file despite the blanket .env* ignore rule. Also simplify the push success/failure output in scripts/deploy/_deploy_lib.sh by removing verbose troubleshooting hints.
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
# 当前环境: development | test | production
|
||||||
|
NEXT_PUBLIC_APP_ENV=development
|
||||||
|
|
||||||
|
# 后端 API 基础 URL(按环境区分)
|
||||||
|
# development: http://172.16.48.49:3002
|
||||||
|
# test: https://api.cozsweet.com
|
||||||
|
# production: https://api.cozsweet.com
|
||||||
|
NEXT_PUBLIC_API_BASE_URL=http://172.16.48.49:3002
|
||||||
|
|
||||||
|
# WebSocket URL(按环境区分,可选)
|
||||||
|
# development: ws://172.16.48.49:3002
|
||||||
|
# test: wss://api.cozsweet.com
|
||||||
|
# production: wss://api.cozsweet.com
|
||||||
|
NEXT_PUBLIC_WS_BASE_URL=ws://172.16.48.49:3002
|
||||||
|
|
||||||
|
# API 超时时间(毫秒)
|
||||||
|
NEXT_PUBLIC_API_CONNECT_TIMEOUT=30000
|
||||||
|
NEXT_PUBLIC_API_RECEIVE_TIMEOUT=60000
|
||||||
|
NEXT_PUBLIC_API_SEND_TIMEOUT=30000
|
||||||
|
|
||||||
|
# Google OAuth 2.0 Client ID / Secret (Google Cloud Console → APIs & Services → Credentials)
|
||||||
|
AUTH_GOOGLE_ID=
|
||||||
|
AUTH_GOOGLE_SECRET=
|
||||||
|
|
||||||
|
# Facebook App ID / Secret (Facebook Developers → 应用设置 → 基础)
|
||||||
|
AUTH_FACEBOOK_ID=
|
||||||
|
AUTH_FACEBOOK_SECRET=
|
||||||
|
|
||||||
|
# Cloudflare CDN(test / production 部署后刷缓存用,scripts/deploy/_deploy_lib.sh 的 purge_cdn_cache 读这里)
|
||||||
|
CF_ZONE_ID=
|
||||||
|
CF_API_TOKEN=
|
||||||
@@ -32,6 +32,7 @@ yarn-error.log*
|
|||||||
|
|
||||||
# env files (can opt-in for committing if needed)
|
# env files (can opt-in for committing if needed)
|
||||||
.env*
|
.env*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
# deploy archives (scripts/deploy/_deploy_lib.sh 的 archive() 生成)
|
# deploy archives (scripts/deploy/_deploy_lib.sh 的 archive() 生成)
|
||||||
archives/
|
archives/
|
||||||
|
|||||||
@@ -34,13 +34,11 @@ push_to_server() {
|
|||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "推送成功!服务器端 post-receive hook 应已自动执行"
|
echo "推送成功!"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
else
|
else
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "推送失败!常见原因:"
|
echo "推送失败!"
|
||||||
echo " 1. 本地分支与远端非 fast-forward(git pull --rebase 后再试)"
|
|
||||||
echo " 2. 服务器端 hook 报错(看 git push 输出)"
|
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user