补充说明
本教程介绍 fan-reubah 从源码编译、发布 GitHub Release 到目标服务器一键安装、卸载的完整流程,适用于个人项目自建发布链路。
项目:fan-reubah|通用文件转换与图像处理 仓库:https://github.com/meimolihan/fan-reubah
安装与卸载
安装 / 升级
bash -c "$(curl -sSL https://raw.githubusercontent.com/meimolihan/fan-reubah/main/scripts/install.sh)"
- 静默安装 / 升级(指定端口与应用目录)
bash -c "$(curl -sSL https://raw.githubusercontent.com/meimolihan/fan-reubah/main/scripts/install.sh)" -p 8081 -d /var/lib/fan-reubah -y
- 未指定
-b且本地无构建产物时,脚本自动从 GitHub Release 下载对应架构的自包含单文件二进制(fan-reubah_linux_amd64/fan-reubah_linux_arm64,已内嵌前端页面与 vtracer SVG 引擎);也可用-b <路径>指定本地编译好的二进制。
卸载命令
bash scripts/uninstall.sh -y --purge
- 远程一键卸载
bash -c "$(curl -sSL https://raw.githubusercontent.com/meimolihan/fan-reubah/main/scripts/uninstall.sh)" -y --purge
脚本命令
| 命令 | 说明 |
|---|---|
bash scripts/install.sh [-p PORT] [-a APP_DIR] [-b BIN] [-y] |
安装 / 升级为 systemd 服务 |
bash scripts/uninstall.sh [-y] [--purge|--keep-appdir] [-q] |
卸载 fan-reubah |
bash scripts/build-and-push.sh v1.0.0 --yes |
升版 + 打 tag + 推送 + 触发 CI 构建并创建 Release |
bash scripts/prepare-embed.sh |
生成 go:embed 内嵌资源(前端 + vtracer 引擎,本地构建用) |
/usr/local/bin/fan-reubah -version |
显示版本信息 |
日常管理命令
| 操作 | 命令 |
|---|---|
| 启动 | systemctl start fan-reubah |
| 关闭 | systemctl stop fan-reubah |
| 重启 | systemctl restart fan-reubah |
| 状态 | systemctl status fan-reubah |
| 查看实时日志 | journalctl -u fan-reubah -f |
| 查看最近 30 行日志 | journalctl -u fan-reubah -n 30 --no-pager |
| 关闭开机自启 | systemctl disable fan-reubah |
| 端口放行 | firewall-cmd --permanent --add-port=8081/tcp && firewall-cmd --reload(firewalld) |
应用目录说明
- 默认应用部署目录:
/var/lib/fan-reubah(二进制已内嵌前端与 vtracer 引擎,应用目录仅作工作目录,无需拷贝前端资源) - 二进制位置:
/usr/local/bin/fan-reubah - 安装记录:
/etc/fan-reubah.conf - 运行环境变量:systemd 单元写入
Environment=PORT=<端口>、TZ=Asia/Shanghai,端口由 install.sh 的-p指定(默认 8081) - 启动成功日志格式:
Listening on [::]:端口(systemctl status与journalctl均可见)