s3

module
v1.0.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: Apache-2.0

README

s3

Hanzo S3

Hanzo S3 is S3-compatible distributed object storage: a master, volume servers, a filer and an S3 gateway, all in one Go binary called s3.

Install

Every release is an image, tagged v<X.Y.Z>:

docker pull ghcr.io/hanzoai/s3:v1.0.24

Or build the s3 binary from a clone:

git clone https://git.hanzo.ai/hanzoai/s3
cd s3 && go build -o s3 ./s3

go install github.com/hanzoai/s3/s3@latest will not work. This tree replaces github.com/tyler-smith/go-bip39, whose upstream repository was deleted, and Go refuses replace directives when installing at a version.

On macOS, if a downloaded binary is quarantined: xattr -d com.apple.quarantine ./s3.

First run

s3 mini brings up the whole stack — master, volume, filer, S3 gateway — with credentials and a bucket already created:

AWS_ACCESS_KEY_ID=admin \
AWS_SECRET_ACCESS_KEY=secret \
S3_BUCKET=my-bucket \
s3 mini -dir=/data

The same run in Docker:

docker run -p 8333:8333 \
  -e AWS_ACCESS_KEY_ID=admin \
  -e AWS_SECRET_ACCESS_KEY=secret \
  -e S3_BUCKET=my-bucket \
  ghcr.io/hanzoai/s3 mini -dir=/data

mini is what reads S3_BUCKET and what listens on 8333. The image's default command is server -s3 -s3.port=9000, which serves S3 on 9000 and creates no bucket — so name mini explicitly, or map 9000 and create the bucket yourself.

Point any S3 client at it:

import boto3

s3 = boto3.client(
    "s3", endpoint_url="http://localhost:8333",
    aws_access_key_id="admin", aws_secret_access_key="secret",
    region_name="us-east-1",
)
s3.put_object(Bucket="my-bucket", Key="hello.txt", Body=b"hi")
print(s3.get_object(Bucket="my-bucket", Key="hello.txt")["Body"].read())

What s3 mini starts:

Service Address
S3 endpoint http://localhost:8333
Master UI http://localhost:9333
Volume server http://localhost:9340
Filer UI http://localhost:8888
WebDAV http://localhost:7333
Iceberg REST catalog http://localhost:8181
Admin UI http://localhost:23646

S3_BUCKET takes a comma-separated list. S3_TABLE_BUCKET creates S3 Tables (Iceberg) buckets. Leave the AWS keys out and the S3 gateway runs unauthenticated, which is fine for local development and nothing else.

Running it for real

s3 mini is one process for convenience. In a cluster you run the components separately:

s3 master -mdir=/data/master
s3 volume -dir=/data/vol1 -master=<master_host>:9333 -port=8081
s3 filer  -master=<master_host>:9333
s3 s3     -filer=<filer_host>:8888 -port=8333

Add volume servers to add capacity — each one registers with the master and starts taking writes. s3 -h lists every command; s3 <command> -h lists its flags. s3 scaffold writes starter config files.

Console

s3 admin serves the web console on port 23646 — cluster topology, volume and collection management, a file browser, users, policies and service accounts, and scheduled maintenance:

s3 admin -master=<master_host>:9333 -adminPassword=<password> -dataDir=/var/lib/s3-admin

Leave -adminPassword unset and the console runs with no authentication, so set one anywhere it is reachable. -readOnlyUser/-readOnlyPassword add a view-only account. -dataDir persists console configuration and maintenance state across restarts.

For administration from a terminal, s3 shell is an interactive shell over the same cluster: buckets and their lifecycle, quota, versioning and object lock; IAM users, groups, policies, access keys and service accounts; volumes, erasure coding, the filer tree and remote tiering. help lists them all.

Beyond the S3 API, the filer gives you POSIX-shaped directories over HTTP, FUSE mounting (s3 mount), WebDAV, cross-cluster replication (s3 filer.sync), tiering to remote object stores, erasure coding for warm data, and a built-in Iceberg REST catalog so Spark, Trino, DuckDB and friends can read tables without a separate metastore. Kubernetes manifests are in k8s/, Docker Compose files in docker/.

