Files
fj/deploy.sh
T
selfreleaseandDevin bc0bfd9263 feat: 新增5部经典下拉选经、TTS重试、PWA可安装
- 新增阿弥陀经/普门品/道德经/清静经/太上感应篇(维基文库底本,OpenCC转简体)
- 经典切换改为下拉框(佛/道分组),移动端复用底部面板并显示分组标题
- TTS 请求失败自动重试3次;普门品偈颂拆分修复600字上限问题
- 服务端缓存原子写(.tmp+rename),上限放宽至800字
- PWA:manifest + Service Worker,安装后无地址栏独立窗口
- 偏好记忆/逐字光标/回到诵读处/夜间模式等此前改动一并入库

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-04 15:47:18 +08:00

37 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 部署佛经诵读站到 fj.all8ai.top(154.8.162.18:/opt/fj/)
#
# 用法:
# ./deploy.sh # 已配置 SSH key 时直接用
# FJ_PASS=xxx ./deploy.sh # 密码登录(需本机装 sshpass)
#
# 注意:不要在脚本里写死密码;密码走 FJ_PASS 环境变量。
set -euo pipefail
cd "$(dirname "$0")"
HOST=154.8.162.18
USER=root
DEST=/opt/fj
# 注意:不同步 .env —— 服务器端 PORT=8018 与本地开发配置不同,避免覆盖。
FILES=(index.html style.css app.js server.py sw.js manifest.json icon.svg icon-180.png icon-192.png icon-512.png README.md run.md)
SSH_OPTS="-o StrictHostKeyChecking=no -o ConnectTimeout=15"
SSH_CMD="ssh $SSH_OPTS"
if [ -n "${FJ_PASS:-}" ]; then
command -v sshpass >/dev/null || { echo "缺少 sshpass:brew install sshpass 或改用 SSH key"; exit 1; }
SSH_CMD="sshpass -p $FJ_PASS ssh $SSH_OPTS"
fi
echo "==> 同步文件到 $USER@$HOST:$DEST/"
rsync -az --timeout=30 -e "$SSH_CMD" "${FILES[@]}" "$USER@$HOST:$DEST/"
echo "==> 重启 fj.service"
$SSH_CMD "$USER@$HOST" 'systemctl restart fj.service && sleep 1 && systemctl is-active fj.service'
echo "==> 健康检查"
code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 15 https://fj.all8ai.top/)
echo "https://fj.all8ai.top/ -> $code"
[ "$code" = "200" ] || { echo "健康检查未通过"; exit 1; }
echo "部署完成"