Files
havline-native/README.md
T

73 lines
1.6 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.
# Havline Native fnOS 应用
本目录保存 Havline 的飞牛 Native 应用工程,不依赖 Docker。
本仓库完全独立,包含:
- `app-src/`:Havline 主程序源码副本
- `havline/`:飞牛 Native 应用打包工程
- `fnpack.exe`:飞牛打包工具
- `build.ps1`:从 `app-src` 构建双架构二进制并打包
构建过程不再引用 `F:\Fonu-main\havline`。
阶段二范围:
- Go 主程序原生运行
- 统一网关 `/app/havline`
- Unix Socket `app.sock`
- `cmd/main` 启动、停止和状态检查
- amd64 与 arm64 双架构二进制
- Nginx amd64 与 arm64 双架构二进制
- Nginx 依赖库与 `mime.types`
- HTTP 18080 与 HTTPS 9443
当前不包含:
- frpc
- cloudflared
这些依赖将在后续阶段加入。
## 构建前置条件
构建脚本需要本地存在用于提取 Nginx 的 Havline 镜像:
```text
jayhub.top/mrlee/havline:1.9.0 amd64
havline:1.9.0 arm64
```
如果本地没有对应架构镜像,先加载 amd64 与 arm64 镜像归档。
## 构建
```powershell
cd F:\Fonu-main\fnos-native
.\build.ps1
```
输出:
```text
dist/havline-native-1.9.0.fpk
```
构建脚本会:
1. 使用 `VITE_BASE_PATH=/app/havline/` 构建前端;
2. 从本地镜像提取 amd64 与 arm64 Nginx 及依赖库;
3. 交叉编译 amd64 与 arm64 Go 二进制;
4. 调用 `fnpack build` 打包。
## 真机注意
当前 Nginx 来自 Debian 12,依赖目标系统 glibc。飞牛设备建议满足:
```text
glibc >= 2.36
```
如果目标设备 glibc 版本较低,需要改为静态编译 Nginx 或打包完整
loader 与 libc。