Files
ufile/README.md
T

36 lines
1.1 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.
# ufile
一个单二进制运行的轻量文件快传服务。支持多用户和三级权限、限时保存、限次访问、6 位取件码,以及无需登录的下载和预览链接。
## 构建
需要 Go 1.24+ 与 Node.js 20+:
```bash
./build.sh
```
也可以运行 `make build`。构建脚本会先安装并编译前端,再通过 `go:embed` 将产物写入最终的 `ufile` 二进制;SQLite 使用纯 Go 驱动,不依赖 CGO。
## 运行
```bash
./ufile --data ./data --address 0.0.0.0:6616
```
参数:
- `--data`:文件目录,默认 `./data`
- `--db`:SQLite 文件路径;留空时为 `<data>/data.db`
- `--address`:监听地址,默认 `0.0.0.0:6616`
首次使用空数据库启动时,终端会输出 `admin` 的随机密码。该账号第一次登录后必须立即修改密码。
## 分享链接
- 下载:`/uf/<file_hash>`
- 预览:`/uf/<file_hash>?preview=true`
- 有取件码时追加:`code=<6位取件码>`
预览也会消耗一次访问次数。文件过期、访问次数耗尽或所属用户被删除时,数据库记录和磁盘文件都会被清理。