v2.0.02026-10-24
Breaking Changes
- Raft is removed. Clustering, metadata, locks and node messaging now run on an embedded NATS server that works standalone or as a cluster. Configs with metadata_store.type: raft or dlm.type: raft are rejected at startup.
- The callfs cluster join and callfs cluster remove commands and the /internal/raft/* endpoints are gone.
- The Go module path is now github.com/ebogdum/callfs/v2.
- File and folder mode bits now control access for other users (read and write bits); new folders default to 0777, files to 0644. Owners and admins are not affected.
- /health returns only {status}; /health/ready reports only this node, with peers listed for information.
- The callfsraft metrics are removed; callfsnats metrics are added.
New Features
- Web console for files, sharing, users, cluster nodes, health findings, activity and settings, with control of every node from one place.
- performance.mode (fast or strict). Both acknowledge a write only once it is durable; strict also reads back each saved file, locks every change and makes reads wait for the latest cluster state.
- Fast overwrites on local disk (temp save) with a crash-safe restore at start. backend.localfstrueoverwrite and backend.localfstmpsavemaxsize choose the older true overwrite, the X-CallFS-True-Overwrite header picks it per request, and callfsoverwriterestores_total counts restores.
- Write acknowledgement levels (backend.localfs_ack, X-CallFS-Write-Ack) and a group-commit flusher with configurable workers, memory budget and delay.
- Admin API, trash, resumable uploads, search, stat and batch endpoints.
- Lock waits with owner tokens and lease renewal, bounded by dlm.wait_timeout.
- Conditional requests: ETag on GET, HEAD, PUT and POST responses; If-Match and If-None-Match: * on PUT and POST (412 Precondition Failed).
- Range GET (206 Partial Content, Content-Range, 416 Range Not Satisfiable).
- GET /v1/objects with prefix and cursor paging, and DELETE /v1/objects?prefix= for bulk delete.
- DELETE /v1/files/<dir>?recursive=true removes a directory tree.
- Configurable rate limits (server.ratelimit) and metadata cache TTL (server.metadatacache_ttl).
- Docker image ships a health check and runs as a non-root user.
- NATS clustering options: TLS on routes and clients with a private CA, nkey and creds auth, rolling secret changes (nats.auth.previous_secret), external NATS servers, monitoring endpoint, server tags and unique-tag placement.
- The file index log is snapshotted and compacted (nats.metadata.snapshot, retain); nodes restore from the newest snapshot at start.
- Cluster console pages: Members (add member with a generated config, remove offline members), Replication (log, copies, snapshots, move leader), Servers with disk free.
- Node presence with leader/follower/offline roles; background jobs that must run once per cluster hold a lease and "Run now" is forwarded.
- Background copies are durable tasks with retries and a failed-tasks list that admins can retry or drop (/v1/admin/tasks/dead).
- Fair lock queue (nats.locks.queuestale), cluster-wide rate limits (nats.counters), node-to-node file transfer over NATS (nats.bytes: chunked), cluster-wide log view (nats.streams.logslevel).
- Automatic erasure coding by size (erasure.minfilesize) and a configurable pieces folder (erasure.shard_path).
- backend.internalproxyca_file to trust a private CA for HTTPS between servers.
- Sign-out revokes the session across the cluster; the console idle sign-out follows ui.idle_timeout.
- Console: right-click file menu, drag and drop of whole folders, cut and paste to move, upload conflict choices, resume of interrupted uploads, upload verification, trash restore choices, editable shortcuts.
- Search locked filter, jobs state filter, per-user link stats with last cleanup details, configurable per-user link limit.
Performance
- Creates no longer take locks when the metadata store checks the namespace itself; overwrites lock only the file's own path.
- Metadata writes are batched into one replicated message, and file syncs are batched per flush.
- Reads use zero-copy transfers and a cached directory handle.
- Single node, same machine, SQLite index, 1 KB files, 64 clients, against 1.6.0: new files 159/s (44 failed) to 773/s (0 failed); overwrites 154/s (56 failed) to 778/s (0 failed).
Bug Fixes
- Single lock namespace (path:<path>) for path locks.
- Erasure shards keyed by a random ID, with shard repair.
- Staged updates for file writes.
- S3 backend nil-pointer fixes.
- LocalFS directory fsync after renames and writes.
- Internal proxy streaming no longer hits the request timeout.
- SQLite prefix matching is case-sensitive.
- Redis update and rename are atomic.
- Metadata deletes cascade to child entries.
v1.6.0 — Security & performance hardening2026-08-01
Findings from an adversarial security and performance review of the whole codebase. Ten confirmed defects fixed at the root, each covered by a regression test that was first confirmed to fail against the pre-fix code. No existing behaviour was changed except where noted under Breaking Changes.
Security
- Path-confusion privilege escalation (critical). The metadata stores key on the exact request path string, while the storage backends normalize it via pathutil.Clean before touching disk. ParseFilePath validated the path but built FullPath from the raw request, so the two disagreed for any non-canonical path. PUT /v1/files/dir/../secret.txt created metadata under /dir/../secret.txt — no ErrAlreadyExists, and the ownership check fell through to a parent that does not exist and was allowed — while the bytes landed on <root>/secret.txt, overwriting another user's file. Any authenticated user could destroy any other user's data and leave orphaned metadata behind. ParseFilePath now canonicalizes before deriving FullPath, ParentPath, or Name.
- Same class via the move endpoint (critical). PATCH /v1/files resolved the destination body field with no validation and no canonicalization at all, giving a second independent route to the same overwrite. Request-body paths never pass through ParseFilePath, so they are now validated and canonicalized explicitly.
- Root-escape check bypass. pathutil.Clean returned early when a path collapsed to /, skipping the traversal-depth check entirely, so .. and a/../.. were accepted instead of rejected. Combined with canonicalization this would have retargeted operations at the root — a DELETE on .. becoming a delete of /. The depth check now runs before the early return.
- Unstable API-key identity. User IDs were derived from a key's position in auth.api_keys (api-user-0, api-user-1, …) and that string is persisted as each resource's owner. Revoking one key shifted every later key's identity, silently transferring ownership of the revoked user's files to the next key holder. See New Features for the fix.
- WebSocket upload memory exhaustion. Uploads were buffered whole in memory, so peak usage was upload size × concurrency with no cap on concurrent sockets. Payloads now spool to an immediately-unlinked temp file past 8 MiB, bounding memory per connection.
Bug Fixes
- Raft FSM non-determinism. Apply called time.Now(), but it runs independently on every replica and again on log replay after a restart. Replicas persisted different UpdatedAt values for the same log entry, and a restarting node rewrote history — every renamed file's modification time jumped to the restart moment. Commands are now stamped once by the leader in applyAsLeader, the single point where any command (local or forwarded) enters the log. Pre-upgrade log entries carry no timestamp and preserve their existing value on replay.
New Features
- auth.apikeyusers — maps an explicit app user ID to its API key, so identity is bound to a name rather than to list position. Keys can be revoked, rotated, or reordered without reassigning ownership of existing files. Configurable per entry from the environment as CALLFSAUTHAPIKEYUSERS<USERID>. The legacy auth.api_keys list is unchanged and continues to work; both forms may be used together for migration, and a startup warning is logged when the positional form is in use.
Performance
- Raft directory listing is no longer O(total files). Listing one directory scanned every metadata entry in the cluster while holding the FSM lock. A child index now answers listings directly. The index is derived, not persisted — it is rebuilt on snapshot restore, so the snapshot format is unchanged and a defect there cannot corrupt replicated state.
- Redis directory listing no longer issues one round trip per child. ListChildren called GET per entry, so latency grew linearly with directory size. It now batches through MGET in bounded chunks of 512.
- Rate-limiter eviction no longer scans per request. At the 100k-entry cap the limiter scanned the whole map under its mutex to evict a single entry, so every request from a new IP paid a full scan — an address-rotating client could hold the map at the cap and serialize all request handling. Eviction now reclaims expired entries first, otherwise frees a 1,000-entry batch.
Breaking Changes
- CallFS now refuses to start if auth.internalproxysecret is reused as an API key. Such a configuration previously started and silently granted that key holder full admin bypass. A config doing this will need the duplicate removed before upgrading.
- auth.apikeyusers rejects the reserved user IDs root, internal-proxy, and anything matching api-user-<number>, and a key may appear only once across both key forms.
- The api_keys default no longer pre-seeds the default-api-key placeholder. That value was always rejected at validation, so a server with no configured keys still fails to start — only the error message changes.
Internal Changes
- The release workflow is now idempotent: it uploads into an existing release for the tag instead of failing, so a tag published by release.sh no longer leaves a red build.
- Raft FSMs are built through a single newFSM constructor shared by production and tests, so state fields cannot be initialized in one path and missed in the other.
Tests
- Nine new test files covering path canonicalization and root-escape rejection, move-destination validation, FSM determinism and legacy-log replay, the Raft child index (validated against the full scan it replaced, including snapshot restore), API-key identity stability across revocation, auth config validation, environment-variable overrides, rate-limiter eviction, and upload spooling across the memory/disk boundary.
Documentation
- README.md, config.yaml.example, docsmarkdown/02-configuration.md, and docsmarkdown/04-authentication-security.md document apikeyusers, the positional-identity hazard in api_keys, and the reserved user IDs. The documented environment-variable form was verified by an executing test rather than assumed.
---
v1.5.1 — Security patch2026-08-01
本次为纯安全补丁版本,一次性清理了仓库全部16条依赖安全公告,govulncheck显示CallFS代码本身及其依赖均为0漏洞。
主要升级:quic-go升至0.59.1,修复HTTP/3 QPACK尾部字段展开导致的内存耗尽问题——这是唯一实际可触及的漏洞,开启QUIC后http3.Server会暴露给未认证对端;go-chi/chi升至5.3.0,修复RedirectSlashes中间件的开放重定向等路由问题(本项目未启用该中间件);golang.org/x/crypto连升多个版本,清掉12条集中在x/crypto/ssh的公告,其中4条为严重级,但CallFS不涉及SSH代码;另升级x/net与x/text,修复HTML解析器DoS等问题。仍有3条公告上游未发布补丁,均无法从CallFS代码触达。
注意:源码构建的最低Go版本从1.24提高到1.25(受quic-go要求),Docker构建镜像同步改为golang:1.25-alpine;预编译二进制和容器镜像不受影响。相关文档的版本说明已一并更新。
v1.5.0 — First-class rename & move2026-06-05
这版为PATCH /v1/files/{path}加上了重命名与移动两个一等操作(此前需下载、重新上传再删除,见#3)。请求体二选一:传name只改名,同目录同后端;传destination等字段可跨目录移动,并可切换后端与实例,文件与目录(含整棵子树)均支持。元数据与底层字节同步迁移,先移字节,失败则源文件保持原状;同实例本地文件系统重命名是原子操作。覆盖SQLite、PostgreSQL、Redis、Raft等元数据存储,本地FS、S3、内部代理等后端;纠删码文件只重编分片元数据,不搬数据。跨服务器请求会自动代理到目标节点。限制:erasure后端的转入转出返回400,跨后端或实例的目录移动同样不支持(文件不受限)。API版本升至1.5.0,文档与Swagger同步更新。
v1.4.02026-04-11
本次v1.4.0版本的更新说明中未列出具体改动内容,仅提供了与v1.3.0的完整变更对比链接,建议前往查看提交记录以了解实际更新。
v1.3.02026-04-11
Breaking Changes
- Authorization model replaced: Removed Unix-style UID/GID permission system. Authorization is now based on an owner string field (the app user ID). App users have no relationship to OS users. The Metadata struct no longer has UID or GID fields; use Owner instead.
- API response headers changed: X-CallFS-UID and X-CallFS-GID headers replaced with X-CallFS-Owner.
- JSON response format changed: File listing uid/gid integer fields replaced with owner string field.
- Database schema migration: SQLite schema replaces uid/gid INTEGER columns with owner TEXT. Postgres migration 003replaceuidgidwith_owner adds owner column and drops uid/gid.
New Features
- Owner-based access control: files and directories track their creator via the Owner field. Owners have full access; other authenticated users can read files and create children in directories; admin users (root, internal-proxy) bypass all checks.
- Engine.GetMetadataUncached() for bypassing the metadata cache when fresh data is needed.
Bug Fixes
- Raft stale reads: Fixed ListChildren on follower nodes returning partially-replicated results. Followers now forward to the leader for consistent reads.
- Cross-server Content-Length mismatch: Fixed empty responses when reading files after concurrent cross-server writes.
- S3/MinIO SSE error: Fixed 500 errors on S3 file creation with MinIO due to default SSE config.
- Integration test fixes: Fixed env-var override test (scratch container), test framework assertion counter.
Tests
- 16 new unit tests for auth (authenticator + authorizer).
- All 35 Docker-based integration test suites pass.
Documentation
- Comprehensive audit of all 12 documentation files. Fixed 23 discrepancies.
Full Changelog: https://github.com/ebogdum/callfs/compare/v1.2.0...v1.3.0
v1.2.02026-04-03
v1.2.0带来Reed-Solomon纠删码,可跨多台服务器并行下载分片,并新增/v1/shards/{path}/{index}接口单独取回某个分片。文档做了成体系的补漏:认证方式由"JWT"更正为API key,补上/v1/shards与WebSocket接口/v1/files/ws、纠删码头X-CallFS-Erasure-*、集群加入所需的--api-endpoint与--internal-secret两个CLI参数,以及限流规则(链接生成100req/s、下载10req/s);与MinIO、SeaweedFS、Ceph RGW的功能对比表也一并修正。修复上把Dockerfile的Go版本从1.21改为1.24以对齐go.mod,并加固了认证、限流、分布式锁、错误处理与路径清理。依赖升级golang.org/x/crypto至v0.45.0、mapstructure至v2.4.0。
v1.1.02026-04-03
v1.1.0新增Raft元数据模式,集群自带元数据能力,不再依赖外部组件即可完整跑起来;元数据存储改为可配置,PostgreSQL、SQLite、Redis和Raft都能当后端,部署时可按现有环境随手选。修复部分补上了关键的安全与数据完整性问题,基础设施与运行时路径也做了加固,建议尽快升级到这一版。
Release v1.0.02025-07-15
CallFSv0.1.0首个公开版本,一个以REST接口操作文件的文件系统。
核心能力上,文件读写支持GET、POST、PUT、HEAD、DELETE五种方法,存储后端可选本地文件系统或S3,多服务器架构之间能透明路由。多实例部署的配套也一并到位:分布式锁走Redis,元数据缓存带TTL与LRU淘汰。安全是这版的重点,一次性分享链接用HMAC签名,配合API Key认证与Unix socket本地授权;同时补上限流、结构化错误处理、安全响应头(CSP、HSTS等)与路径规范化,堵住目录穿越一类的常见漏洞。运维侧接入Prometheus指标和带请求ID追踪的JSON日志,另附OpenAPI文档、Docker Compose部署、CI/CD流水线与安全扫描,以及安装、配置、排障等成套文档。