Clients

Any S3 client works. Ours for Go is hanzos3/go, module github.com/hanzos3/go. This repository is the server.

One name

The product is Hanzo S3. The source repo hanzoai/storage redirects here — a rename, not a separate product. "Hanzo Storage" in our copy is stale wording, not a second server.

The image ghcr.io/hanzoai/storage is a different matter, and the repo rename does not carry over to it: live compose files still pull it and start it with minio server, so it is not this server. Read a hanzoai/storage image reference as MinIO until it is retired.

hanzoai/storage-go and hanzoai/s3-go were earlier names for the Go client and are deleted, not redirected — a Go module path cannot redirect, so anything still pinning them fails to resolve. github.com/hanzos3/go is the one that exists.

Docs

LLM.md in this repository is the deep reference: architecture, the filer metadata store, the ZAP transport, and how S3 fits the rest of the platform. docs.hanzo.ai covers the platform around it.

Lineage

Hanzo S3 is a fork of SeaweedFS at its 4.34 release series, Apache-2.0, copyright Chris Lu — see NOTICE. The upstream binary is weed; ours is s3, and every import path is github.com/hanzoai/s3. The storage design it inherits comes from Facebook's Haystack paper, with erasure coding after f4. Two support libraries are forked alongside it, each keeping its own upstream licence: hanzoai/goexif (BSD-2-Clause) and hanzoai/go-fuse (BSD-3-Clause).

License

Apache-2.0 — see LICENSE.

Directories

