Files
honoka-chan/doc/3.md
T
2026-06-01 21:48:41 +08:00

46 lines
2.2 KiB
Markdown
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.
## 其三:服务端部署
### 主程序部署
首先确认已经安装了 Go 环境以及 Git 工具,然后 `git clone https://github.com/YumeMichi/honoka-chan` 到你需要托管的服务器或者本地。
进入 `honoka-chan` 文件夹,执行 `go build` 编译,会自动下载依赖。
编译完成运行 `honoka-chan.exe` 即可,Linux 上可执行文件为 `honoka-chan`
如果你在 Linux 上希望常驻运行并方便管理进程,可以直接使用项目根目录下的 `run.sh`
```bash
./run.sh start
./run.sh stop
./run.sh restart
./run.sh status
./run.sh logs
```
说明:
- `start` 会自动执行 `go build -o honoka-chan main.go`,然后以 `nohup` 后台运行。
- PID 文件:`temp/run/honoka-chan.pid`
- 日志文件:`temp/run/honoka-chan.log`
### 下载服务部署
#### SIF 数据下载服务
下载 [一:文件准备](./1.md) 篇中的 SIF 全量数据,解压出 `list_CN_iOS``list_CN_Android` 两个文件夹。
在本程序目录下的 `static` 目录下新建 `Android``iOS` 两个文件夹,然后将上面解压的两个文件夹按照对应系统移动到新建的这两个文件夹里,并将 `list_CN_iOS``list_CN_Android` 都改名为 `archives`。最后目录结构为 `static\iOS\archives``static\Android\archives`
如果只需要其中一个系统的数据包比如你不用苹果设备,可以删掉不用的。
由于数据包中也包含了盛趣服务器地址,所以为了不再次修改游戏配置文件,可以通过添加一个数据包,其中包含了修改过的服务器地址,并使其最后一个下载,这样会覆盖盛趣的服务器地址。
这里以 iOS 为例,进入 `static\iOS\archives`,可以发现 `99` 的数据包最后一个为 `99_0_114.zip`。复制 `99_0_113.zip``99_0_115.zip`,打开压缩包,删除没用 `client_info.json`,然后将 `server_info.json` 解压出来。
按照 [二:客户端修改](./2.md) 中同样的方法解密文件、修改地址、重新加密后替换压缩包内的文件即可。
Android 也是同样的操作。
如果要将数据下载服务托管到云服务器,将 `static\Android``static\iOS` 这两个目录都上传到云服务器,然后自行建个 http 服务器即可,这里就不赘述了。