26.9:品牌统一(fileshare)+ 版本号改为日期式
- 数据库默认文件 filecodebox.db → fileshare.db(config.go 默认值与全部文档/编排同步)
- Go module filecodebox → fileshare(全部 import 同步,build/vet/test 全绿)
- 应用版本 APP_VERSION 2.5.6 → 26.9(health 接口已验证返回 26.9)
- deploy 编排统一:compose 项目名、Postgres 默认凭据、minio 桶名、env 注释
- JWT issuer、存储临时目录前缀、web 包名同步 fileshare
- CI:镜像 tag 以 APP_VERSION 为唯一版本源,main/tag 推送即发布
${VER} + latest;tag 触发时校验 tag 名与 APP_VERSION 一致,防错版
- 本地开发库文件已改名 fileshare.db(含 -shm/-wal 清理)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
文件快传
|
||||
|
||||
数据库**默认 SQLite 零依赖**(modernc.org/sqlite 纯 Go 驱动,数据文件 `./data/filecodebox.db`),
|
||||
数据库**默认 SQLite 零依赖**(modernc.org/sqlite 纯 Go 驱动,数据文件 `./data/fileshare.db`),
|
||||
可选切换 Postgres(`FCB_DB_DRIVER=postgres` + DSN);Redis 为**可选**增强(未配置时自动降级为进程内存缓存)。
|
||||
存储引擎支持 **本地 / S3 / WebDAV**(运行时热切换,健康检查通过才生效;WebDAV 重点优化:流式、Range、重试、连接复用)。
|
||||
|
||||
@@ -37,7 +37,7 @@ docker compose up -d --build
|
||||
```
|
||||
|
||||
- **数据库双路径**:默认 SQLite 零依赖——`docker compose up -d --build` 即可(无需 postgres profile,
|
||||
数据落 `serverdata` 卷 `/app/data/filecodebox.db`);Postgres 模式——`.env` 设
|
||||
数据落 `serverdata` 卷 `/app/data/fileshare.db`);Postgres 模式——`.env` 设
|
||||
`FCB_DB_DRIVER=postgres` 与 `FCB_DB_DSN` 后 `docker compose --profile postgres up -d --build`。
|
||||
- Redis 可选:`--profile redis` 并在 `.env` 设 `FCB_REDIS_ADDR=redis:6379`;未配置时自动降级为内存缓存。
|
||||
- 存储引擎切换:`.env` 改 `FCB_STORAGE_ENGINE=s3|webdav` 并带对应 profile 启动:
|
||||
@@ -51,7 +51,7 @@ docker compose up -d --build
|
||||
```bash
|
||||
# 1) 后端(:8466)——默认 SQLite 零依赖,无需任何数据库
|
||||
cd server
|
||||
go run ./cmd/server # 数据落 ./data/filecodebox.db;go test ./... 运行单测
|
||||
go run ./cmd/server # 数据落 ./data/fileshare.db;go test ./... 运行单测
|
||||
|
||||
# 2) 后端 Postgres 模式(可选)
|
||||
docker run -d --name fcb-pg -p 5432:5432 \
|
||||
@@ -89,7 +89,7 @@ npm run build # 产出 web/dist/,构建时按 deploy/Dockerfil
|
||||
| 变量 | 必需 | 默认 | 说明 |
|
||||
|---|---|---|---|
|
||||
| `FCB_DB_DRIVER` | ❌ | `sqlite` | 数据库驱动:`sqlite` \| `postgres`(v2 需求 ⑧) |
|
||||
| `FCB_DB_DSN` | 视驱动 | - | postgres:连接串(**必需**);sqlite:文件路径(可空,默认 `./data/filecodebox.db`) |
|
||||
| `FCB_DB_DSN` | 视驱动 | - | postgres:连接串(**必需**);sqlite:文件路径(可空,默认 `./data/fileshare.db`) |
|
||||
| `FCB_REDIS_ADDR` | ❌ | 空 | 为空时缓存降级为内存实现;支持 `redis://[:password@]host:port[/db]` / `rediss://` URL 形式 |
|
||||
| `FCB_REDIS_DB` | ❌ | `0` | Redis 逻辑库号 0-15(URL 显式 `/N` 时以 URL 为准) |
|
||||
| `FCB_LISTEN` | ❌ | `:8466` | 监听地址 |
|
||||
|
||||
Reference in New Issue
Block a user