Files
fj/deploy.sh
T
selfreleaseandDevin 198ee1c911 feat: 循环播放、单音频拼接播放、程序合成晨钟暮鼓配乐
- 播放改为全文拼接成单个 WAV:段间 0.8s/尾部 3s 静音写入文件,
  audio.loop 原生循环,解决手机锁屏/后台时定时器冻结导致的中断
- 新增"循环"开关与"配乐"开关
- 背景音乐 Web Audio 实时合成:低频 drone 垫底(相邻根音慢滑),
  晨钟(大钟非谐泛音簇)+ 暮鼓(膜鸣+击边噪声)+ 引磬稀疏点缀
- deploy.sh 一键部署(rsync + 重启 + 健康检查,不同步 .env)
- 新增页签图标与桌面 logo

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-29 09:28:55 +08:00

37 lines
1.3 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 icon.svg icon-180.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 "部署完成"