Path Synopsis
cmd
pqproof command
docker
other
s3
admin/view/app
templ: version: v0.3.1001
templ: version: v0.3.1001
admin/view/components
templ: version: v0.3.1001
templ: version: v0.3.1001
admin/view/layout
templ: version: v0.3.1001
templ: version: v0.3.1001
filer/foundationdb
Package foundationdb provides a FoundationDB-based filer store for Hanzo.
Package foundationdb provides a FoundationDB-based filer store for Hanzo.
filer/luxdb
Package luxdb implements the filer metadata store over luxfi/database, the lux-canonical key-value abstraction.
Package luxdb implements the filer metadata store over luxfi/database, the lux-canonical key-value abstraction.
filer/posixlock
Package posixlock implements the conflict, coalescing, and range-split logic for POSIX advisory file locks — fcntl byte-range and flock whole-file — as a pure per-inode lock set with no concurrency control of its own.
Package posixlock implements the conflict, coalescing, and range-split logic for POSIX advisory file locks — fcntl byte-range and flock whole-file — as a pure per-inode lock set with no concurrency control of its own.
filer/sqlite
Package sqlite is for sqlite filer store.
Package sqlite is for sqlite filer store.
glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
iam
iam/utils
Package utils provides utility functions for AWS IAM ARN parsing and role extraction.
Package utils provides utility functions for AWS IAM ARN parsing and role extraction.
kms
kms/lux
Package lux is the KMS provider backed by luxfi/kms — the one place Hanzo and Lux keep secrets.
Package lux is the KMS provider backed by luxfi/kms — the one place Hanzo and Lux keep secrets.
mq
mq/agent/agentconv
Package agentconv transcodes the schema_pb messages that ride inside the HanzoMessagingAgent RPCs (Topic, RecordType, RecordValue, PartitionOffset) between their protobuf form — still the lingua franca of the broker/topic/ pub_client/sub_client layers — and their ZAP wire form (mq_schemawire).
Package agentconv transcodes the schema_pb messages that ride inside the HanzoMessagingAgent RPCs (Topic, RecordType, RecordValue, PartitionOffset) between their protobuf form — still the lingua franca of the broker/topic/ pub_client/sub_client layers — and their ZAP wire form (mq_schemawire).
mq/broker/brokerpb
Package brokerpb transcodes the mq_pb broker-domain messages that ride inside the HanzoMessaging RPCs (DataMessage, BrokerPartitionAssignment, the SubscribeMessage and SubscriberToSubCoordinator stream frames) between their protobuf form — still the in-memory model of the broker/topic/publisher/ subscriber layers — and their ZAP wire form (mq_brokerwire).
Package brokerpb transcodes the mq_pb broker-domain messages that ride inside the HanzoMessaging RPCs (DataMessage, BrokerPartitionAssignment, the SubscribeMessage and SubscriberToSubCoordinator stream frames) between their protobuf form — still the in-memory model of the broker/topic/publisher/ subscriber layers — and their ZAP wire form (mq_brokerwire).
mq/kafka
Package kafka provides Kafka protocol implementation for Hanzo MQ
Package kafka provides Kafka protocol implementation for Hanzo MQ
pb
pb/filerstub
Package filerstub provides embeddable, do-nothing implementations of the generated server interfaces (filer_pb.HanzoFilerServer, master_pb.HanzoServer) for tests.
Package filerstub provides embeddable, do-nothing implementations of the generated server interfaces (filer_pb.HanzoFilerServer, master_pb.HanzoServer) for tests.
pb/rpc
Package rpc holds the grpc-free streaming contracts shared by the generated *_pb packages.
Package rpc holds the grpc-free streaming contracts shared by the generated *_pb packages.
plugin/worker/handlers
Package handlers is an aggregator that blank-imports every plugin worker handler subpackage so their init() functions register with the handler registry.
Package handlers is an aggregator that blank-imports every plugin worker handler subpackage so their init() functions register with the handler registry.
replication/filerclient
Package filerclient is the replication subsystem's strangler seam onto the native ZAP transport for the HanzoFiler service.
Package filerclient is the replication subsystem's strangler seam onto the native ZAP transport for the HanzoFiler service.
s3api
Package s3api implements the S3 API for Hanzo.
Package s3api implements the S3 API for Hanzo.
s3api/lifecycle_xml
Package lifecycle_xml is the XML wire-form for S3 BucketLifecycleConfiguration: the structs S3 PutBucketLifecycleConfiguration accepts and GetBucketLifecycleConfiguration returns.
Package lifecycle_xml is the XML wire-form for S3 BucketLifecycleConfiguration: the structs S3 PutBucketLifecycleConfiguration accepts and GetBucketLifecycleConfiguration returns.
s3api/s3lifecycle/bootstrap
Package bootstrap is the bucket-level lifecycle walker.
Package bootstrap is the bucket-level lifecycle walker.
s3api/s3lifecycle/dailyrun
Package dailyrun implements the daily-replay s3 lifecycle worker described in s3/s3api/s3lifecycle/DESIGN.md.
Package dailyrun implements the daily-replay s3 lifecycle worker described in s3/s3api/s3lifecycle/DESIGN.md.
s3api/s3lifecycle/engine
Package engine compiles per-bucket lifecycle rules into a CompiledAction snapshot.
Package engine compiles per-bucket lifecycle rules into a CompiledAction snapshot.
s3api/s3lifecycle/lifecycletest
Package lifecycletest provides reusable test doubles for the lifecycle worker pipeline.
Package lifecycletest provides reusable test doubles for the lifecycle worker pipeline.
security/certreload
Package certreload provides a native, gRPC-free reloading X.509 keypair so both TLS servers (s3/security) and TLS clients (s3/util/http/client) can share one hot-reload implementation without an import cycle between them.
Package certreload provides a native, gRPC-free reloading X.509 keypair so both TLS servers (s3/security) and TLS clients (s3/util/http/client) can share one hot-reload implementation without an import cycle between them.
sftpd
sftp_helpers.go
sftp_helpers.go
sftpd/auth
Package auth provides authentication and authorization functionality for the SFTP server
Package auth provides authentication and authorization functionality for the SFTP server
sftpd/user
Package user provides user management functionality for the SFTP server
Package user provides user management functionality for the SFTP server
storage/backend/all
Package all registers every tiered-storage backend factory.
Package all registers every tiered-storage backend factory.
storage/erasure_coding/distribution
Package distribution provides EC shard distribution algorithms with configurable EC ratios.
Package distribution provides EC shard distribution algorithms with configurable EC ratios.
storage/erasure_coding/ecbalancer
Package ecbalancer holds the EC-shard rebalancing policy shared by the shell ec.balance command and the admin EC balance worker.
Package ecbalancer holds the EC-shard rebalancing policy shared by the shell ec.balance command and the admin EC balance worker.
storage/volume_replica
Package volume_replica reconciles regular (non-EC) volume replicas: it reads per-replica status, builds the union of all live entries onto the most-complete replica, and returns that replica.
Package volume_replica reconciles regular (non-EC) volume replicas: it reads per-replica status, builds the union of all live entries onto the most-complete replica, and returns that replica.
svc/filer
Package filerzap is the gRPC→ZAP migration layer for the filer service: it converts the protobuf filer aggregate types (filer_pb) to and from their zero-copy ZAP wire encodings (filerwire), so the filer can serve and be called over the canonical github.com/zap-proto/go transport instead of gRPC.
Package filerzap is the gRPC→ZAP migration layer for the filer service: it converts the protobuf filer aggregate types (filer_pb) to and from their zero-copy ZAP wire encodings (filerwire), so the filer can serve and be called over the canonical github.com/zap-proto/go transport instead of gRPC.
svc/object
Package object is S3's native ZAP service — the interface internal Hanzo services use to talk to S3 over the mesh (zero-copy ZAP, never HTTP).
Package object is S3's native ZAP service — the interface internal Hanzo services use to talk to S3 over the mesh (zero-copy ZAP, never HTTP).
util/fla9
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
util/httpdown
Package httpdown provides http.ConnState enabled graceful termination of http.Server.
Package httpdown provides http.ConnState enabled graceful termination of http.Server.
util/pgxutil
Package pgxutil holds shared helpers for opening *sql.DB handles backed by jackc/pgx, used by the postgres filer and credential stores so they stay consistent on connection setup, mTLS handling and PgBouncer compatibility.
Package pgxutil holds shared helpers for opening *sql.DB handles backed by jackc/pgx, used by the postgres filer and credential stores so they stay consistent on connection setup, mTLS handling and PgBouncer compatibility.
wire/iamadapt
Package iamadapt bridges the protobuf iam_pb domain structs and the zero-copy iamwire ZAP messages for the HanzoS3IamCache RPC.
Package iamadapt bridges the protobuf iam_pb domain structs and the zero-copy iamwire ZAP messages for the HanzoS3IamCache RPC.
wire/mq_schema
Package mq_schemawire holds the native ZAP schemas for mq_schema.proto — zero-copy, protobuf-free, no _pb.
Package mq_schemawire holds the native ZAP schemas for mq_schema.proto — zero-copy, protobuf-free, no _pb.
wire/plugin/zapbridge
Package pluginzapbridge converts the two PluginControlService.WorkerStream frame types between their protobuf domain form (s3/pb/plugin_pb) and their ZAP wire form (s3/wire/plugin).
Package pluginzapbridge converts the two PluginControlService.WorkerStream frame types between their protobuf domain form (s3/pb/plugin_pb) and their ZAP wire form (s3/wire/plugin).
worker/wirebridge
Package wirebridge is the single, orthogonal seam between the worker protobuf message tree (worker_pb) and the native ZAP wire envelopes (workerwire) carried over the zap-proto transport.
Package wirebridge is the single, orthogonal seam between the worker protobuf message tree (worker_pb) and the native ZAP wire envelopes (workerwire) carried over the zap-proto transport.
s3-volume
tools command
telemetry
test command
server module
test
mq/consumer command
mq/producer command
postgres command
s3/multipart command
s3/s3client command
testutil
Package testutil provides shared test utilities for Hanzo integration tests.
Package testutil provides shared test utilities for Hanzo integration tests.
kafka module
s3/iam module
unmaintained
check_disk_size command
compact_leveldb command
disk command
fix_dat command
repeated_vacuum command
see_dat command
see_idx command
see_log_entry command
see_meta command
stress command
volume_tailer command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL